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 VolumeId = Id;
154pub type WorkspaceId = Id;
155#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
156pub struct BuildArg {
157 pub name: String,
158 pub value: String,
159}
160#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
161pub struct PipelineLabel {
162 pub name: String,
163 pub value: String,
164}
165#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
166pub struct PortForward {
167 pub backend: isize,
168 pub frontend: isize,
169 pub protocol: NetworkProtocol,
170}
171pub trait Exportable {
174 fn export(
175 &self,
176 path: impl Into<String>,
177 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send;
178 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
179}
180#[derive(Clone)]
181pub struct ExportableClient {
182 pub proc: Option<Arc<DaggerSessionProc>>,
183 pub selection: Selection,
184 pub graphql_client: DynGraphQLClient,
185}
186impl IntoID<Id> for ExportableClient {
187 fn into_id(
188 self,
189 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
190 Box::pin(async move { self.id().await })
191 }
192}
193impl ExportableClient {
194 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
195 let mut query = self.selection.select("export");
196 query = query.arg("path", path.into());
197 query.execute(self.graphql_client.clone()).await
198 }
199 pub async fn id(&self) -> Result<Id, DaggerError> {
200 let query = self.selection.select("id");
201 query.execute(self.graphql_client.clone()).await
202 }
203}
204impl Loadable for ExportableClient {
205 fn graphql_type() -> &'static str {
206 "Exportable"
207 }
208 fn from_query(
209 proc: Option<Arc<DaggerSessionProc>>,
210 selection: Selection,
211 graphql_client: DynGraphQLClient,
212 ) -> Self {
213 Self {
214 proc,
215 selection,
216 graphql_client,
217 }
218 }
219}
220impl Exportable for ExportableClient {
221 fn export(
222 &self,
223 path: impl Into<String>,
224 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
225 let mut query = self.selection.select("export");
226 query = query.arg("path", path.into());
227 let graphql_client = self.graphql_client.clone();
228 async move { query.execute(graphql_client).await }
229 }
230 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
231 let query = self.selection.select("id");
232 let graphql_client = self.graphql_client.clone();
233 async move { query.execute(graphql_client).await }
234 }
235}
236pub trait Node {
238 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
239}
240#[derive(Clone)]
241pub struct NodeClient {
242 pub proc: Option<Arc<DaggerSessionProc>>,
243 pub selection: Selection,
244 pub graphql_client: DynGraphQLClient,
245}
246impl IntoID<Id> for NodeClient {
247 fn into_id(
248 self,
249 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
250 Box::pin(async move { self.id().await })
251 }
252}
253impl NodeClient {
254 pub async fn id(&self) -> Result<Id, DaggerError> {
255 let query = self.selection.select("id");
256 query.execute(self.graphql_client.clone()).await
257 }
258}
259impl Loadable for NodeClient {
260 fn graphql_type() -> &'static str {
261 "Node"
262 }
263 fn from_query(
264 proc: Option<Arc<DaggerSessionProc>>,
265 selection: Selection,
266 graphql_client: DynGraphQLClient,
267 ) -> Self {
268 Self {
269 proc,
270 selection,
271 graphql_client,
272 }
273 }
274}
275impl Node for NodeClient {
276 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
277 let query = self.selection.select("id");
278 let graphql_client = self.graphql_client.clone();
279 async move { query.execute(graphql_client).await }
280 }
281}
282pub trait Syncer {
285 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
286 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send;
287}
288#[derive(Clone)]
289pub struct SyncerClient {
290 pub proc: Option<Arc<DaggerSessionProc>>,
291 pub selection: Selection,
292 pub graphql_client: DynGraphQLClient,
293}
294impl IntoID<Id> for SyncerClient {
295 fn into_id(
296 self,
297 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
298 Box::pin(async move { self.id().await })
299 }
300}
301impl SyncerClient {
302 pub async fn id(&self) -> Result<Id, DaggerError> {
303 let query = self.selection.select("id");
304 query.execute(self.graphql_client.clone()).await
305 }
306 pub async fn sync(&self) -> Result<Id, DaggerError> {
307 let query = self.selection.select("sync");
308 query.execute(self.graphql_client.clone()).await
309 }
310}
311impl Loadable for SyncerClient {
312 fn graphql_type() -> &'static str {
313 "Syncer"
314 }
315 fn from_query(
316 proc: Option<Arc<DaggerSessionProc>>,
317 selection: Selection,
318 graphql_client: DynGraphQLClient,
319 ) -> Self {
320 Self {
321 proc,
322 selection,
323 graphql_client,
324 }
325 }
326}
327impl Syncer for SyncerClient {
328 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
329 let query = self.selection.select("id");
330 let graphql_client = self.graphql_client.clone();
331 async move { query.execute(graphql_client).await }
332 }
333 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
334 let query = self.selection.select("sync");
335 let graphql_client = self.graphql_client.clone();
336 async move { query.execute(graphql_client).await }
337 }
338}
339#[derive(Clone)]
340pub struct Address {
341 pub proc: Option<Arc<DaggerSessionProc>>,
342 pub selection: Selection,
343 pub graphql_client: DynGraphQLClient,
344}
345#[derive(Builder, Debug, PartialEq)]
346pub struct AddressDirectoryOpts<'a> {
347 #[builder(setter(into, strip_option), default)]
348 pub exclude: Option<Vec<&'a str>>,
349 #[builder(setter(into, strip_option), default)]
350 pub gitignore: Option<bool>,
351 #[builder(setter(into, strip_option), default)]
352 pub include: Option<Vec<&'a str>>,
353 #[builder(setter(into, strip_option), default)]
354 pub no_cache: Option<bool>,
355}
356#[derive(Builder, Debug, PartialEq)]
357pub struct AddressFileOpts<'a> {
358 #[builder(setter(into, strip_option), default)]
359 pub exclude: Option<Vec<&'a str>>,
360 #[builder(setter(into, strip_option), default)]
361 pub gitignore: Option<bool>,
362 #[builder(setter(into, strip_option), default)]
363 pub include: Option<Vec<&'a str>>,
364 #[builder(setter(into, strip_option), default)]
365 pub no_cache: Option<bool>,
366}
367impl IntoID<Id> for Address {
368 fn into_id(
369 self,
370 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
371 Box::pin(async move { self.id().await })
372 }
373}
374impl Loadable for Address {
375 fn graphql_type() -> &'static str {
376 "Address"
377 }
378 fn from_query(
379 proc: Option<Arc<DaggerSessionProc>>,
380 selection: Selection,
381 graphql_client: DynGraphQLClient,
382 ) -> Self {
383 Self {
384 proc,
385 selection,
386 graphql_client,
387 }
388 }
389}
390impl Address {
391 pub fn container(&self) -> Container {
393 let query = self.selection.select("container");
394 Container {
395 proc: self.proc.clone(),
396 selection: query,
397 graphql_client: self.graphql_client.clone(),
398 }
399 }
400 pub fn directory(&self) -> Directory {
406 let query = self.selection.select("directory");
407 Directory {
408 proc: self.proc.clone(),
409 selection: query,
410 graphql_client: self.graphql_client.clone(),
411 }
412 }
413 pub fn directory_opts<'a>(&self, opts: AddressDirectoryOpts<'a>) -> Directory {
419 let mut query = self.selection.select("directory");
420 if let Some(exclude) = opts.exclude {
421 query = query.arg("exclude", exclude);
422 }
423 if let Some(include) = opts.include {
424 query = query.arg("include", include);
425 }
426 if let Some(gitignore) = opts.gitignore {
427 query = query.arg("gitignore", gitignore);
428 }
429 if let Some(no_cache) = opts.no_cache {
430 query = query.arg("noCache", no_cache);
431 }
432 Directory {
433 proc: self.proc.clone(),
434 selection: query,
435 graphql_client: self.graphql_client.clone(),
436 }
437 }
438 pub fn file(&self) -> File {
444 let query = self.selection.select("file");
445 File {
446 proc: self.proc.clone(),
447 selection: query,
448 graphql_client: self.graphql_client.clone(),
449 }
450 }
451 pub fn file_opts<'a>(&self, opts: AddressFileOpts<'a>) -> File {
457 let mut query = self.selection.select("file");
458 if let Some(exclude) = opts.exclude {
459 query = query.arg("exclude", exclude);
460 }
461 if let Some(include) = opts.include {
462 query = query.arg("include", include);
463 }
464 if let Some(gitignore) = opts.gitignore {
465 query = query.arg("gitignore", gitignore);
466 }
467 if let Some(no_cache) = opts.no_cache {
468 query = query.arg("noCache", no_cache);
469 }
470 File {
471 proc: self.proc.clone(),
472 selection: query,
473 graphql_client: self.graphql_client.clone(),
474 }
475 }
476 pub fn git_ref(&self) -> GitRef {
478 let query = self.selection.select("gitRef");
479 GitRef {
480 proc: self.proc.clone(),
481 selection: query,
482 graphql_client: self.graphql_client.clone(),
483 }
484 }
485 pub fn git_repository(&self) -> GitRepository {
487 let query = self.selection.select("gitRepository");
488 GitRepository {
489 proc: self.proc.clone(),
490 selection: query,
491 graphql_client: self.graphql_client.clone(),
492 }
493 }
494 pub async fn id(&self) -> Result<Id, DaggerError> {
496 let query = self.selection.select("id");
497 query.execute(self.graphql_client.clone()).await
498 }
499 pub fn secret(&self) -> Secret {
501 let query = self.selection.select("secret");
502 Secret {
503 proc: self.proc.clone(),
504 selection: query,
505 graphql_client: self.graphql_client.clone(),
506 }
507 }
508 pub fn service(&self) -> Service {
510 let query = self.selection.select("service");
511 Service {
512 proc: self.proc.clone(),
513 selection: query,
514 graphql_client: self.graphql_client.clone(),
515 }
516 }
517 pub fn socket(&self) -> Socket {
519 let query = self.selection.select("socket");
520 Socket {
521 proc: self.proc.clone(),
522 selection: query,
523 graphql_client: self.graphql_client.clone(),
524 }
525 }
526 pub async fn value(&self) -> Result<String, DaggerError> {
528 let query = self.selection.select("value");
529 query.execute(self.graphql_client.clone()).await
530 }
531 pub fn volume(&self) -> Volume {
533 let query = self.selection.select("volume");
534 Volume {
535 proc: self.proc.clone(),
536 selection: query,
537 graphql_client: self.graphql_client.clone(),
538 }
539 }
540}
541impl Node for Address {
542 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
543 let query = self.selection.select("id");
544 let graphql_client = self.graphql_client.clone();
545 async move { query.execute(graphql_client).await }
546 }
547}
548#[derive(Clone)]
549pub struct Binding {
550 pub proc: Option<Arc<DaggerSessionProc>>,
551 pub selection: Selection,
552 pub graphql_client: DynGraphQLClient,
553}
554impl IntoID<Id> for Binding {
555 fn into_id(
556 self,
557 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
558 Box::pin(async move { self.id().await })
559 }
560}
561impl Loadable for Binding {
562 fn graphql_type() -> &'static str {
563 "Binding"
564 }
565 fn from_query(
566 proc: Option<Arc<DaggerSessionProc>>,
567 selection: Selection,
568 graphql_client: DynGraphQLClient,
569 ) -> Self {
570 Self {
571 proc,
572 selection,
573 graphql_client,
574 }
575 }
576}
577impl Binding {
578 pub fn as_address(&self) -> Address {
580 let query = self.selection.select("asAddress");
581 Address {
582 proc: self.proc.clone(),
583 selection: query,
584 graphql_client: self.graphql_client.clone(),
585 }
586 }
587 pub fn as_cache_volume(&self) -> CacheVolume {
589 let query = self.selection.select("asCacheVolume");
590 CacheVolume {
591 proc: self.proc.clone(),
592 selection: query,
593 graphql_client: self.graphql_client.clone(),
594 }
595 }
596 pub fn as_changeset(&self) -> Changeset {
598 let query = self.selection.select("asChangeset");
599 Changeset {
600 proc: self.proc.clone(),
601 selection: query,
602 graphql_client: self.graphql_client.clone(),
603 }
604 }
605 pub fn as_check(&self) -> Check {
607 let query = self.selection.select("asCheck");
608 Check {
609 proc: self.proc.clone(),
610 selection: query,
611 graphql_client: self.graphql_client.clone(),
612 }
613 }
614 pub fn as_check_group(&self) -> CheckGroup {
616 let query = self.selection.select("asCheckGroup");
617 CheckGroup {
618 proc: self.proc.clone(),
619 selection: query,
620 graphql_client: self.graphql_client.clone(),
621 }
622 }
623 pub fn as_cloud(&self) -> Cloud {
625 let query = self.selection.select("asCloud");
626 Cloud {
627 proc: self.proc.clone(),
628 selection: query,
629 graphql_client: self.graphql_client.clone(),
630 }
631 }
632 pub fn as_container(&self) -> Container {
634 let query = self.selection.select("asContainer");
635 Container {
636 proc: self.proc.clone(),
637 selection: query,
638 graphql_client: self.graphql_client.clone(),
639 }
640 }
641 pub fn as_diff_stat(&self) -> DiffStat {
643 let query = self.selection.select("asDiffStat");
644 DiffStat {
645 proc: self.proc.clone(),
646 selection: query,
647 graphql_client: self.graphql_client.clone(),
648 }
649 }
650 pub fn as_directory(&self) -> Directory {
652 let query = self.selection.select("asDirectory");
653 Directory {
654 proc: self.proc.clone(),
655 selection: query,
656 graphql_client: self.graphql_client.clone(),
657 }
658 }
659 pub fn as_env(&self) -> Env {
661 let query = self.selection.select("asEnv");
662 Env {
663 proc: self.proc.clone(),
664 selection: query,
665 graphql_client: self.graphql_client.clone(),
666 }
667 }
668 pub fn as_env_file(&self) -> EnvFile {
670 let query = self.selection.select("asEnvFile");
671 EnvFile {
672 proc: self.proc.clone(),
673 selection: query,
674 graphql_client: self.graphql_client.clone(),
675 }
676 }
677 pub fn as_file(&self) -> File {
679 let query = self.selection.select("asFile");
680 File {
681 proc: self.proc.clone(),
682 selection: query,
683 graphql_client: self.graphql_client.clone(),
684 }
685 }
686 pub fn as_generator(&self) -> Generator {
688 let query = self.selection.select("asGenerator");
689 Generator {
690 proc: self.proc.clone(),
691 selection: query,
692 graphql_client: self.graphql_client.clone(),
693 }
694 }
695 pub fn as_generator_group(&self) -> GeneratorGroup {
697 let query = self.selection.select("asGeneratorGroup");
698 GeneratorGroup {
699 proc: self.proc.clone(),
700 selection: query,
701 graphql_client: self.graphql_client.clone(),
702 }
703 }
704 pub fn as_git_ref(&self) -> GitRef {
706 let query = self.selection.select("asGitRef");
707 GitRef {
708 proc: self.proc.clone(),
709 selection: query,
710 graphql_client: self.graphql_client.clone(),
711 }
712 }
713 pub fn as_git_repository(&self) -> GitRepository {
715 let query = self.selection.select("asGitRepository");
716 GitRepository {
717 proc: self.proc.clone(),
718 selection: query,
719 graphql_client: self.graphql_client.clone(),
720 }
721 }
722 pub fn as_http_state(&self) -> HttpState {
724 let query = self.selection.select("asHTTPState");
725 HttpState {
726 proc: self.proc.clone(),
727 selection: query,
728 graphql_client: self.graphql_client.clone(),
729 }
730 }
731 pub fn as_json_value(&self) -> JsonValue {
733 let query = self.selection.select("asJSONValue");
734 JsonValue {
735 proc: self.proc.clone(),
736 selection: query,
737 graphql_client: self.graphql_client.clone(),
738 }
739 }
740 pub fn as_module(&self) -> Module {
742 let query = self.selection.select("asModule");
743 Module {
744 proc: self.proc.clone(),
745 selection: query,
746 graphql_client: self.graphql_client.clone(),
747 }
748 }
749 pub fn as_module_config_client(&self) -> ModuleConfigClient {
751 let query = self.selection.select("asModuleConfigClient");
752 ModuleConfigClient {
753 proc: self.proc.clone(),
754 selection: query,
755 graphql_client: self.graphql_client.clone(),
756 }
757 }
758 pub fn as_module_source(&self) -> ModuleSource {
760 let query = self.selection.select("asModuleSource");
761 ModuleSource {
762 proc: self.proc.clone(),
763 selection: query,
764 graphql_client: self.graphql_client.clone(),
765 }
766 }
767 pub fn as_search_result(&self) -> SearchResult {
769 let query = self.selection.select("asSearchResult");
770 SearchResult {
771 proc: self.proc.clone(),
772 selection: query,
773 graphql_client: self.graphql_client.clone(),
774 }
775 }
776 pub fn as_search_submatch(&self) -> SearchSubmatch {
778 let query = self.selection.select("asSearchSubmatch");
779 SearchSubmatch {
780 proc: self.proc.clone(),
781 selection: query,
782 graphql_client: self.graphql_client.clone(),
783 }
784 }
785 pub fn as_secret(&self) -> Secret {
787 let query = self.selection.select("asSecret");
788 Secret {
789 proc: self.proc.clone(),
790 selection: query,
791 graphql_client: self.graphql_client.clone(),
792 }
793 }
794 pub fn as_service(&self) -> Service {
796 let query = self.selection.select("asService");
797 Service {
798 proc: self.proc.clone(),
799 selection: query,
800 graphql_client: self.graphql_client.clone(),
801 }
802 }
803 pub fn as_socket(&self) -> Socket {
805 let query = self.selection.select("asSocket");
806 Socket {
807 proc: self.proc.clone(),
808 selection: query,
809 graphql_client: self.graphql_client.clone(),
810 }
811 }
812 pub fn as_stat(&self) -> Stat {
814 let query = self.selection.select("asStat");
815 Stat {
816 proc: self.proc.clone(),
817 selection: query,
818 graphql_client: self.graphql_client.clone(),
819 }
820 }
821 pub async fn as_string(&self) -> Result<String, DaggerError> {
823 let query = self.selection.select("asString");
824 query.execute(self.graphql_client.clone()).await
825 }
826 pub fn as_up(&self) -> Up {
828 let query = self.selection.select("asUp");
829 Up {
830 proc: self.proc.clone(),
831 selection: query,
832 graphql_client: self.graphql_client.clone(),
833 }
834 }
835 pub fn as_up_group(&self) -> UpGroup {
837 let query = self.selection.select("asUpGroup");
838 UpGroup {
839 proc: self.proc.clone(),
840 selection: query,
841 graphql_client: self.graphql_client.clone(),
842 }
843 }
844 pub fn as_volume(&self) -> Volume {
846 let query = self.selection.select("asVolume");
847 Volume {
848 proc: self.proc.clone(),
849 selection: query,
850 graphql_client: self.graphql_client.clone(),
851 }
852 }
853 pub fn as_workspace(&self) -> Workspace {
855 let query = self.selection.select("asWorkspace");
856 Workspace {
857 proc: self.proc.clone(),
858 selection: query,
859 graphql_client: self.graphql_client.clone(),
860 }
861 }
862 pub async fn digest(&self) -> Result<String, DaggerError> {
864 let query = self.selection.select("digest");
865 query.execute(self.graphql_client.clone()).await
866 }
867 pub async fn id(&self) -> Result<Id, DaggerError> {
869 let query = self.selection.select("id");
870 query.execute(self.graphql_client.clone()).await
871 }
872 pub async fn is_null(&self) -> Result<bool, DaggerError> {
874 let query = self.selection.select("isNull");
875 query.execute(self.graphql_client.clone()).await
876 }
877 pub async fn name(&self) -> Result<String, DaggerError> {
879 let query = self.selection.select("name");
880 query.execute(self.graphql_client.clone()).await
881 }
882 pub async fn type_name(&self) -> Result<String, DaggerError> {
884 let query = self.selection.select("typeName");
885 query.execute(self.graphql_client.clone()).await
886 }
887}
888impl Node for Binding {
889 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
890 let query = self.selection.select("id");
891 let graphql_client = self.graphql_client.clone();
892 async move { query.execute(graphql_client).await }
893 }
894}
895#[derive(Clone)]
896pub struct CacheVolume {
897 pub proc: Option<Arc<DaggerSessionProc>>,
898 pub selection: Selection,
899 pub graphql_client: DynGraphQLClient,
900}
901impl IntoID<Id> for CacheVolume {
902 fn into_id(
903 self,
904 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
905 Box::pin(async move { self.id().await })
906 }
907}
908impl Loadable for CacheVolume {
909 fn graphql_type() -> &'static str {
910 "CacheVolume"
911 }
912 fn from_query(
913 proc: Option<Arc<DaggerSessionProc>>,
914 selection: Selection,
915 graphql_client: DynGraphQLClient,
916 ) -> Self {
917 Self {
918 proc,
919 selection,
920 graphql_client,
921 }
922 }
923}
924impl CacheVolume {
925 pub async fn id(&self) -> Result<Id, DaggerError> {
927 let query = self.selection.select("id");
928 query.execute(self.graphql_client.clone()).await
929 }
930}
931impl Node for CacheVolume {
932 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
933 let query = self.selection.select("id");
934 let graphql_client = self.graphql_client.clone();
935 async move { query.execute(graphql_client).await }
936 }
937}
938#[derive(Clone)]
939pub struct Changeset {
940 pub proc: Option<Arc<DaggerSessionProc>>,
941 pub selection: Selection,
942 pub graphql_client: DynGraphQLClient,
943}
944#[derive(Builder, Debug, PartialEq)]
945pub struct ChangesetWithChangesetOpts {
946 #[builder(setter(into, strip_option), default)]
948 pub on_conflict: Option<ChangesetMergeConflict>,
949}
950#[derive(Builder, Debug, PartialEq)]
951pub struct ChangesetWithChangesetsOpts {
952 #[builder(setter(into, strip_option), default)]
954 pub on_conflict: Option<ChangesetsMergeConflict>,
955}
956impl IntoID<Id> for Changeset {
957 fn into_id(
958 self,
959 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
960 Box::pin(async move { self.id().await })
961 }
962}
963impl Loadable for Changeset {
964 fn graphql_type() -> &'static str {
965 "Changeset"
966 }
967 fn from_query(
968 proc: Option<Arc<DaggerSessionProc>>,
969 selection: Selection,
970 graphql_client: DynGraphQLClient,
971 ) -> Self {
972 Self {
973 proc,
974 selection,
975 graphql_client,
976 }
977 }
978}
979impl Changeset {
980 pub async fn added_paths(&self) -> Result<Vec<String>, DaggerError> {
982 let query = self.selection.select("addedPaths");
983 query.execute(self.graphql_client.clone()).await
984 }
985 pub fn after(&self) -> Directory {
987 let query = self.selection.select("after");
988 Directory {
989 proc: self.proc.clone(),
990 selection: query,
991 graphql_client: self.graphql_client.clone(),
992 }
993 }
994 pub fn as_patch(&self) -> File {
996 let query = self.selection.select("asPatch");
997 File {
998 proc: self.proc.clone(),
999 selection: query,
1000 graphql_client: self.graphql_client.clone(),
1001 }
1002 }
1003 pub fn before(&self) -> Directory {
1005 let query = self.selection.select("before");
1006 Directory {
1007 proc: self.proc.clone(),
1008 selection: query,
1009 graphql_client: self.graphql_client.clone(),
1010 }
1011 }
1012 pub async fn diff_stats(&self) -> Result<Vec<DiffStat>, DaggerError> {
1014 let query = self.selection.select("diffStats");
1015 let query = query.select("id");
1016 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1017 Ok(ids
1018 .into_iter()
1019 .map(|id| DiffStat {
1020 proc: self.proc.clone(),
1021 selection: crate::querybuilder::query()
1022 .select("node")
1023 .arg("id", &id.0)
1024 .inline_fragment("DiffStat"),
1025 graphql_client: self.graphql_client.clone(),
1026 })
1027 .collect())
1028 }
1029 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
1035 let mut query = self.selection.select("export");
1036 query = query.arg("path", path.into());
1037 query.execute(self.graphql_client.clone()).await
1038 }
1039 pub async fn id(&self) -> Result<Id, DaggerError> {
1041 let query = self.selection.select("id");
1042 query.execute(self.graphql_client.clone()).await
1043 }
1044 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
1046 let query = self.selection.select("isEmpty");
1047 query.execute(self.graphql_client.clone()).await
1048 }
1049 pub fn layer(&self) -> Directory {
1051 let query = self.selection.select("layer");
1052 Directory {
1053 proc: self.proc.clone(),
1054 selection: query,
1055 graphql_client: self.graphql_client.clone(),
1056 }
1057 }
1058 pub async fn modified_paths(&self) -> Result<Vec<String>, DaggerError> {
1060 let query = self.selection.select("modifiedPaths");
1061 query.execute(self.graphql_client.clone()).await
1062 }
1063 pub async fn removed_paths(&self) -> Result<Vec<String>, DaggerError> {
1065 let query = self.selection.select("removedPaths");
1066 query.execute(self.graphql_client.clone()).await
1067 }
1068 pub async fn sync(&self) -> Result<Changeset, DaggerError> {
1070 let query = self.selection.select("sync");
1071 let id: Id = query.execute(self.graphql_client.clone()).await?;
1072 Ok(Changeset {
1073 proc: self.proc.clone(),
1074 selection: query
1075 .root()
1076 .select("node")
1077 .arg("id", &id.0)
1078 .inline_fragment("Changeset"),
1079 graphql_client: self.graphql_client.clone(),
1080 })
1081 }
1082 pub fn with_changeset(&self, changes: impl IntoID<Id>) -> Changeset {
1090 let mut query = self.selection.select("withChangeset");
1091 query = query.arg_lazy(
1092 "changes",
1093 Box::new(move || {
1094 let changes = changes.clone();
1095 Box::pin(async move { changes.into_id().await.unwrap().quote() })
1096 }),
1097 );
1098 Changeset {
1099 proc: self.proc.clone(),
1100 selection: query,
1101 graphql_client: self.graphql_client.clone(),
1102 }
1103 }
1104 pub fn with_changeset_opts(
1112 &self,
1113 changes: impl IntoID<Id>,
1114 opts: ChangesetWithChangesetOpts,
1115 ) -> Changeset {
1116 let mut query = self.selection.select("withChangeset");
1117 query = query.arg_lazy(
1118 "changes",
1119 Box::new(move || {
1120 let changes = changes.clone();
1121 Box::pin(async move { changes.into_id().await.unwrap().quote() })
1122 }),
1123 );
1124 if let Some(on_conflict) = opts.on_conflict {
1125 query = query.arg("onConflict", on_conflict);
1126 }
1127 Changeset {
1128 proc: self.proc.clone(),
1129 selection: query,
1130 graphql_client: self.graphql_client.clone(),
1131 }
1132 }
1133 pub fn with_changesets(&self, changes: Vec<Id>) -> Changeset {
1142 let mut query = self.selection.select("withChangesets");
1143 query = query.arg("changes", changes);
1144 Changeset {
1145 proc: self.proc.clone(),
1146 selection: query,
1147 graphql_client: self.graphql_client.clone(),
1148 }
1149 }
1150 pub fn with_changesets_opts(
1159 &self,
1160 changes: Vec<Id>,
1161 opts: ChangesetWithChangesetsOpts,
1162 ) -> Changeset {
1163 let mut query = self.selection.select("withChangesets");
1164 query = query.arg("changes", changes);
1165 if let Some(on_conflict) = opts.on_conflict {
1166 query = query.arg("onConflict", on_conflict);
1167 }
1168 Changeset {
1169 proc: self.proc.clone(),
1170 selection: query,
1171 graphql_client: self.graphql_client.clone(),
1172 }
1173 }
1174}
1175impl Exportable for Changeset {
1176 fn export(
1177 &self,
1178 path: impl Into<String>,
1179 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
1180 let mut query = self.selection.select("export");
1181 query = query.arg("path", path.into());
1182 let graphql_client = self.graphql_client.clone();
1183 async move { query.execute(graphql_client).await }
1184 }
1185 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1186 let query = self.selection.select("id");
1187 let graphql_client = self.graphql_client.clone();
1188 async move { query.execute(graphql_client).await }
1189 }
1190}
1191impl Node for Changeset {
1192 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1193 let query = self.selection.select("id");
1194 let graphql_client = self.graphql_client.clone();
1195 async move { query.execute(graphql_client).await }
1196 }
1197}
1198impl Syncer for Changeset {
1199 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1200 let query = self.selection.select("id");
1201 let graphql_client = self.graphql_client.clone();
1202 async move { query.execute(graphql_client).await }
1203 }
1204 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1205 let query = self.selection.select("sync");
1206 let graphql_client = self.graphql_client.clone();
1207 async move { query.execute(graphql_client).await }
1208 }
1209}
1210#[derive(Clone)]
1211pub struct Check {
1212 pub proc: Option<Arc<DaggerSessionProc>>,
1213 pub selection: Selection,
1214 pub graphql_client: DynGraphQLClient,
1215}
1216impl IntoID<Id> for Check {
1217 fn into_id(
1218 self,
1219 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1220 Box::pin(async move { self.id().await })
1221 }
1222}
1223impl Loadable for Check {
1224 fn graphql_type() -> &'static str {
1225 "Check"
1226 }
1227 fn from_query(
1228 proc: Option<Arc<DaggerSessionProc>>,
1229 selection: Selection,
1230 graphql_client: DynGraphQLClient,
1231 ) -> Self {
1232 Self {
1233 proc,
1234 selection,
1235 graphql_client,
1236 }
1237 }
1238}
1239impl Check {
1240 pub async fn check_type(&self) -> Result<String, DaggerError> {
1242 let query = self.selection.select("checkType");
1243 query.execute(self.graphql_client.clone()).await
1244 }
1245 pub async fn completed(&self) -> Result<bool, DaggerError> {
1247 let query = self.selection.select("completed");
1248 query.execute(self.graphql_client.clone()).await
1249 }
1250 pub async fn description(&self) -> Result<String, DaggerError> {
1252 let query = self.selection.select("description");
1253 query.execute(self.graphql_client.clone()).await
1254 }
1255 pub fn error(&self) -> Error {
1257 let query = self.selection.select("error");
1258 Error {
1259 proc: self.proc.clone(),
1260 selection: query,
1261 graphql_client: self.graphql_client.clone(),
1262 }
1263 }
1264 pub async fn id(&self) -> Result<Id, DaggerError> {
1266 let query = self.selection.select("id");
1267 query.execute(self.graphql_client.clone()).await
1268 }
1269 pub async fn name(&self) -> Result<String, DaggerError> {
1271 let query = self.selection.select("name");
1272 query.execute(self.graphql_client.clone()).await
1273 }
1274 pub fn original_module(&self) -> Module {
1276 let query = self.selection.select("originalModule");
1277 Module {
1278 proc: self.proc.clone(),
1279 selection: query,
1280 graphql_client: self.graphql_client.clone(),
1281 }
1282 }
1283 pub async fn passed(&self) -> Result<bool, DaggerError> {
1285 let query = self.selection.select("passed");
1286 query.execute(self.graphql_client.clone()).await
1287 }
1288 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
1290 let query = self.selection.select("path");
1291 query.execute(self.graphql_client.clone()).await
1292 }
1293 pub async fn result_emoji(&self) -> Result<String, DaggerError> {
1295 let query = self.selection.select("resultEmoji");
1296 query.execute(self.graphql_client.clone()).await
1297 }
1298 pub fn run(&self) -> Check {
1300 let query = self.selection.select("run");
1301 Check {
1302 proc: self.proc.clone(),
1303 selection: query,
1304 graphql_client: self.graphql_client.clone(),
1305 }
1306 }
1307}
1308impl Node for Check {
1309 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1310 let query = self.selection.select("id");
1311 let graphql_client = self.graphql_client.clone();
1312 async move { query.execute(graphql_client).await }
1313 }
1314}
1315#[derive(Clone)]
1316pub struct CheckGroup {
1317 pub proc: Option<Arc<DaggerSessionProc>>,
1318 pub selection: Selection,
1319 pub graphql_client: DynGraphQLClient,
1320}
1321#[derive(Builder, Debug, PartialEq)]
1322pub struct CheckGroupRunOpts {
1323 #[builder(setter(into, strip_option), default)]
1325 pub fail_fast: Option<bool>,
1326}
1327impl IntoID<Id> for CheckGroup {
1328 fn into_id(
1329 self,
1330 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1331 Box::pin(async move { self.id().await })
1332 }
1333}
1334impl Loadable for CheckGroup {
1335 fn graphql_type() -> &'static str {
1336 "CheckGroup"
1337 }
1338 fn from_query(
1339 proc: Option<Arc<DaggerSessionProc>>,
1340 selection: Selection,
1341 graphql_client: DynGraphQLClient,
1342 ) -> Self {
1343 Self {
1344 proc,
1345 selection,
1346 graphql_client,
1347 }
1348 }
1349}
1350impl CheckGroup {
1351 pub async fn id(&self) -> Result<Id, DaggerError> {
1353 let query = self.selection.select("id");
1354 query.execute(self.graphql_client.clone()).await
1355 }
1356 pub async fn list(&self) -> Result<Vec<Check>, DaggerError> {
1358 let query = self.selection.select("list");
1359 let query = query.select("id");
1360 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
1361 Ok(ids
1362 .into_iter()
1363 .map(|id| Check {
1364 proc: self.proc.clone(),
1365 selection: crate::querybuilder::query()
1366 .select("node")
1367 .arg("id", &id.0)
1368 .inline_fragment("Check"),
1369 graphql_client: self.graphql_client.clone(),
1370 })
1371 .collect())
1372 }
1373 pub fn report(&self) -> File {
1375 let query = self.selection.select("report");
1376 File {
1377 proc: self.proc.clone(),
1378 selection: query,
1379 graphql_client: self.graphql_client.clone(),
1380 }
1381 }
1382 pub fn run(&self) -> CheckGroup {
1388 let query = self.selection.select("run");
1389 CheckGroup {
1390 proc: self.proc.clone(),
1391 selection: query,
1392 graphql_client: self.graphql_client.clone(),
1393 }
1394 }
1395 pub fn run_opts(&self, opts: CheckGroupRunOpts) -> CheckGroup {
1401 let mut query = self.selection.select("run");
1402 if let Some(fail_fast) = opts.fail_fast {
1403 query = query.arg("failFast", fail_fast);
1404 }
1405 CheckGroup {
1406 proc: self.proc.clone(),
1407 selection: query,
1408 graphql_client: self.graphql_client.clone(),
1409 }
1410 }
1411}
1412impl Node for CheckGroup {
1413 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1414 let query = self.selection.select("id");
1415 let graphql_client = self.graphql_client.clone();
1416 async move { query.execute(graphql_client).await }
1417 }
1418}
1419#[derive(Clone)]
1420pub struct ClientFilesyncMirror {
1421 pub proc: Option<Arc<DaggerSessionProc>>,
1422 pub selection: Selection,
1423 pub graphql_client: DynGraphQLClient,
1424}
1425impl IntoID<Id> for ClientFilesyncMirror {
1426 fn into_id(
1427 self,
1428 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1429 Box::pin(async move { self.id().await })
1430 }
1431}
1432impl Loadable for ClientFilesyncMirror {
1433 fn graphql_type() -> &'static str {
1434 "ClientFilesyncMirror"
1435 }
1436 fn from_query(
1437 proc: Option<Arc<DaggerSessionProc>>,
1438 selection: Selection,
1439 graphql_client: DynGraphQLClient,
1440 ) -> Self {
1441 Self {
1442 proc,
1443 selection,
1444 graphql_client,
1445 }
1446 }
1447}
1448impl ClientFilesyncMirror {
1449 pub async fn id(&self) -> Result<Id, DaggerError> {
1451 let query = self.selection.select("id");
1452 query.execute(self.graphql_client.clone()).await
1453 }
1454}
1455impl Node for ClientFilesyncMirror {
1456 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1457 let query = self.selection.select("id");
1458 let graphql_client = self.graphql_client.clone();
1459 async move { query.execute(graphql_client).await }
1460 }
1461}
1462#[derive(Clone)]
1463pub struct Cloud {
1464 pub proc: Option<Arc<DaggerSessionProc>>,
1465 pub selection: Selection,
1466 pub graphql_client: DynGraphQLClient,
1467}
1468impl IntoID<Id> for Cloud {
1469 fn into_id(
1470 self,
1471 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1472 Box::pin(async move { self.id().await })
1473 }
1474}
1475impl Loadable for Cloud {
1476 fn graphql_type() -> &'static str {
1477 "Cloud"
1478 }
1479 fn from_query(
1480 proc: Option<Arc<DaggerSessionProc>>,
1481 selection: Selection,
1482 graphql_client: DynGraphQLClient,
1483 ) -> Self {
1484 Self {
1485 proc,
1486 selection,
1487 graphql_client,
1488 }
1489 }
1490}
1491impl Cloud {
1492 pub async fn id(&self) -> Result<Id, DaggerError> {
1494 let query = self.selection.select("id");
1495 query.execute(self.graphql_client.clone()).await
1496 }
1497 pub async fn trace_url(&self) -> Result<String, DaggerError> {
1499 let query = self.selection.select("traceURL");
1500 query.execute(self.graphql_client.clone()).await
1501 }
1502}
1503impl Node for Cloud {
1504 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
1505 let query = self.selection.select("id");
1506 let graphql_client = self.graphql_client.clone();
1507 async move { query.execute(graphql_client).await }
1508 }
1509}
1510#[derive(Clone)]
1511pub struct Container {
1512 pub proc: Option<Arc<DaggerSessionProc>>,
1513 pub selection: Selection,
1514 pub graphql_client: DynGraphQLClient,
1515}
1516#[derive(Builder, Debug, PartialEq)]
1517pub struct ContainerAsServiceOpts<'a> {
1518 #[builder(setter(into, strip_option), default)]
1521 pub args: Option<Vec<&'a str>>,
1522 #[builder(setter(into, strip_option), default)]
1524 pub expand: Option<bool>,
1525 #[builder(setter(into, strip_option), default)]
1527 pub experimental_privileged_nesting: Option<bool>,
1528 #[builder(setter(into, strip_option), default)]
1530 pub insecure_root_capabilities: Option<bool>,
1531 #[builder(setter(into, strip_option), default)]
1534 pub no_init: Option<bool>,
1535 #[builder(setter(into, strip_option), default)]
1537 pub use_entrypoint: Option<bool>,
1538}
1539#[derive(Builder, Debug, PartialEq)]
1540pub struct ContainerAsTarballOpts {
1541 #[builder(setter(into, strip_option), default)]
1544 pub forced_compression: Option<ImageLayerCompression>,
1545 #[builder(setter(into, strip_option), default)]
1548 pub media_types: Option<ImageMediaTypes>,
1549 #[builder(setter(into, strip_option), default)]
1552 pub platform_variants: Option<Vec<Id>>,
1553}
1554#[derive(Builder, Debug, PartialEq)]
1555pub struct ContainerDirectoryOpts {
1556 #[builder(setter(into, strip_option), default)]
1558 pub expand: Option<bool>,
1559}
1560#[derive(Builder, Debug, PartialEq)]
1561pub struct ContainerExistsOpts {
1562 #[builder(setter(into, strip_option), default)]
1564 pub do_not_follow_symlinks: Option<bool>,
1565 #[builder(setter(into, strip_option), default)]
1567 pub expand: Option<bool>,
1568 #[builder(setter(into, strip_option), default)]
1570 pub expected_type: Option<ExistsType>,
1571}
1572#[derive(Builder, Debug, PartialEq)]
1573pub struct ContainerExportOpts {
1574 #[builder(setter(into, strip_option), default)]
1576 pub expand: Option<bool>,
1577 #[builder(setter(into, strip_option), default)]
1580 pub forced_compression: Option<ImageLayerCompression>,
1581 #[builder(setter(into, strip_option), default)]
1584 pub media_types: Option<ImageMediaTypes>,
1585 #[builder(setter(into, strip_option), default)]
1588 pub platform_variants: Option<Vec<Id>>,
1589}
1590#[derive(Builder, Debug, PartialEq)]
1591pub struct ContainerExportImageOpts {
1592 #[builder(setter(into, strip_option), default)]
1595 pub forced_compression: Option<ImageLayerCompression>,
1596 #[builder(setter(into, strip_option), default)]
1599 pub media_types: Option<ImageMediaTypes>,
1600 #[builder(setter(into, strip_option), default)]
1603 pub platform_variants: Option<Vec<Id>>,
1604}
1605#[derive(Builder, Debug, PartialEq)]
1606pub struct ContainerFileOpts {
1607 #[builder(setter(into, strip_option), default)]
1609 pub expand: Option<bool>,
1610}
1611#[derive(Builder, Debug, PartialEq)]
1612pub struct ContainerFromOpts {
1613 #[builder(setter(into, strip_option), default)]
1616 pub registry_service: Option<Id>,
1617}
1618#[derive(Builder, Debug, PartialEq)]
1619pub struct ContainerImportOpts<'a> {
1620 #[builder(setter(into, strip_option), default)]
1622 pub tag: Option<&'a str>,
1623}
1624#[derive(Builder, Debug, PartialEq)]
1625pub struct ContainerPublishOpts {
1626 #[builder(setter(into, strip_option), default)]
1629 pub forced_compression: Option<ImageLayerCompression>,
1630 #[builder(setter(into, strip_option), default)]
1633 pub media_types: Option<ImageMediaTypes>,
1634 #[builder(setter(into, strip_option), default)]
1637 pub platform_variants: Option<Vec<Id>>,
1638 #[builder(setter(into, strip_option), default)]
1641 pub registry_service: Option<Id>,
1642}
1643#[derive(Builder, Debug, PartialEq)]
1644pub struct ContainerStatOpts {
1645 #[builder(setter(into, strip_option), default)]
1647 pub do_not_follow_symlinks: Option<bool>,
1648}
1649#[derive(Builder, Debug, PartialEq)]
1650pub struct ContainerTerminalOpts<'a> {
1651 #[builder(setter(into, strip_option), default)]
1653 pub cmd: Option<Vec<&'a str>>,
1654 #[builder(setter(into, strip_option), default)]
1656 pub experimental_privileged_nesting: Option<bool>,
1657 #[builder(setter(into, strip_option), default)]
1659 pub insecure_root_capabilities: Option<bool>,
1660}
1661#[derive(Builder, Debug, PartialEq)]
1662pub struct ContainerUpOpts<'a> {
1663 #[builder(setter(into, strip_option), default)]
1666 pub args: Option<Vec<&'a str>>,
1667 #[builder(setter(into, strip_option), default)]
1669 pub expand: Option<bool>,
1670 #[builder(setter(into, strip_option), default)]
1672 pub experimental_privileged_nesting: Option<bool>,
1673 #[builder(setter(into, strip_option), default)]
1675 pub insecure_root_capabilities: Option<bool>,
1676 #[builder(setter(into, strip_option), default)]
1679 pub no_init: Option<bool>,
1680 #[builder(setter(into, strip_option), default)]
1683 pub ports: Option<Vec<PortForward>>,
1684 #[builder(setter(into, strip_option), default)]
1686 pub random: Option<bool>,
1687 #[builder(setter(into, strip_option), default)]
1689 pub use_entrypoint: Option<bool>,
1690}
1691#[derive(Builder, Debug, PartialEq)]
1692pub struct ContainerWithDefaultTerminalCmdOpts {
1693 #[builder(setter(into, strip_option), default)]
1695 pub experimental_privileged_nesting: Option<bool>,
1696 #[builder(setter(into, strip_option), default)]
1698 pub insecure_root_capabilities: Option<bool>,
1699}
1700#[derive(Builder, Debug, PartialEq)]
1701pub struct ContainerWithDirectoryOpts<'a> {
1702 #[builder(setter(into, strip_option), default)]
1704 pub exclude: Option<Vec<&'a str>>,
1705 #[builder(setter(into, strip_option), default)]
1707 pub expand: Option<bool>,
1708 #[builder(setter(into, strip_option), default)]
1710 pub gitignore: Option<bool>,
1711 #[builder(setter(into, strip_option), default)]
1713 pub include: Option<Vec<&'a str>>,
1714 #[builder(setter(into, strip_option), default)]
1718 pub owner: Option<&'a str>,
1719 #[builder(setter(into, strip_option), default)]
1720 pub permissions: Option<isize>,
1721}
1722#[derive(Builder, Debug, PartialEq)]
1723pub struct ContainerWithDockerHealthcheckOpts<'a> {
1724 #[builder(setter(into, strip_option), default)]
1726 pub interval: Option<&'a str>,
1727 #[builder(setter(into, strip_option), default)]
1729 pub retries: Option<isize>,
1730 #[builder(setter(into, strip_option), default)]
1732 pub shell: Option<bool>,
1733 #[builder(setter(into, strip_option), default)]
1735 pub start_interval: Option<&'a str>,
1736 #[builder(setter(into, strip_option), default)]
1738 pub start_period: Option<&'a str>,
1739 #[builder(setter(into, strip_option), default)]
1741 pub timeout: Option<&'a str>,
1742}
1743#[derive(Builder, Debug, PartialEq)]
1744pub struct ContainerWithEntrypointOpts {
1745 #[builder(setter(into, strip_option), default)]
1747 pub keep_default_args: Option<bool>,
1748}
1749#[derive(Builder, Debug, PartialEq)]
1750pub struct ContainerWithEnvVariableOpts {
1751 #[builder(setter(into, strip_option), default)]
1753 pub expand: Option<bool>,
1754}
1755#[derive(Builder, Debug, PartialEq)]
1756pub struct ContainerWithExecOpts<'a> {
1757 #[builder(setter(into, strip_option), default)]
1759 pub expand: Option<bool>,
1760 #[builder(setter(into, strip_option), default)]
1762 pub expect: Option<ReturnType>,
1763 #[builder(setter(into, strip_option), default)]
1765 pub experimental_privileged_nesting: Option<bool>,
1766 #[builder(setter(into, strip_option), default)]
1769 pub insecure_root_capabilities: Option<bool>,
1770 #[builder(setter(into, strip_option), default)]
1773 pub no_init: Option<bool>,
1774 #[builder(setter(into, strip_option), default)]
1776 pub redirect_stderr: Option<&'a str>,
1777 #[builder(setter(into, strip_option), default)]
1779 pub redirect_stdin: Option<&'a str>,
1780 #[builder(setter(into, strip_option), default)]
1782 pub redirect_stdout: Option<&'a str>,
1783 #[builder(setter(into, strip_option), default)]
1785 pub stdin: Option<&'a str>,
1786 #[builder(setter(into, strip_option), default)]
1788 pub use_entrypoint: Option<bool>,
1789}
1790#[derive(Builder, Debug, PartialEq)]
1791pub struct ContainerWithExposedPortOpts<'a> {
1792 #[builder(setter(into, strip_option), default)]
1794 pub description: Option<&'a str>,
1795 #[builder(setter(into, strip_option), default)]
1797 pub experimental_skip_healthcheck: Option<bool>,
1798 #[builder(setter(into, strip_option), default)]
1800 pub protocol: Option<NetworkProtocol>,
1801}
1802#[derive(Builder, Debug, PartialEq)]
1803pub struct ContainerWithFileOpts<'a> {
1804 #[builder(setter(into, strip_option), default)]
1806 pub expand: Option<bool>,
1807 #[builder(setter(into, strip_option), default)]
1811 pub owner: Option<&'a str>,
1812 #[builder(setter(into, strip_option), default)]
1814 pub permissions: Option<isize>,
1815}
1816#[derive(Builder, Debug, PartialEq)]
1817pub struct ContainerWithFilesOpts<'a> {
1818 #[builder(setter(into, strip_option), default)]
1820 pub expand: Option<bool>,
1821 #[builder(setter(into, strip_option), default)]
1825 pub owner: Option<&'a str>,
1826 #[builder(setter(into, strip_option), default)]
1828 pub permissions: Option<isize>,
1829}
1830#[derive(Builder, Debug, PartialEq)]
1831pub struct ContainerWithMountedCacheOpts<'a> {
1832 #[builder(setter(into, strip_option), default)]
1834 pub expand: Option<bool>,
1835 #[builder(setter(into, strip_option), default)]
1840 pub owner: Option<&'a str>,
1841 #[builder(setter(into, strip_option), default)]
1843 pub sharing: Option<CacheSharingMode>,
1844 #[builder(setter(into, strip_option), default)]
1846 pub source: Option<Id>,
1847}
1848#[derive(Builder, Debug, PartialEq)]
1849pub struct ContainerWithMountedDirectoryOpts<'a> {
1850 #[builder(setter(into, strip_option), default)]
1852 pub expand: Option<bool>,
1853 #[builder(setter(into, strip_option), default)]
1857 pub owner: Option<&'a str>,
1858 #[builder(setter(into, strip_option), default)]
1860 pub read_only: Option<bool>,
1861}
1862#[derive(Builder, Debug, PartialEq)]
1863pub struct ContainerWithMountedFileOpts<'a> {
1864 #[builder(setter(into, strip_option), default)]
1866 pub expand: Option<bool>,
1867 #[builder(setter(into, strip_option), default)]
1871 pub owner: Option<&'a str>,
1872}
1873#[derive(Builder, Debug, PartialEq)]
1874pub struct ContainerWithMountedSecretOpts<'a> {
1875 #[builder(setter(into, strip_option), default)]
1877 pub expand: Option<bool>,
1878 #[builder(setter(into, strip_option), default)]
1881 pub mode: Option<isize>,
1882 #[builder(setter(into, strip_option), default)]
1886 pub owner: Option<&'a str>,
1887}
1888#[derive(Builder, Debug, PartialEq)]
1889pub struct ContainerWithMountedTempOpts {
1890 #[builder(setter(into, strip_option), default)]
1892 pub expand: Option<bool>,
1893 #[builder(setter(into, strip_option), default)]
1895 pub size: Option<isize>,
1896}
1897#[derive(Builder, Debug, PartialEq)]
1898pub struct ContainerWithMountedVolumeOpts {
1899 #[builder(setter(into, strip_option), default)]
1901 pub expand: Option<bool>,
1902 #[builder(setter(into, strip_option), default)]
1904 pub read_only: Option<bool>,
1905}
1906#[derive(Builder, Debug, PartialEq)]
1907pub struct ContainerWithNewFileOpts<'a> {
1908 #[builder(setter(into, strip_option), default)]
1910 pub expand: Option<bool>,
1911 #[builder(setter(into, strip_option), default)]
1915 pub owner: Option<&'a str>,
1916 #[builder(setter(into, strip_option), default)]
1918 pub permissions: Option<isize>,
1919}
1920#[derive(Builder, Debug, PartialEq)]
1921pub struct ContainerWithSymlinkOpts {
1922 #[builder(setter(into, strip_option), default)]
1924 pub expand: Option<bool>,
1925}
1926#[derive(Builder, Debug, PartialEq)]
1927pub struct ContainerWithUnixSocketOpts<'a> {
1928 #[builder(setter(into, strip_option), default)]
1930 pub expand: Option<bool>,
1931 #[builder(setter(into, strip_option), default)]
1935 pub owner: Option<&'a str>,
1936}
1937#[derive(Builder, Debug, PartialEq)]
1938pub struct ContainerWithWorkdirOpts {
1939 #[builder(setter(into, strip_option), default)]
1941 pub expand: Option<bool>,
1942}
1943#[derive(Builder, Debug, PartialEq)]
1944pub struct ContainerWithoutDirectoryOpts {
1945 #[builder(setter(into, strip_option), default)]
1947 pub expand: Option<bool>,
1948}
1949#[derive(Builder, Debug, PartialEq)]
1950pub struct ContainerWithoutEntrypointOpts {
1951 #[builder(setter(into, strip_option), default)]
1953 pub keep_default_args: Option<bool>,
1954}
1955#[derive(Builder, Debug, PartialEq)]
1956pub struct ContainerWithoutExposedPortOpts {
1957 #[builder(setter(into, strip_option), default)]
1959 pub protocol: Option<NetworkProtocol>,
1960}
1961#[derive(Builder, Debug, PartialEq)]
1962pub struct ContainerWithoutFileOpts {
1963 #[builder(setter(into, strip_option), default)]
1965 pub expand: Option<bool>,
1966}
1967#[derive(Builder, Debug, PartialEq)]
1968pub struct ContainerWithoutFilesOpts {
1969 #[builder(setter(into, strip_option), default)]
1971 pub expand: Option<bool>,
1972}
1973#[derive(Builder, Debug, PartialEq)]
1974pub struct ContainerWithoutMountOpts {
1975 #[builder(setter(into, strip_option), default)]
1977 pub expand: Option<bool>,
1978}
1979#[derive(Builder, Debug, PartialEq)]
1980pub struct ContainerWithoutUnixSocketOpts {
1981 #[builder(setter(into, strip_option), default)]
1983 pub expand: Option<bool>,
1984}
1985impl IntoID<Id> for Container {
1986 fn into_id(
1987 self,
1988 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
1989 Box::pin(async move { self.id().await })
1990 }
1991}
1992impl Loadable for Container {
1993 fn graphql_type() -> &'static str {
1994 "Container"
1995 }
1996 fn from_query(
1997 proc: Option<Arc<DaggerSessionProc>>,
1998 selection: Selection,
1999 graphql_client: DynGraphQLClient,
2000 ) -> Self {
2001 Self {
2002 proc,
2003 selection,
2004 graphql_client,
2005 }
2006 }
2007}
2008impl Container {
2009 pub fn as_service(&self) -> Service {
2016 let query = self.selection.select("asService");
2017 Service {
2018 proc: self.proc.clone(),
2019 selection: query,
2020 graphql_client: self.graphql_client.clone(),
2021 }
2022 }
2023 pub fn as_service_opts<'a>(&self, opts: ContainerAsServiceOpts<'a>) -> Service {
2030 let mut query = self.selection.select("asService");
2031 if let Some(args) = opts.args {
2032 query = query.arg("args", args);
2033 }
2034 if let Some(use_entrypoint) = opts.use_entrypoint {
2035 query = query.arg("useEntrypoint", use_entrypoint);
2036 }
2037 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2038 query = query.arg(
2039 "experimentalPrivilegedNesting",
2040 experimental_privileged_nesting,
2041 );
2042 }
2043 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2044 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2045 }
2046 if let Some(expand) = opts.expand {
2047 query = query.arg("expand", expand);
2048 }
2049 if let Some(no_init) = opts.no_init {
2050 query = query.arg("noInit", no_init);
2051 }
2052 Service {
2053 proc: self.proc.clone(),
2054 selection: query,
2055 graphql_client: self.graphql_client.clone(),
2056 }
2057 }
2058 pub fn as_tarball(&self) -> File {
2064 let query = self.selection.select("asTarball");
2065 File {
2066 proc: self.proc.clone(),
2067 selection: query,
2068 graphql_client: self.graphql_client.clone(),
2069 }
2070 }
2071 pub fn as_tarball_opts(&self, opts: ContainerAsTarballOpts) -> File {
2077 let mut query = self.selection.select("asTarball");
2078 if let Some(platform_variants) = opts.platform_variants {
2079 query = query.arg("platformVariants", platform_variants);
2080 }
2081 if let Some(forced_compression) = opts.forced_compression {
2082 query = query.arg("forcedCompression", forced_compression);
2083 }
2084 if let Some(media_types) = opts.media_types {
2085 query = query.arg("mediaTypes", media_types);
2086 }
2087 File {
2088 proc: self.proc.clone(),
2089 selection: query,
2090 graphql_client: self.graphql_client.clone(),
2091 }
2092 }
2093 pub async fn combined_output(&self) -> Result<String, DaggerError> {
2096 let query = self.selection.select("combinedOutput");
2097 query.execute(self.graphql_client.clone()).await
2098 }
2099 pub async fn default_args(&self) -> Result<Vec<String>, DaggerError> {
2101 let query = self.selection.select("defaultArgs");
2102 query.execute(self.graphql_client.clone()).await
2103 }
2104 pub fn directory(&self, path: impl Into<String>) -> Directory {
2112 let mut query = self.selection.select("directory");
2113 query = query.arg("path", path.into());
2114 Directory {
2115 proc: self.proc.clone(),
2116 selection: query,
2117 graphql_client: self.graphql_client.clone(),
2118 }
2119 }
2120 pub fn directory_opts(
2128 &self,
2129 path: impl Into<String>,
2130 opts: ContainerDirectoryOpts,
2131 ) -> Directory {
2132 let mut query = self.selection.select("directory");
2133 query = query.arg("path", path.into());
2134 if let Some(expand) = opts.expand {
2135 query = query.arg("expand", expand);
2136 }
2137 Directory {
2138 proc: self.proc.clone(),
2139 selection: query,
2140 graphql_client: self.graphql_client.clone(),
2141 }
2142 }
2143 pub fn docker_healthcheck(&self) -> HealthcheckConfig {
2145 let query = self.selection.select("dockerHealthcheck");
2146 HealthcheckConfig {
2147 proc: self.proc.clone(),
2148 selection: query,
2149 graphql_client: self.graphql_client.clone(),
2150 }
2151 }
2152 pub async fn entrypoint(&self) -> Result<Vec<String>, DaggerError> {
2154 let query = self.selection.select("entrypoint");
2155 query.execute(self.graphql_client.clone()).await
2156 }
2157 pub async fn env_variable(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2163 let mut query = self.selection.select("envVariable");
2164 query = query.arg("name", name.into());
2165 query.execute(self.graphql_client.clone()).await
2166 }
2167 pub async fn env_variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
2169 let query = self.selection.select("envVariables");
2170 let query = query.select("id");
2171 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2172 Ok(ids
2173 .into_iter()
2174 .map(|id| EnvVariable {
2175 proc: self.proc.clone(),
2176 selection: crate::querybuilder::query()
2177 .select("node")
2178 .arg("id", &id.0)
2179 .inline_fragment("EnvVariable"),
2180 graphql_client: self.graphql_client.clone(),
2181 })
2182 .collect())
2183 }
2184 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
2191 let mut query = self.selection.select("exists");
2192 query = query.arg("path", path.into());
2193 query.execute(self.graphql_client.clone()).await
2194 }
2195 pub async fn exists_opts(
2202 &self,
2203 path: impl Into<String>,
2204 opts: ContainerExistsOpts,
2205 ) -> Result<bool, DaggerError> {
2206 let mut query = self.selection.select("exists");
2207 query = query.arg("path", path.into());
2208 if let Some(expected_type) = opts.expected_type {
2209 query = query.arg("expectedType", expected_type);
2210 }
2211 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2212 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2213 }
2214 if let Some(expand) = opts.expand {
2215 query = query.arg("expand", expand);
2216 }
2217 query.execute(self.graphql_client.clone()).await
2218 }
2219 pub async fn exit_code(&self) -> Result<isize, DaggerError> {
2222 let query = self.selection.select("exitCode");
2223 query.execute(self.graphql_client.clone()).await
2224 }
2225 pub fn experimental_with_all_gp_us(&self) -> Container {
2229 let query = self.selection.select("experimentalWithAllGPUs");
2230 Container {
2231 proc: self.proc.clone(),
2232 selection: query,
2233 graphql_client: self.graphql_client.clone(),
2234 }
2235 }
2236 pub fn experimental_with_gpu(&self, devices: Vec<impl Into<String>>) -> Container {
2244 let mut query = self.selection.select("experimentalWithGPU");
2245 query = query.arg(
2246 "devices",
2247 devices
2248 .into_iter()
2249 .map(|i| i.into())
2250 .collect::<Vec<String>>(),
2251 );
2252 Container {
2253 proc: self.proc.clone(),
2254 selection: query,
2255 graphql_client: self.graphql_client.clone(),
2256 }
2257 }
2258 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
2268 let mut query = self.selection.select("export");
2269 query = query.arg("path", path.into());
2270 query.execute(self.graphql_client.clone()).await
2271 }
2272 pub async fn export_opts(
2282 &self,
2283 path: impl Into<String>,
2284 opts: ContainerExportOpts,
2285 ) -> Result<String, DaggerError> {
2286 let mut query = self.selection.select("export");
2287 query = query.arg("path", path.into());
2288 if let Some(platform_variants) = opts.platform_variants {
2289 query = query.arg("platformVariants", platform_variants);
2290 }
2291 if let Some(forced_compression) = opts.forced_compression {
2292 query = query.arg("forcedCompression", forced_compression);
2293 }
2294 if let Some(media_types) = opts.media_types {
2295 query = query.arg("mediaTypes", media_types);
2296 }
2297 if let Some(expand) = opts.expand {
2298 query = query.arg("expand", expand);
2299 }
2300 query.execute(self.graphql_client.clone()).await
2301 }
2302 pub async fn export_image(&self, name: impl Into<String>) -> Result<Void, DaggerError> {
2309 let mut query = self.selection.select("exportImage");
2310 query = query.arg("name", name.into());
2311 query.execute(self.graphql_client.clone()).await
2312 }
2313 pub async fn export_image_opts(
2320 &self,
2321 name: impl Into<String>,
2322 opts: ContainerExportImageOpts,
2323 ) -> Result<Void, DaggerError> {
2324 let mut query = self.selection.select("exportImage");
2325 query = query.arg("name", name.into());
2326 if let Some(platform_variants) = opts.platform_variants {
2327 query = query.arg("platformVariants", platform_variants);
2328 }
2329 if let Some(forced_compression) = opts.forced_compression {
2330 query = query.arg("forcedCompression", forced_compression);
2331 }
2332 if let Some(media_types) = opts.media_types {
2333 query = query.arg("mediaTypes", media_types);
2334 }
2335 query.execute(self.graphql_client.clone()).await
2336 }
2337 pub async fn exposed_ports(&self) -> Result<Vec<Port>, DaggerError> {
2340 let query = self.selection.select("exposedPorts");
2341 let query = query.select("id");
2342 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2343 Ok(ids
2344 .into_iter()
2345 .map(|id| Port {
2346 proc: self.proc.clone(),
2347 selection: crate::querybuilder::query()
2348 .select("node")
2349 .arg("id", &id.0)
2350 .inline_fragment("Port"),
2351 graphql_client: self.graphql_client.clone(),
2352 })
2353 .collect())
2354 }
2355 pub fn file(&self, path: impl Into<String>) -> File {
2363 let mut query = self.selection.select("file");
2364 query = query.arg("path", path.into());
2365 File {
2366 proc: self.proc.clone(),
2367 selection: query,
2368 graphql_client: self.graphql_client.clone(),
2369 }
2370 }
2371 pub fn file_opts(&self, path: impl Into<String>, opts: ContainerFileOpts) -> File {
2379 let mut query = self.selection.select("file");
2380 query = query.arg("path", path.into());
2381 if let Some(expand) = opts.expand {
2382 query = query.arg("expand", expand);
2383 }
2384 File {
2385 proc: self.proc.clone(),
2386 selection: query,
2387 graphql_client: self.graphql_client.clone(),
2388 }
2389 }
2390 pub fn from(&self, address: impl Into<String>) -> Container {
2397 let mut query = self.selection.select("from");
2398 query = query.arg("address", address.into());
2399 Container {
2400 proc: self.proc.clone(),
2401 selection: query,
2402 graphql_client: self.graphql_client.clone(),
2403 }
2404 }
2405 pub fn from_opts(&self, address: impl Into<String>, opts: ContainerFromOpts) -> Container {
2412 let mut query = self.selection.select("from");
2413 query = query.arg("address", address.into());
2414 if let Some(registry_service) = opts.registry_service {
2415 query = query.arg("registryService", registry_service);
2416 }
2417 Container {
2418 proc: self.proc.clone(),
2419 selection: query,
2420 graphql_client: self.graphql_client.clone(),
2421 }
2422 }
2423 pub async fn id(&self) -> Result<Id, DaggerError> {
2425 let query = self.selection.select("id");
2426 query.execute(self.graphql_client.clone()).await
2427 }
2428 pub async fn image_ref(&self) -> Result<String, DaggerError> {
2430 let query = self.selection.select("imageRef");
2431 query.execute(self.graphql_client.clone()).await
2432 }
2433 pub fn import(&self, source: impl IntoID<Id>) -> Container {
2440 let mut query = self.selection.select("import");
2441 query = query.arg_lazy(
2442 "source",
2443 Box::new(move || {
2444 let source = source.clone();
2445 Box::pin(async move { source.into_id().await.unwrap().quote() })
2446 }),
2447 );
2448 Container {
2449 proc: self.proc.clone(),
2450 selection: query,
2451 graphql_client: self.graphql_client.clone(),
2452 }
2453 }
2454 pub fn import_opts<'a>(
2461 &self,
2462 source: impl IntoID<Id>,
2463 opts: ContainerImportOpts<'a>,
2464 ) -> Container {
2465 let mut query = self.selection.select("import");
2466 query = query.arg_lazy(
2467 "source",
2468 Box::new(move || {
2469 let source = source.clone();
2470 Box::pin(async move { source.into_id().await.unwrap().quote() })
2471 }),
2472 );
2473 if let Some(tag) = opts.tag {
2474 query = query.arg("tag", tag);
2475 }
2476 Container {
2477 proc: self.proc.clone(),
2478 selection: query,
2479 graphql_client: self.graphql_client.clone(),
2480 }
2481 }
2482 pub async fn label(&self, name: impl Into<String>) -> Result<String, DaggerError> {
2488 let mut query = self.selection.select("label");
2489 query = query.arg("name", name.into());
2490 query.execute(self.graphql_client.clone()).await
2491 }
2492 pub async fn labels(&self) -> Result<Vec<Label>, DaggerError> {
2494 let query = self.selection.select("labels");
2495 let query = query.select("id");
2496 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
2497 Ok(ids
2498 .into_iter()
2499 .map(|id| Label {
2500 proc: self.proc.clone(),
2501 selection: crate::querybuilder::query()
2502 .select("node")
2503 .arg("id", &id.0)
2504 .inline_fragment("Label"),
2505 graphql_client: self.graphql_client.clone(),
2506 })
2507 .collect())
2508 }
2509 pub async fn mounts(&self) -> Result<Vec<String>, DaggerError> {
2511 let query = self.selection.select("mounts");
2512 query.execute(self.graphql_client.clone()).await
2513 }
2514 pub async fn platform(&self) -> Result<Platform, DaggerError> {
2516 let query = self.selection.select("platform");
2517 query.execute(self.graphql_client.clone()).await
2518 }
2519 pub async fn publish(&self, address: impl Into<String>) -> Result<String, DaggerError> {
2529 let mut query = self.selection.select("publish");
2530 query = query.arg("address", address.into());
2531 query.execute(self.graphql_client.clone()).await
2532 }
2533 pub async fn publish_opts(
2543 &self,
2544 address: impl Into<String>,
2545 opts: ContainerPublishOpts,
2546 ) -> Result<String, DaggerError> {
2547 let mut query = self.selection.select("publish");
2548 query = query.arg("address", address.into());
2549 if let Some(platform_variants) = opts.platform_variants {
2550 query = query.arg("platformVariants", platform_variants);
2551 }
2552 if let Some(forced_compression) = opts.forced_compression {
2553 query = query.arg("forcedCompression", forced_compression);
2554 }
2555 if let Some(media_types) = opts.media_types {
2556 query = query.arg("mediaTypes", media_types);
2557 }
2558 if let Some(registry_service) = opts.registry_service {
2559 query = query.arg("registryService", registry_service);
2560 }
2561 query.execute(self.graphql_client.clone()).await
2562 }
2563 pub fn rootfs(&self) -> Directory {
2565 let query = self.selection.select("rootfs");
2566 Directory {
2567 proc: self.proc.clone(),
2568 selection: query,
2569 graphql_client: self.graphql_client.clone(),
2570 }
2571 }
2572 pub fn stat(&self, path: impl Into<String>) -> Stat {
2579 let mut query = self.selection.select("stat");
2580 query = query.arg("path", path.into());
2581 Stat {
2582 proc: self.proc.clone(),
2583 selection: query,
2584 graphql_client: self.graphql_client.clone(),
2585 }
2586 }
2587 pub fn stat_opts(&self, path: impl Into<String>, opts: ContainerStatOpts) -> Stat {
2594 let mut query = self.selection.select("stat");
2595 query = query.arg("path", path.into());
2596 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
2597 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
2598 }
2599 Stat {
2600 proc: self.proc.clone(),
2601 selection: query,
2602 graphql_client: self.graphql_client.clone(),
2603 }
2604 }
2605 pub async fn stderr(&self) -> Result<String, DaggerError> {
2608 let query = self.selection.select("stderr");
2609 query.execute(self.graphql_client.clone()).await
2610 }
2611 pub async fn stdout(&self) -> Result<String, DaggerError> {
2614 let query = self.selection.select("stdout");
2615 query.execute(self.graphql_client.clone()).await
2616 }
2617 pub async fn sync(&self) -> Result<Container, DaggerError> {
2620 let query = self.selection.select("sync");
2621 let id: Id = query.execute(self.graphql_client.clone()).await?;
2622 Ok(Container {
2623 proc: self.proc.clone(),
2624 selection: query
2625 .root()
2626 .select("node")
2627 .arg("id", &id.0)
2628 .inline_fragment("Container"),
2629 graphql_client: self.graphql_client.clone(),
2630 })
2631 }
2632 pub fn terminal(&self) -> Container {
2638 let query = self.selection.select("terminal");
2639 Container {
2640 proc: self.proc.clone(),
2641 selection: query,
2642 graphql_client: self.graphql_client.clone(),
2643 }
2644 }
2645 pub fn terminal_opts<'a>(&self, opts: ContainerTerminalOpts<'a>) -> Container {
2651 let mut query = self.selection.select("terminal");
2652 if let Some(cmd) = opts.cmd {
2653 query = query.arg("cmd", cmd);
2654 }
2655 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2656 query = query.arg(
2657 "experimentalPrivilegedNesting",
2658 experimental_privileged_nesting,
2659 );
2660 }
2661 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2662 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2663 }
2664 Container {
2665 proc: self.proc.clone(),
2666 selection: query,
2667 graphql_client: self.graphql_client.clone(),
2668 }
2669 }
2670 pub async fn up(&self) -> Result<Void, DaggerError> {
2677 let query = self.selection.select("up");
2678 query.execute(self.graphql_client.clone()).await
2679 }
2680 pub async fn up_opts<'a>(&self, opts: ContainerUpOpts<'a>) -> Result<Void, DaggerError> {
2687 let mut query = self.selection.select("up");
2688 if let Some(random) = opts.random {
2689 query = query.arg("random", random);
2690 }
2691 if let Some(ports) = opts.ports {
2692 query = query.arg("ports", ports);
2693 }
2694 if let Some(args) = opts.args {
2695 query = query.arg("args", args);
2696 }
2697 if let Some(use_entrypoint) = opts.use_entrypoint {
2698 query = query.arg("useEntrypoint", use_entrypoint);
2699 }
2700 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2701 query = query.arg(
2702 "experimentalPrivilegedNesting",
2703 experimental_privileged_nesting,
2704 );
2705 }
2706 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2707 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2708 }
2709 if let Some(expand) = opts.expand {
2710 query = query.arg("expand", expand);
2711 }
2712 if let Some(no_init) = opts.no_init {
2713 query = query.arg("noInit", no_init);
2714 }
2715 query.execute(self.graphql_client.clone()).await
2716 }
2717 pub async fn user(&self) -> Result<String, DaggerError> {
2719 let query = self.selection.select("user");
2720 query.execute(self.graphql_client.clone()).await
2721 }
2722 pub fn with_annotation(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
2729 let mut query = self.selection.select("withAnnotation");
2730 query = query.arg("name", name.into());
2731 query = query.arg("value", value.into());
2732 Container {
2733 proc: self.proc.clone(),
2734 selection: query,
2735 graphql_client: self.graphql_client.clone(),
2736 }
2737 }
2738 pub fn with_default_args(&self, args: Vec<impl Into<String>>) -> Container {
2744 let mut query = self.selection.select("withDefaultArgs");
2745 query = query.arg(
2746 "args",
2747 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2748 );
2749 Container {
2750 proc: self.proc.clone(),
2751 selection: query,
2752 graphql_client: self.graphql_client.clone(),
2753 }
2754 }
2755 pub fn with_default_terminal_cmd(&self, args: Vec<impl Into<String>>) -> Container {
2762 let mut query = self.selection.select("withDefaultTerminalCmd");
2763 query = query.arg(
2764 "args",
2765 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2766 );
2767 Container {
2768 proc: self.proc.clone(),
2769 selection: query,
2770 graphql_client: self.graphql_client.clone(),
2771 }
2772 }
2773 pub fn with_default_terminal_cmd_opts(
2780 &self,
2781 args: Vec<impl Into<String>>,
2782 opts: ContainerWithDefaultTerminalCmdOpts,
2783 ) -> Container {
2784 let mut query = self.selection.select("withDefaultTerminalCmd");
2785 query = query.arg(
2786 "args",
2787 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2788 );
2789 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
2790 query = query.arg(
2791 "experimentalPrivilegedNesting",
2792 experimental_privileged_nesting,
2793 );
2794 }
2795 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
2796 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
2797 }
2798 Container {
2799 proc: self.proc.clone(),
2800 selection: query,
2801 graphql_client: self.graphql_client.clone(),
2802 }
2803 }
2804 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
2812 let mut query = self.selection.select("withDirectory");
2813 query = query.arg("path", path.into());
2814 query = query.arg_lazy(
2815 "source",
2816 Box::new(move || {
2817 let source = source.clone();
2818 Box::pin(async move { source.into_id().await.unwrap().quote() })
2819 }),
2820 );
2821 Container {
2822 proc: self.proc.clone(),
2823 selection: query,
2824 graphql_client: self.graphql_client.clone(),
2825 }
2826 }
2827 pub fn with_directory_opts<'a>(
2835 &self,
2836 path: impl Into<String>,
2837 source: impl IntoID<Id>,
2838 opts: ContainerWithDirectoryOpts<'a>,
2839 ) -> Container {
2840 let mut query = self.selection.select("withDirectory");
2841 query = query.arg("path", path.into());
2842 query = query.arg_lazy(
2843 "source",
2844 Box::new(move || {
2845 let source = source.clone();
2846 Box::pin(async move { source.into_id().await.unwrap().quote() })
2847 }),
2848 );
2849 if let Some(exclude) = opts.exclude {
2850 query = query.arg("exclude", exclude);
2851 }
2852 if let Some(include) = opts.include {
2853 query = query.arg("include", include);
2854 }
2855 if let Some(gitignore) = opts.gitignore {
2856 query = query.arg("gitignore", gitignore);
2857 }
2858 if let Some(owner) = opts.owner {
2859 query = query.arg("owner", owner);
2860 }
2861 if let Some(expand) = opts.expand {
2862 query = query.arg("expand", expand);
2863 }
2864 if let Some(permissions) = opts.permissions {
2865 query = query.arg("permissions", permissions);
2866 }
2867 Container {
2868 proc: self.proc.clone(),
2869 selection: query,
2870 graphql_client: self.graphql_client.clone(),
2871 }
2872 }
2873 pub fn with_docker_healthcheck(&self, args: Vec<impl Into<String>>) -> Container {
2880 let mut query = self.selection.select("withDockerHealthcheck");
2881 query = query.arg(
2882 "args",
2883 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2884 );
2885 Container {
2886 proc: self.proc.clone(),
2887 selection: query,
2888 graphql_client: self.graphql_client.clone(),
2889 }
2890 }
2891 pub fn with_docker_healthcheck_opts<'a>(
2898 &self,
2899 args: Vec<impl Into<String>>,
2900 opts: ContainerWithDockerHealthcheckOpts<'a>,
2901 ) -> Container {
2902 let mut query = self.selection.select("withDockerHealthcheck");
2903 query = query.arg(
2904 "args",
2905 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2906 );
2907 if let Some(shell) = opts.shell {
2908 query = query.arg("shell", shell);
2909 }
2910 if let Some(interval) = opts.interval {
2911 query = query.arg("interval", interval);
2912 }
2913 if let Some(timeout) = opts.timeout {
2914 query = query.arg("timeout", timeout);
2915 }
2916 if let Some(start_period) = opts.start_period {
2917 query = query.arg("startPeriod", start_period);
2918 }
2919 if let Some(start_interval) = opts.start_interval {
2920 query = query.arg("startInterval", start_interval);
2921 }
2922 if let Some(retries) = opts.retries {
2923 query = query.arg("retries", retries);
2924 }
2925 Container {
2926 proc: self.proc.clone(),
2927 selection: query,
2928 graphql_client: self.graphql_client.clone(),
2929 }
2930 }
2931 pub fn with_entrypoint(&self, args: Vec<impl Into<String>>) -> Container {
2938 let mut query = self.selection.select("withEntrypoint");
2939 query = query.arg(
2940 "args",
2941 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2942 );
2943 Container {
2944 proc: self.proc.clone(),
2945 selection: query,
2946 graphql_client: self.graphql_client.clone(),
2947 }
2948 }
2949 pub fn with_entrypoint_opts(
2956 &self,
2957 args: Vec<impl Into<String>>,
2958 opts: ContainerWithEntrypointOpts,
2959 ) -> Container {
2960 let mut query = self.selection.select("withEntrypoint");
2961 query = query.arg(
2962 "args",
2963 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
2964 );
2965 if let Some(keep_default_args) = opts.keep_default_args {
2966 query = query.arg("keepDefaultArgs", keep_default_args);
2967 }
2968 Container {
2969 proc: self.proc.clone(),
2970 selection: query,
2971 graphql_client: self.graphql_client.clone(),
2972 }
2973 }
2974 pub fn with_env_file_variables(&self, source: impl IntoID<Id>) -> Container {
2980 let mut query = self.selection.select("withEnvFileVariables");
2981 query = query.arg_lazy(
2982 "source",
2983 Box::new(move || {
2984 let source = source.clone();
2985 Box::pin(async move { source.into_id().await.unwrap().quote() })
2986 }),
2987 );
2988 Container {
2989 proc: self.proc.clone(),
2990 selection: query,
2991 graphql_client: self.graphql_client.clone(),
2992 }
2993 }
2994 pub fn with_env_variable(
3002 &self,
3003 name: impl Into<String>,
3004 value: impl Into<String>,
3005 ) -> Container {
3006 let mut query = self.selection.select("withEnvVariable");
3007 query = query.arg("name", name.into());
3008 query = query.arg("value", value.into());
3009 Container {
3010 proc: self.proc.clone(),
3011 selection: query,
3012 graphql_client: self.graphql_client.clone(),
3013 }
3014 }
3015 pub fn with_env_variable_opts(
3023 &self,
3024 name: impl Into<String>,
3025 value: impl Into<String>,
3026 opts: ContainerWithEnvVariableOpts,
3027 ) -> Container {
3028 let mut query = self.selection.select("withEnvVariable");
3029 query = query.arg("name", name.into());
3030 query = query.arg("value", value.into());
3031 if let Some(expand) = opts.expand {
3032 query = query.arg("expand", expand);
3033 }
3034 Container {
3035 proc: self.proc.clone(),
3036 selection: query,
3037 graphql_client: self.graphql_client.clone(),
3038 }
3039 }
3040 pub fn with_error(&self, err: impl Into<String>) -> Container {
3046 let mut query = self.selection.select("withError");
3047 query = query.arg("err", err.into());
3048 Container {
3049 proc: self.proc.clone(),
3050 selection: query,
3051 graphql_client: self.graphql_client.clone(),
3052 }
3053 }
3054 pub fn with_exec(&self, args: Vec<impl Into<String>>) -> Container {
3065 let mut query = self.selection.select("withExec");
3066 query = query.arg(
3067 "args",
3068 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3069 );
3070 Container {
3071 proc: self.proc.clone(),
3072 selection: query,
3073 graphql_client: self.graphql_client.clone(),
3074 }
3075 }
3076 pub fn with_exec_opts<'a>(
3087 &self,
3088 args: Vec<impl Into<String>>,
3089 opts: ContainerWithExecOpts<'a>,
3090 ) -> Container {
3091 let mut query = self.selection.select("withExec");
3092 query = query.arg(
3093 "args",
3094 args.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
3095 );
3096 if let Some(use_entrypoint) = opts.use_entrypoint {
3097 query = query.arg("useEntrypoint", use_entrypoint);
3098 }
3099 if let Some(stdin) = opts.stdin {
3100 query = query.arg("stdin", stdin);
3101 }
3102 if let Some(redirect_stdin) = opts.redirect_stdin {
3103 query = query.arg("redirectStdin", redirect_stdin);
3104 }
3105 if let Some(redirect_stdout) = opts.redirect_stdout {
3106 query = query.arg("redirectStdout", redirect_stdout);
3107 }
3108 if let Some(redirect_stderr) = opts.redirect_stderr {
3109 query = query.arg("redirectStderr", redirect_stderr);
3110 }
3111 if let Some(expect) = opts.expect {
3112 query = query.arg("expect", expect);
3113 }
3114 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
3115 query = query.arg(
3116 "experimentalPrivilegedNesting",
3117 experimental_privileged_nesting,
3118 );
3119 }
3120 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
3121 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
3122 }
3123 if let Some(expand) = opts.expand {
3124 query = query.arg("expand", expand);
3125 }
3126 if let Some(no_init) = opts.no_init {
3127 query = query.arg("noInit", no_init);
3128 }
3129 Container {
3130 proc: self.proc.clone(),
3131 selection: query,
3132 graphql_client: self.graphql_client.clone(),
3133 }
3134 }
3135 pub fn with_exposed_port(&self, port: isize) -> Container {
3145 let mut query = self.selection.select("withExposedPort");
3146 query = query.arg("port", port);
3147 Container {
3148 proc: self.proc.clone(),
3149 selection: query,
3150 graphql_client: self.graphql_client.clone(),
3151 }
3152 }
3153 pub fn with_exposed_port_opts<'a>(
3163 &self,
3164 port: isize,
3165 opts: ContainerWithExposedPortOpts<'a>,
3166 ) -> Container {
3167 let mut query = self.selection.select("withExposedPort");
3168 query = query.arg("port", port);
3169 if let Some(protocol) = opts.protocol {
3170 query = query.arg("protocol", protocol);
3171 }
3172 if let Some(description) = opts.description {
3173 query = query.arg("description", description);
3174 }
3175 if let Some(experimental_skip_healthcheck) = opts.experimental_skip_healthcheck {
3176 query = query.arg("experimentalSkipHealthcheck", experimental_skip_healthcheck);
3177 }
3178 Container {
3179 proc: self.proc.clone(),
3180 selection: query,
3181 graphql_client: self.graphql_client.clone(),
3182 }
3183 }
3184 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3192 let mut query = self.selection.select("withFile");
3193 query = query.arg("path", path.into());
3194 query = query.arg_lazy(
3195 "source",
3196 Box::new(move || {
3197 let source = source.clone();
3198 Box::pin(async move { source.into_id().await.unwrap().quote() })
3199 }),
3200 );
3201 Container {
3202 proc: self.proc.clone(),
3203 selection: query,
3204 graphql_client: self.graphql_client.clone(),
3205 }
3206 }
3207 pub fn with_file_opts<'a>(
3215 &self,
3216 path: impl Into<String>,
3217 source: impl IntoID<Id>,
3218 opts: ContainerWithFileOpts<'a>,
3219 ) -> Container {
3220 let mut query = self.selection.select("withFile");
3221 query = query.arg("path", path.into());
3222 query = query.arg_lazy(
3223 "source",
3224 Box::new(move || {
3225 let source = source.clone();
3226 Box::pin(async move { source.into_id().await.unwrap().quote() })
3227 }),
3228 );
3229 if let Some(permissions) = opts.permissions {
3230 query = query.arg("permissions", permissions);
3231 }
3232 if let Some(owner) = opts.owner {
3233 query = query.arg("owner", owner);
3234 }
3235 if let Some(expand) = opts.expand {
3236 query = query.arg("expand", expand);
3237 }
3238 Container {
3239 proc: self.proc.clone(),
3240 selection: query,
3241 graphql_client: self.graphql_client.clone(),
3242 }
3243 }
3244 pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Container {
3252 let mut query = self.selection.select("withFiles");
3253 query = query.arg("path", path.into());
3254 query = query.arg("sources", sources);
3255 Container {
3256 proc: self.proc.clone(),
3257 selection: query,
3258 graphql_client: self.graphql_client.clone(),
3259 }
3260 }
3261 pub fn with_files_opts<'a>(
3269 &self,
3270 path: impl Into<String>,
3271 sources: Vec<Id>,
3272 opts: ContainerWithFilesOpts<'a>,
3273 ) -> Container {
3274 let mut query = self.selection.select("withFiles");
3275 query = query.arg("path", path.into());
3276 query = query.arg("sources", sources);
3277 if let Some(permissions) = opts.permissions {
3278 query = query.arg("permissions", permissions);
3279 }
3280 if let Some(owner) = opts.owner {
3281 query = query.arg("owner", owner);
3282 }
3283 if let Some(expand) = opts.expand {
3284 query = query.arg("expand", expand);
3285 }
3286 Container {
3287 proc: self.proc.clone(),
3288 selection: query,
3289 graphql_client: self.graphql_client.clone(),
3290 }
3291 }
3292 pub fn with_label(&self, name: impl Into<String>, value: impl Into<String>) -> Container {
3299 let mut query = self.selection.select("withLabel");
3300 query = query.arg("name", name.into());
3301 query = query.arg("value", value.into());
3302 Container {
3303 proc: self.proc.clone(),
3304 selection: query,
3305 graphql_client: self.graphql_client.clone(),
3306 }
3307 }
3308 pub fn with_mounted_cache(&self, path: impl Into<String>, cache: impl IntoID<Id>) -> Container {
3316 let mut query = self.selection.select("withMountedCache");
3317 query = query.arg("path", path.into());
3318 query = query.arg_lazy(
3319 "cache",
3320 Box::new(move || {
3321 let cache = cache.clone();
3322 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3323 }),
3324 );
3325 Container {
3326 proc: self.proc.clone(),
3327 selection: query,
3328 graphql_client: self.graphql_client.clone(),
3329 }
3330 }
3331 pub fn with_mounted_cache_opts<'a>(
3339 &self,
3340 path: impl Into<String>,
3341 cache: impl IntoID<Id>,
3342 opts: ContainerWithMountedCacheOpts<'a>,
3343 ) -> Container {
3344 let mut query = self.selection.select("withMountedCache");
3345 query = query.arg("path", path.into());
3346 query = query.arg_lazy(
3347 "cache",
3348 Box::new(move || {
3349 let cache = cache.clone();
3350 Box::pin(async move { cache.into_id().await.unwrap().quote() })
3351 }),
3352 );
3353 if let Some(source) = opts.source {
3354 query = query.arg("source", source);
3355 }
3356 if let Some(sharing) = opts.sharing {
3357 query = query.arg("sharing", sharing);
3358 }
3359 if let Some(owner) = opts.owner {
3360 query = query.arg("owner", owner);
3361 }
3362 if let Some(expand) = opts.expand {
3363 query = query.arg("expand", expand);
3364 }
3365 Container {
3366 proc: self.proc.clone(),
3367 selection: query,
3368 graphql_client: self.graphql_client.clone(),
3369 }
3370 }
3371 pub fn with_mounted_directory(
3379 &self,
3380 path: impl Into<String>,
3381 source: impl IntoID<Id>,
3382 ) -> Container {
3383 let mut query = self.selection.select("withMountedDirectory");
3384 query = query.arg("path", path.into());
3385 query = query.arg_lazy(
3386 "source",
3387 Box::new(move || {
3388 let source = source.clone();
3389 Box::pin(async move { source.into_id().await.unwrap().quote() })
3390 }),
3391 );
3392 Container {
3393 proc: self.proc.clone(),
3394 selection: query,
3395 graphql_client: self.graphql_client.clone(),
3396 }
3397 }
3398 pub fn with_mounted_directory_opts<'a>(
3406 &self,
3407 path: impl Into<String>,
3408 source: impl IntoID<Id>,
3409 opts: ContainerWithMountedDirectoryOpts<'a>,
3410 ) -> Container {
3411 let mut query = self.selection.select("withMountedDirectory");
3412 query = query.arg("path", path.into());
3413 query = query.arg_lazy(
3414 "source",
3415 Box::new(move || {
3416 let source = source.clone();
3417 Box::pin(async move { source.into_id().await.unwrap().quote() })
3418 }),
3419 );
3420 if let Some(owner) = opts.owner {
3421 query = query.arg("owner", owner);
3422 }
3423 if let Some(read_only) = opts.read_only {
3424 query = query.arg("readOnly", read_only);
3425 }
3426 if let Some(expand) = opts.expand {
3427 query = query.arg("expand", expand);
3428 }
3429 Container {
3430 proc: self.proc.clone(),
3431 selection: query,
3432 graphql_client: self.graphql_client.clone(),
3433 }
3434 }
3435 pub fn with_mounted_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3443 let mut query = self.selection.select("withMountedFile");
3444 query = query.arg("path", path.into());
3445 query = query.arg_lazy(
3446 "source",
3447 Box::new(move || {
3448 let source = source.clone();
3449 Box::pin(async move { source.into_id().await.unwrap().quote() })
3450 }),
3451 );
3452 Container {
3453 proc: self.proc.clone(),
3454 selection: query,
3455 graphql_client: self.graphql_client.clone(),
3456 }
3457 }
3458 pub fn with_mounted_file_opts<'a>(
3466 &self,
3467 path: impl Into<String>,
3468 source: impl IntoID<Id>,
3469 opts: ContainerWithMountedFileOpts<'a>,
3470 ) -> Container {
3471 let mut query = self.selection.select("withMountedFile");
3472 query = query.arg("path", path.into());
3473 query = query.arg_lazy(
3474 "source",
3475 Box::new(move || {
3476 let source = source.clone();
3477 Box::pin(async move { source.into_id().await.unwrap().quote() })
3478 }),
3479 );
3480 if let Some(owner) = opts.owner {
3481 query = query.arg("owner", owner);
3482 }
3483 if let Some(expand) = opts.expand {
3484 query = query.arg("expand", expand);
3485 }
3486 Container {
3487 proc: self.proc.clone(),
3488 selection: query,
3489 graphql_client: self.graphql_client.clone(),
3490 }
3491 }
3492 pub fn with_mounted_secret(
3500 &self,
3501 path: impl Into<String>,
3502 source: impl IntoID<Id>,
3503 ) -> Container {
3504 let mut query = self.selection.select("withMountedSecret");
3505 query = query.arg("path", path.into());
3506 query = query.arg_lazy(
3507 "source",
3508 Box::new(move || {
3509 let source = source.clone();
3510 Box::pin(async move { source.into_id().await.unwrap().quote() })
3511 }),
3512 );
3513 Container {
3514 proc: self.proc.clone(),
3515 selection: query,
3516 graphql_client: self.graphql_client.clone(),
3517 }
3518 }
3519 pub fn with_mounted_secret_opts<'a>(
3527 &self,
3528 path: impl Into<String>,
3529 source: impl IntoID<Id>,
3530 opts: ContainerWithMountedSecretOpts<'a>,
3531 ) -> Container {
3532 let mut query = self.selection.select("withMountedSecret");
3533 query = query.arg("path", path.into());
3534 query = query.arg_lazy(
3535 "source",
3536 Box::new(move || {
3537 let source = source.clone();
3538 Box::pin(async move { source.into_id().await.unwrap().quote() })
3539 }),
3540 );
3541 if let Some(owner) = opts.owner {
3542 query = query.arg("owner", owner);
3543 }
3544 if let Some(mode) = opts.mode {
3545 query = query.arg("mode", mode);
3546 }
3547 if let Some(expand) = opts.expand {
3548 query = query.arg("expand", expand);
3549 }
3550 Container {
3551 proc: self.proc.clone(),
3552 selection: query,
3553 graphql_client: self.graphql_client.clone(),
3554 }
3555 }
3556 pub fn with_mounted_temp(&self, path: impl Into<String>) -> Container {
3563 let mut query = self.selection.select("withMountedTemp");
3564 query = query.arg("path", path.into());
3565 Container {
3566 proc: self.proc.clone(),
3567 selection: query,
3568 graphql_client: self.graphql_client.clone(),
3569 }
3570 }
3571 pub fn with_mounted_temp_opts(
3578 &self,
3579 path: impl Into<String>,
3580 opts: ContainerWithMountedTempOpts,
3581 ) -> Container {
3582 let mut query = self.selection.select("withMountedTemp");
3583 query = query.arg("path", path.into());
3584 if let Some(size) = opts.size {
3585 query = query.arg("size", size);
3586 }
3587 if let Some(expand) = opts.expand {
3588 query = query.arg("expand", expand);
3589 }
3590 Container {
3591 proc: self.proc.clone(),
3592 selection: query,
3593 graphql_client: self.graphql_client.clone(),
3594 }
3595 }
3596 pub fn with_mounted_volume(
3604 &self,
3605 path: impl Into<String>,
3606 volume: impl IntoID<Id>,
3607 ) -> Container {
3608 let mut query = self.selection.select("withMountedVolume");
3609 query = query.arg("path", path.into());
3610 query = query.arg_lazy(
3611 "volume",
3612 Box::new(move || {
3613 let volume = volume.clone();
3614 Box::pin(async move { volume.into_id().await.unwrap().quote() })
3615 }),
3616 );
3617 Container {
3618 proc: self.proc.clone(),
3619 selection: query,
3620 graphql_client: self.graphql_client.clone(),
3621 }
3622 }
3623 pub fn with_mounted_volume_opts(
3631 &self,
3632 path: impl Into<String>,
3633 volume: impl IntoID<Id>,
3634 opts: ContainerWithMountedVolumeOpts,
3635 ) -> Container {
3636 let mut query = self.selection.select("withMountedVolume");
3637 query = query.arg("path", path.into());
3638 query = query.arg_lazy(
3639 "volume",
3640 Box::new(move || {
3641 let volume = volume.clone();
3642 Box::pin(async move { volume.into_id().await.unwrap().quote() })
3643 }),
3644 );
3645 if let Some(read_only) = opts.read_only {
3646 query = query.arg("readOnly", read_only);
3647 }
3648 if let Some(expand) = opts.expand {
3649 query = query.arg("expand", expand);
3650 }
3651 Container {
3652 proc: self.proc.clone(),
3653 selection: query,
3654 graphql_client: self.graphql_client.clone(),
3655 }
3656 }
3657 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Container {
3665 let mut query = self.selection.select("withNewFile");
3666 query = query.arg("path", path.into());
3667 query = query.arg("contents", contents.into());
3668 Container {
3669 proc: self.proc.clone(),
3670 selection: query,
3671 graphql_client: self.graphql_client.clone(),
3672 }
3673 }
3674 pub fn with_new_file_opts<'a>(
3682 &self,
3683 path: impl Into<String>,
3684 contents: impl Into<String>,
3685 opts: ContainerWithNewFileOpts<'a>,
3686 ) -> Container {
3687 let mut query = self.selection.select("withNewFile");
3688 query = query.arg("path", path.into());
3689 query = query.arg("contents", contents.into());
3690 if let Some(permissions) = opts.permissions {
3691 query = query.arg("permissions", permissions);
3692 }
3693 if let Some(owner) = opts.owner {
3694 query = query.arg("owner", owner);
3695 }
3696 if let Some(expand) = opts.expand {
3697 query = query.arg("expand", expand);
3698 }
3699 Container {
3700 proc: self.proc.clone(),
3701 selection: query,
3702 graphql_client: self.graphql_client.clone(),
3703 }
3704 }
3705 pub fn with_registry_auth(
3713 &self,
3714 address: impl Into<String>,
3715 username: impl Into<String>,
3716 secret: impl IntoID<Id>,
3717 ) -> Container {
3718 let mut query = self.selection.select("withRegistryAuth");
3719 query = query.arg("address", address.into());
3720 query = query.arg("username", username.into());
3721 query = query.arg_lazy(
3722 "secret",
3723 Box::new(move || {
3724 let secret = secret.clone();
3725 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3726 }),
3727 );
3728 Container {
3729 proc: self.proc.clone(),
3730 selection: query,
3731 graphql_client: self.graphql_client.clone(),
3732 }
3733 }
3734 pub fn with_rootfs(&self, directory: impl IntoID<Id>) -> Container {
3740 let mut query = self.selection.select("withRootfs");
3741 query = query.arg_lazy(
3742 "directory",
3743 Box::new(move || {
3744 let directory = directory.clone();
3745 Box::pin(async move { directory.into_id().await.unwrap().quote() })
3746 }),
3747 );
3748 Container {
3749 proc: self.proc.clone(),
3750 selection: query,
3751 graphql_client: self.graphql_client.clone(),
3752 }
3753 }
3754 pub fn with_secret_variable(
3761 &self,
3762 name: impl Into<String>,
3763 secret: impl IntoID<Id>,
3764 ) -> Container {
3765 let mut query = self.selection.select("withSecretVariable");
3766 query = query.arg("name", name.into());
3767 query = query.arg_lazy(
3768 "secret",
3769 Box::new(move || {
3770 let secret = secret.clone();
3771 Box::pin(async move { secret.into_id().await.unwrap().quote() })
3772 }),
3773 );
3774 Container {
3775 proc: self.proc.clone(),
3776 selection: query,
3777 graphql_client: self.graphql_client.clone(),
3778 }
3779 }
3780 pub fn with_service_binding(
3790 &self,
3791 alias: impl Into<String>,
3792 service: impl IntoID<Id>,
3793 ) -> Container {
3794 let mut query = self.selection.select("withServiceBinding");
3795 query = query.arg("alias", alias.into());
3796 query = query.arg_lazy(
3797 "service",
3798 Box::new(move || {
3799 let service = service.clone();
3800 Box::pin(async move { service.into_id().await.unwrap().quote() })
3801 }),
3802 );
3803 Container {
3804 proc: self.proc.clone(),
3805 selection: query,
3806 graphql_client: self.graphql_client.clone(),
3807 }
3808 }
3809 pub fn with_symlink(
3817 &self,
3818 target: impl Into<String>,
3819 link_name: impl Into<String>,
3820 ) -> Container {
3821 let mut query = self.selection.select("withSymlink");
3822 query = query.arg("target", target.into());
3823 query = query.arg("linkName", link_name.into());
3824 Container {
3825 proc: self.proc.clone(),
3826 selection: query,
3827 graphql_client: self.graphql_client.clone(),
3828 }
3829 }
3830 pub fn with_symlink_opts(
3838 &self,
3839 target: impl Into<String>,
3840 link_name: impl Into<String>,
3841 opts: ContainerWithSymlinkOpts,
3842 ) -> Container {
3843 let mut query = self.selection.select("withSymlink");
3844 query = query.arg("target", target.into());
3845 query = query.arg("linkName", link_name.into());
3846 if let Some(expand) = opts.expand {
3847 query = query.arg("expand", expand);
3848 }
3849 Container {
3850 proc: self.proc.clone(),
3851 selection: query,
3852 graphql_client: self.graphql_client.clone(),
3853 }
3854 }
3855 pub fn with_unix_socket(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Container {
3863 let mut query = self.selection.select("withUnixSocket");
3864 query = query.arg("path", path.into());
3865 query = query.arg_lazy(
3866 "source",
3867 Box::new(move || {
3868 let source = source.clone();
3869 Box::pin(async move { source.into_id().await.unwrap().quote() })
3870 }),
3871 );
3872 Container {
3873 proc: self.proc.clone(),
3874 selection: query,
3875 graphql_client: self.graphql_client.clone(),
3876 }
3877 }
3878 pub fn with_unix_socket_opts<'a>(
3886 &self,
3887 path: impl Into<String>,
3888 source: impl IntoID<Id>,
3889 opts: ContainerWithUnixSocketOpts<'a>,
3890 ) -> Container {
3891 let mut query = self.selection.select("withUnixSocket");
3892 query = query.arg("path", path.into());
3893 query = query.arg_lazy(
3894 "source",
3895 Box::new(move || {
3896 let source = source.clone();
3897 Box::pin(async move { source.into_id().await.unwrap().quote() })
3898 }),
3899 );
3900 if let Some(owner) = opts.owner {
3901 query = query.arg("owner", owner);
3902 }
3903 if let Some(expand) = opts.expand {
3904 query = query.arg("expand", expand);
3905 }
3906 Container {
3907 proc: self.proc.clone(),
3908 selection: query,
3909 graphql_client: self.graphql_client.clone(),
3910 }
3911 }
3912 pub fn with_user(&self, name: impl Into<String>) -> Container {
3918 let mut query = self.selection.select("withUser");
3919 query = query.arg("name", name.into());
3920 Container {
3921 proc: self.proc.clone(),
3922 selection: query,
3923 graphql_client: self.graphql_client.clone(),
3924 }
3925 }
3926 pub fn with_volatile_variable(
3934 &self,
3935 name: impl Into<String>,
3936 value: impl Into<String>,
3937 ) -> Container {
3938 let mut query = self.selection.select("withVolatileVariable");
3939 query = query.arg("name", name.into());
3940 query = query.arg("value", value.into());
3941 Container {
3942 proc: self.proc.clone(),
3943 selection: query,
3944 graphql_client: self.graphql_client.clone(),
3945 }
3946 }
3947 pub fn with_workdir(&self, path: impl Into<String>) -> Container {
3954 let mut query = self.selection.select("withWorkdir");
3955 query = query.arg("path", path.into());
3956 Container {
3957 proc: self.proc.clone(),
3958 selection: query,
3959 graphql_client: self.graphql_client.clone(),
3960 }
3961 }
3962 pub fn with_workdir_opts(
3969 &self,
3970 path: impl Into<String>,
3971 opts: ContainerWithWorkdirOpts,
3972 ) -> Container {
3973 let mut query = self.selection.select("withWorkdir");
3974 query = query.arg("path", path.into());
3975 if let Some(expand) = opts.expand {
3976 query = query.arg("expand", expand);
3977 }
3978 Container {
3979 proc: self.proc.clone(),
3980 selection: query,
3981 graphql_client: self.graphql_client.clone(),
3982 }
3983 }
3984 pub fn without_annotation(&self, name: impl Into<String>) -> Container {
3990 let mut query = self.selection.select("withoutAnnotation");
3991 query = query.arg("name", name.into());
3992 Container {
3993 proc: self.proc.clone(),
3994 selection: query,
3995 graphql_client: self.graphql_client.clone(),
3996 }
3997 }
3998 pub fn without_default_args(&self) -> Container {
4000 let query = self.selection.select("withoutDefaultArgs");
4001 Container {
4002 proc: self.proc.clone(),
4003 selection: query,
4004 graphql_client: self.graphql_client.clone(),
4005 }
4006 }
4007 pub fn without_directory(&self, path: impl Into<String>) -> Container {
4014 let mut query = self.selection.select("withoutDirectory");
4015 query = query.arg("path", path.into());
4016 Container {
4017 proc: self.proc.clone(),
4018 selection: query,
4019 graphql_client: self.graphql_client.clone(),
4020 }
4021 }
4022 pub fn without_directory_opts(
4029 &self,
4030 path: impl Into<String>,
4031 opts: ContainerWithoutDirectoryOpts,
4032 ) -> Container {
4033 let mut query = self.selection.select("withoutDirectory");
4034 query = query.arg("path", path.into());
4035 if let Some(expand) = opts.expand {
4036 query = query.arg("expand", expand);
4037 }
4038 Container {
4039 proc: self.proc.clone(),
4040 selection: query,
4041 graphql_client: self.graphql_client.clone(),
4042 }
4043 }
4044 pub fn without_docker_healthcheck(&self) -> Container {
4046 let query = self.selection.select("withoutDockerHealthcheck");
4047 Container {
4048 proc: self.proc.clone(),
4049 selection: query,
4050 graphql_client: self.graphql_client.clone(),
4051 }
4052 }
4053 pub fn without_entrypoint(&self) -> Container {
4059 let query = self.selection.select("withoutEntrypoint");
4060 Container {
4061 proc: self.proc.clone(),
4062 selection: query,
4063 graphql_client: self.graphql_client.clone(),
4064 }
4065 }
4066 pub fn without_entrypoint_opts(&self, opts: ContainerWithoutEntrypointOpts) -> Container {
4072 let mut query = self.selection.select("withoutEntrypoint");
4073 if let Some(keep_default_args) = opts.keep_default_args {
4074 query = query.arg("keepDefaultArgs", keep_default_args);
4075 }
4076 Container {
4077 proc: self.proc.clone(),
4078 selection: query,
4079 graphql_client: self.graphql_client.clone(),
4080 }
4081 }
4082 pub fn without_env_variable(&self, name: impl Into<String>) -> Container {
4088 let mut query = self.selection.select("withoutEnvVariable");
4089 query = query.arg("name", name.into());
4090 Container {
4091 proc: self.proc.clone(),
4092 selection: query,
4093 graphql_client: self.graphql_client.clone(),
4094 }
4095 }
4096 pub fn without_exposed_port(&self, port: isize) -> Container {
4103 let mut query = self.selection.select("withoutExposedPort");
4104 query = query.arg("port", port);
4105 Container {
4106 proc: self.proc.clone(),
4107 selection: query,
4108 graphql_client: self.graphql_client.clone(),
4109 }
4110 }
4111 pub fn without_exposed_port_opts(
4118 &self,
4119 port: isize,
4120 opts: ContainerWithoutExposedPortOpts,
4121 ) -> Container {
4122 let mut query = self.selection.select("withoutExposedPort");
4123 query = query.arg("port", port);
4124 if let Some(protocol) = opts.protocol {
4125 query = query.arg("protocol", protocol);
4126 }
4127 Container {
4128 proc: self.proc.clone(),
4129 selection: query,
4130 graphql_client: self.graphql_client.clone(),
4131 }
4132 }
4133 pub fn without_file(&self, path: impl Into<String>) -> Container {
4140 let mut query = self.selection.select("withoutFile");
4141 query = query.arg("path", path.into());
4142 Container {
4143 proc: self.proc.clone(),
4144 selection: query,
4145 graphql_client: self.graphql_client.clone(),
4146 }
4147 }
4148 pub fn without_file_opts(
4155 &self,
4156 path: impl Into<String>,
4157 opts: ContainerWithoutFileOpts,
4158 ) -> Container {
4159 let mut query = self.selection.select("withoutFile");
4160 query = query.arg("path", path.into());
4161 if let Some(expand) = opts.expand {
4162 query = query.arg("expand", expand);
4163 }
4164 Container {
4165 proc: self.proc.clone(),
4166 selection: query,
4167 graphql_client: self.graphql_client.clone(),
4168 }
4169 }
4170 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Container {
4177 let mut query = self.selection.select("withoutFiles");
4178 query = query.arg(
4179 "paths",
4180 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4181 );
4182 Container {
4183 proc: self.proc.clone(),
4184 selection: query,
4185 graphql_client: self.graphql_client.clone(),
4186 }
4187 }
4188 pub fn without_files_opts(
4195 &self,
4196 paths: Vec<impl Into<String>>,
4197 opts: ContainerWithoutFilesOpts,
4198 ) -> Container {
4199 let mut query = self.selection.select("withoutFiles");
4200 query = query.arg(
4201 "paths",
4202 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
4203 );
4204 if let Some(expand) = opts.expand {
4205 query = query.arg("expand", expand);
4206 }
4207 Container {
4208 proc: self.proc.clone(),
4209 selection: query,
4210 graphql_client: self.graphql_client.clone(),
4211 }
4212 }
4213 pub fn without_label(&self, name: impl Into<String>) -> Container {
4219 let mut query = self.selection.select("withoutLabel");
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_mount(&self, path: impl Into<String>) -> Container {
4234 let mut query = self.selection.select("withoutMount");
4235 query = query.arg("path", path.into());
4236 Container {
4237 proc: self.proc.clone(),
4238 selection: query,
4239 graphql_client: self.graphql_client.clone(),
4240 }
4241 }
4242 pub fn without_mount_opts(
4249 &self,
4250 path: impl Into<String>,
4251 opts: ContainerWithoutMountOpts,
4252 ) -> Container {
4253 let mut query = self.selection.select("withoutMount");
4254 query = query.arg("path", path.into());
4255 if let Some(expand) = opts.expand {
4256 query = query.arg("expand", expand);
4257 }
4258 Container {
4259 proc: self.proc.clone(),
4260 selection: query,
4261 graphql_client: self.graphql_client.clone(),
4262 }
4263 }
4264 pub fn without_registry_auth(&self, address: impl Into<String>) -> Container {
4272 let mut query = self.selection.select("withoutRegistryAuth");
4273 query = query.arg("address", address.into());
4274 Container {
4275 proc: self.proc.clone(),
4276 selection: query,
4277 graphql_client: self.graphql_client.clone(),
4278 }
4279 }
4280 pub fn without_secret_variable(&self, name: impl Into<String>) -> Container {
4286 let mut query = self.selection.select("withoutSecretVariable");
4287 query = query.arg("name", name.into());
4288 Container {
4289 proc: self.proc.clone(),
4290 selection: query,
4291 graphql_client: self.graphql_client.clone(),
4292 }
4293 }
4294 pub fn without_unix_socket(&self, path: impl Into<String>) -> Container {
4301 let mut query = self.selection.select("withoutUnixSocket");
4302 query = query.arg("path", path.into());
4303 Container {
4304 proc: self.proc.clone(),
4305 selection: query,
4306 graphql_client: self.graphql_client.clone(),
4307 }
4308 }
4309 pub fn without_unix_socket_opts(
4316 &self,
4317 path: impl Into<String>,
4318 opts: ContainerWithoutUnixSocketOpts,
4319 ) -> Container {
4320 let mut query = self.selection.select("withoutUnixSocket");
4321 query = query.arg("path", path.into());
4322 if let Some(expand) = opts.expand {
4323 query = query.arg("expand", expand);
4324 }
4325 Container {
4326 proc: self.proc.clone(),
4327 selection: query,
4328 graphql_client: self.graphql_client.clone(),
4329 }
4330 }
4331 pub fn without_user(&self) -> Container {
4334 let query = self.selection.select("withoutUser");
4335 Container {
4336 proc: self.proc.clone(),
4337 selection: query,
4338 graphql_client: self.graphql_client.clone(),
4339 }
4340 }
4341 pub fn without_volatile_variable(&self, name: impl Into<String>) -> Container {
4347 let mut query = self.selection.select("withoutVolatileVariable");
4348 query = query.arg("name", name.into());
4349 Container {
4350 proc: self.proc.clone(),
4351 selection: query,
4352 graphql_client: self.graphql_client.clone(),
4353 }
4354 }
4355 pub fn without_workdir(&self) -> Container {
4358 let query = self.selection.select("withoutWorkdir");
4359 Container {
4360 proc: self.proc.clone(),
4361 selection: query,
4362 graphql_client: self.graphql_client.clone(),
4363 }
4364 }
4365 pub async fn workdir(&self) -> Result<String, DaggerError> {
4367 let query = self.selection.select("workdir");
4368 query.execute(self.graphql_client.clone()).await
4369 }
4370}
4371impl Exportable for Container {
4372 fn export(
4373 &self,
4374 path: impl Into<String>,
4375 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
4376 let mut query = self.selection.select("export");
4377 query = query.arg("path", path.into());
4378 let graphql_client = self.graphql_client.clone();
4379 async move { query.execute(graphql_client).await }
4380 }
4381 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4382 let query = self.selection.select("id");
4383 let graphql_client = self.graphql_client.clone();
4384 async move { query.execute(graphql_client).await }
4385 }
4386}
4387impl Node for Container {
4388 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4389 let query = self.selection.select("id");
4390 let graphql_client = self.graphql_client.clone();
4391 async move { query.execute(graphql_client).await }
4392 }
4393}
4394impl Syncer for Container {
4395 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4396 let query = self.selection.select("id");
4397 let graphql_client = self.graphql_client.clone();
4398 async move { query.execute(graphql_client).await }
4399 }
4400 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4401 let query = self.selection.select("sync");
4402 let graphql_client = self.graphql_client.clone();
4403 async move { query.execute(graphql_client).await }
4404 }
4405}
4406#[derive(Clone)]
4407pub struct CurrentModule {
4408 pub proc: Option<Arc<DaggerSessionProc>>,
4409 pub selection: Selection,
4410 pub graphql_client: DynGraphQLClient,
4411}
4412#[derive(Builder, Debug, PartialEq)]
4413pub struct CurrentModuleGeneratorsOpts<'a> {
4414 #[builder(setter(into, strip_option), default)]
4416 pub include: Option<Vec<&'a str>>,
4417}
4418#[derive(Builder, Debug, PartialEq)]
4419pub struct CurrentModuleWorkdirOpts<'a> {
4420 #[builder(setter(into, strip_option), default)]
4422 pub exclude: Option<Vec<&'a str>>,
4423 #[builder(setter(into, strip_option), default)]
4425 pub gitignore: Option<bool>,
4426 #[builder(setter(into, strip_option), default)]
4428 pub include: Option<Vec<&'a str>>,
4429}
4430impl IntoID<Id> for CurrentModule {
4431 fn into_id(
4432 self,
4433 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4434 Box::pin(async move { self.id().await })
4435 }
4436}
4437impl Loadable for CurrentModule {
4438 fn graphql_type() -> &'static str {
4439 "CurrentModule"
4440 }
4441 fn from_query(
4442 proc: Option<Arc<DaggerSessionProc>>,
4443 selection: Selection,
4444 graphql_client: DynGraphQLClient,
4445 ) -> Self {
4446 Self {
4447 proc,
4448 selection,
4449 graphql_client,
4450 }
4451 }
4452}
4453impl CurrentModule {
4454 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
4456 let query = self.selection.select("dependencies");
4457 let query = query.select("id");
4458 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
4459 Ok(ids
4460 .into_iter()
4461 .map(|id| Module {
4462 proc: self.proc.clone(),
4463 selection: crate::querybuilder::query()
4464 .select("node")
4465 .arg("id", &id.0)
4466 .inline_fragment("Module"),
4467 graphql_client: self.graphql_client.clone(),
4468 })
4469 .collect())
4470 }
4471 pub fn generated_context_directory(&self) -> Directory {
4473 let query = self.selection.select("generatedContextDirectory");
4474 Directory {
4475 proc: self.proc.clone(),
4476 selection: query,
4477 graphql_client: self.graphql_client.clone(),
4478 }
4479 }
4480 pub fn generators(&self) -> GeneratorGroup {
4486 let query = self.selection.select("generators");
4487 GeneratorGroup {
4488 proc: self.proc.clone(),
4489 selection: query,
4490 graphql_client: self.graphql_client.clone(),
4491 }
4492 }
4493 pub fn generators_opts<'a>(&self, opts: CurrentModuleGeneratorsOpts<'a>) -> GeneratorGroup {
4499 let mut query = self.selection.select("generators");
4500 if let Some(include) = opts.include {
4501 query = query.arg("include", include);
4502 }
4503 GeneratorGroup {
4504 proc: self.proc.clone(),
4505 selection: query,
4506 graphql_client: self.graphql_client.clone(),
4507 }
4508 }
4509 pub async fn id(&self) -> Result<Id, DaggerError> {
4511 let query = self.selection.select("id");
4512 query.execute(self.graphql_client.clone()).await
4513 }
4514 pub async fn name(&self) -> Result<String, DaggerError> {
4516 let query = self.selection.select("name");
4517 query.execute(self.graphql_client.clone()).await
4518 }
4519 pub fn source(&self) -> Directory {
4521 let query = self.selection.select("source");
4522 Directory {
4523 proc: self.proc.clone(),
4524 selection: query,
4525 graphql_client: self.graphql_client.clone(),
4526 }
4527 }
4528 pub fn workdir(&self, path: impl Into<String>) -> Directory {
4535 let mut query = self.selection.select("workdir");
4536 query = query.arg("path", path.into());
4537 Directory {
4538 proc: self.proc.clone(),
4539 selection: query,
4540 graphql_client: self.graphql_client.clone(),
4541 }
4542 }
4543 pub fn workdir_opts<'a>(
4550 &self,
4551 path: impl Into<String>,
4552 opts: CurrentModuleWorkdirOpts<'a>,
4553 ) -> Directory {
4554 let mut query = self.selection.select("workdir");
4555 query = query.arg("path", path.into());
4556 if let Some(exclude) = opts.exclude {
4557 query = query.arg("exclude", exclude);
4558 }
4559 if let Some(include) = opts.include {
4560 query = query.arg("include", include);
4561 }
4562 if let Some(gitignore) = opts.gitignore {
4563 query = query.arg("gitignore", gitignore);
4564 }
4565 Directory {
4566 proc: self.proc.clone(),
4567 selection: query,
4568 graphql_client: self.graphql_client.clone(),
4569 }
4570 }
4571 pub fn workdir_file(&self, path: impl Into<String>) -> File {
4577 let mut query = self.selection.select("workdirFile");
4578 query = query.arg("path", path.into());
4579 File {
4580 proc: self.proc.clone(),
4581 selection: query,
4582 graphql_client: self.graphql_client.clone(),
4583 }
4584 }
4585}
4586impl Node for CurrentModule {
4587 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4588 let query = self.selection.select("id");
4589 let graphql_client = self.graphql_client.clone();
4590 async move { query.execute(graphql_client).await }
4591 }
4592}
4593#[derive(Clone)]
4594pub struct DiffStat {
4595 pub proc: Option<Arc<DaggerSessionProc>>,
4596 pub selection: Selection,
4597 pub graphql_client: DynGraphQLClient,
4598}
4599impl IntoID<Id> for DiffStat {
4600 fn into_id(
4601 self,
4602 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4603 Box::pin(async move { self.id().await })
4604 }
4605}
4606impl Loadable for DiffStat {
4607 fn graphql_type() -> &'static str {
4608 "DiffStat"
4609 }
4610 fn from_query(
4611 proc: Option<Arc<DaggerSessionProc>>,
4612 selection: Selection,
4613 graphql_client: DynGraphQLClient,
4614 ) -> Self {
4615 Self {
4616 proc,
4617 selection,
4618 graphql_client,
4619 }
4620 }
4621}
4622impl DiffStat {
4623 pub async fn added_lines(&self) -> Result<isize, DaggerError> {
4625 let query = self.selection.select("addedLines");
4626 query.execute(self.graphql_client.clone()).await
4627 }
4628 pub async fn id(&self) -> Result<Id, DaggerError> {
4630 let query = self.selection.select("id");
4631 query.execute(self.graphql_client.clone()).await
4632 }
4633 pub async fn kind(&self) -> Result<DiffStatKind, DaggerError> {
4635 let query = self.selection.select("kind");
4636 query.execute(self.graphql_client.clone()).await
4637 }
4638 pub async fn old_path(&self) -> Result<String, DaggerError> {
4640 let query = self.selection.select("oldPath");
4641 query.execute(self.graphql_client.clone()).await
4642 }
4643 pub async fn path(&self) -> Result<String, DaggerError> {
4645 let query = self.selection.select("path");
4646 query.execute(self.graphql_client.clone()).await
4647 }
4648 pub async fn removed_lines(&self) -> Result<isize, DaggerError> {
4650 let query = self.selection.select("removedLines");
4651 query.execute(self.graphql_client.clone()).await
4652 }
4653}
4654impl Node for DiffStat {
4655 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
4656 let query = self.selection.select("id");
4657 let graphql_client = self.graphql_client.clone();
4658 async move { query.execute(graphql_client).await }
4659 }
4660}
4661#[derive(Clone)]
4662pub struct Directory {
4663 pub proc: Option<Arc<DaggerSessionProc>>,
4664 pub selection: Selection,
4665 pub graphql_client: DynGraphQLClient,
4666}
4667#[derive(Builder, Debug, PartialEq)]
4668pub struct DirectoryAsModuleOpts<'a> {
4669 #[builder(setter(into, strip_option), default)]
4672 pub source_root_path: Option<&'a str>,
4673}
4674#[derive(Builder, Debug, PartialEq)]
4675pub struct DirectoryAsModuleSourceOpts<'a> {
4676 #[builder(setter(into, strip_option), default)]
4679 pub source_root_path: Option<&'a str>,
4680}
4681#[derive(Builder, Debug, PartialEq)]
4682pub struct DirectoryDockerBuildOpts<'a> {
4683 #[builder(setter(into, strip_option), default)]
4685 pub build_args: Option<Vec<BuildArg>>,
4686 #[builder(setter(into, strip_option), default)]
4688 pub dockerfile: Option<&'a str>,
4689 #[builder(setter(into, strip_option), default)]
4692 pub no_init: Option<bool>,
4693 #[builder(setter(into, strip_option), default)]
4695 pub platform: Option<Platform>,
4696 #[builder(setter(into, strip_option), default)]
4699 pub secrets: Option<Vec<Id>>,
4700 #[builder(setter(into, strip_option), default)]
4704 pub ssh: Option<Id>,
4705 #[builder(setter(into, strip_option), default)]
4707 pub target: Option<&'a str>,
4708}
4709#[derive(Builder, Debug, PartialEq)]
4710pub struct DirectoryEntriesOpts<'a> {
4711 #[builder(setter(into, strip_option), default)]
4713 pub path: Option<&'a str>,
4714}
4715#[derive(Builder, Debug, PartialEq)]
4716pub struct DirectoryExistsOpts {
4717 #[builder(setter(into, strip_option), default)]
4719 pub do_not_follow_symlinks: Option<bool>,
4720 #[builder(setter(into, strip_option), default)]
4722 pub expected_type: Option<ExistsType>,
4723}
4724#[derive(Builder, Debug, PartialEq)]
4725pub struct DirectoryExportOpts {
4726 #[builder(setter(into, strip_option), default)]
4728 pub wipe: Option<bool>,
4729}
4730#[derive(Builder, Debug, PartialEq)]
4731pub struct DirectoryFilterOpts<'a> {
4732 #[builder(setter(into, strip_option), default)]
4734 pub exclude: Option<Vec<&'a str>>,
4735 #[builder(setter(into, strip_option), default)]
4737 pub gitignore: Option<bool>,
4738 #[builder(setter(into, strip_option), default)]
4740 pub include: Option<Vec<&'a str>>,
4741}
4742#[derive(Builder, Debug, PartialEq)]
4743pub struct DirectorySearchOpts<'a> {
4744 #[builder(setter(into, strip_option), default)]
4746 pub dotall: Option<bool>,
4747 #[builder(setter(into, strip_option), default)]
4749 pub files_only: Option<bool>,
4750 #[builder(setter(into, strip_option), default)]
4752 pub globs: Option<Vec<&'a str>>,
4753 #[builder(setter(into, strip_option), default)]
4755 pub insensitive: Option<bool>,
4756 #[builder(setter(into, strip_option), default)]
4758 pub limit: Option<isize>,
4759 #[builder(setter(into, strip_option), default)]
4761 pub literal: Option<bool>,
4762 #[builder(setter(into, strip_option), default)]
4764 pub multiline: Option<bool>,
4765 #[builder(setter(into, strip_option), default)]
4767 pub paths: Option<Vec<&'a str>>,
4768 #[builder(setter(into, strip_option), default)]
4770 pub skip_hidden: Option<bool>,
4771 #[builder(setter(into, strip_option), default)]
4773 pub skip_ignored: Option<bool>,
4774}
4775#[derive(Builder, Debug, PartialEq)]
4776pub struct DirectoryStatOpts {
4777 #[builder(setter(into, strip_option), default)]
4779 pub do_not_follow_symlinks: Option<bool>,
4780}
4781#[derive(Builder, Debug, PartialEq)]
4782pub struct DirectoryTerminalOpts<'a> {
4783 #[builder(setter(into, strip_option), default)]
4785 pub cmd: Option<Vec<&'a str>>,
4786 #[builder(setter(into, strip_option), default)]
4788 pub container: Option<Id>,
4789 #[builder(setter(into, strip_option), default)]
4791 pub experimental_privileged_nesting: Option<bool>,
4792 #[builder(setter(into, strip_option), default)]
4794 pub insecure_root_capabilities: Option<bool>,
4795}
4796#[derive(Builder, Debug, PartialEq)]
4797pub struct DirectoryWithDirectoryOpts<'a> {
4798 #[builder(setter(into, strip_option), default)]
4800 pub exclude: Option<Vec<&'a str>>,
4801 #[builder(setter(into, strip_option), default)]
4803 pub gitignore: Option<bool>,
4804 #[builder(setter(into, strip_option), default)]
4806 pub include: Option<Vec<&'a str>>,
4807 #[builder(setter(into, strip_option), default)]
4811 pub owner: Option<&'a str>,
4812 #[builder(setter(into, strip_option), default)]
4814 pub permissions: Option<isize>,
4815}
4816#[derive(Builder, Debug, PartialEq)]
4817pub struct DirectoryWithFileOpts<'a> {
4818 #[builder(setter(into, strip_option), default)]
4822 pub owner: Option<&'a str>,
4823 #[builder(setter(into, strip_option), default)]
4825 pub permissions: Option<isize>,
4826}
4827#[derive(Builder, Debug, PartialEq)]
4828pub struct DirectoryWithFilesOpts {
4829 #[builder(setter(into, strip_option), default)]
4831 pub permissions: Option<isize>,
4832}
4833#[derive(Builder, Debug, PartialEq)]
4834pub struct DirectoryWithNewDirectoryOpts {
4835 #[builder(setter(into, strip_option), default)]
4837 pub permissions: Option<isize>,
4838}
4839#[derive(Builder, Debug, PartialEq)]
4840pub struct DirectoryWithNewFileOpts {
4841 #[builder(setter(into, strip_option), default)]
4843 pub permissions: Option<isize>,
4844}
4845impl IntoID<Id> for Directory {
4846 fn into_id(
4847 self,
4848 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
4849 Box::pin(async move { self.id().await })
4850 }
4851}
4852impl Loadable for Directory {
4853 fn graphql_type() -> &'static str {
4854 "Directory"
4855 }
4856 fn from_query(
4857 proc: Option<Arc<DaggerSessionProc>>,
4858 selection: Selection,
4859 graphql_client: DynGraphQLClient,
4860 ) -> Self {
4861 Self {
4862 proc,
4863 selection,
4864 graphql_client,
4865 }
4866 }
4867}
4868impl Directory {
4869 pub fn as_git(&self) -> GitRepository {
4871 let query = self.selection.select("asGit");
4872 GitRepository {
4873 proc: self.proc.clone(),
4874 selection: query,
4875 graphql_client: self.graphql_client.clone(),
4876 }
4877 }
4878 pub fn as_module(&self) -> Module {
4884 let query = self.selection.select("asModule");
4885 Module {
4886 proc: self.proc.clone(),
4887 selection: query,
4888 graphql_client: self.graphql_client.clone(),
4889 }
4890 }
4891 pub fn as_module_opts<'a>(&self, opts: DirectoryAsModuleOpts<'a>) -> Module {
4897 let mut query = self.selection.select("asModule");
4898 if let Some(source_root_path) = opts.source_root_path {
4899 query = query.arg("sourceRootPath", source_root_path);
4900 }
4901 Module {
4902 proc: self.proc.clone(),
4903 selection: query,
4904 graphql_client: self.graphql_client.clone(),
4905 }
4906 }
4907 pub fn as_module_source(&self) -> ModuleSource {
4913 let query = self.selection.select("asModuleSource");
4914 ModuleSource {
4915 proc: self.proc.clone(),
4916 selection: query,
4917 graphql_client: self.graphql_client.clone(),
4918 }
4919 }
4920 pub fn as_module_source_opts<'a>(&self, opts: DirectoryAsModuleSourceOpts<'a>) -> ModuleSource {
4926 let mut query = self.selection.select("asModuleSource");
4927 if let Some(source_root_path) = opts.source_root_path {
4928 query = query.arg("sourceRootPath", source_root_path);
4929 }
4930 ModuleSource {
4931 proc: self.proc.clone(),
4932 selection: query,
4933 graphql_client: self.graphql_client.clone(),
4934 }
4935 }
4936 pub fn changes(&self, from: impl IntoID<Id>) -> Changeset {
4943 let mut query = self.selection.select("changes");
4944 query = query.arg_lazy(
4945 "from",
4946 Box::new(move || {
4947 let from = from.clone();
4948 Box::pin(async move { from.into_id().await.unwrap().quote() })
4949 }),
4950 );
4951 Changeset {
4952 proc: self.proc.clone(),
4953 selection: query,
4954 graphql_client: self.graphql_client.clone(),
4955 }
4956 }
4957 pub fn chown(&self, path: impl Into<String>, owner: impl Into<String>) -> Directory {
4968 let mut query = self.selection.select("chown");
4969 query = query.arg("path", path.into());
4970 query = query.arg("owner", owner.into());
4971 Directory {
4972 proc: self.proc.clone(),
4973 selection: query,
4974 graphql_client: self.graphql_client.clone(),
4975 }
4976 }
4977 pub fn diff(&self, other: impl IntoID<Id>) -> Directory {
4983 let mut query = self.selection.select("diff");
4984 query = query.arg_lazy(
4985 "other",
4986 Box::new(move || {
4987 let other = other.clone();
4988 Box::pin(async move { other.into_id().await.unwrap().quote() })
4989 }),
4990 );
4991 Directory {
4992 proc: self.proc.clone(),
4993 selection: query,
4994 graphql_client: self.graphql_client.clone(),
4995 }
4996 }
4997 pub async fn digest(&self) -> Result<String, DaggerError> {
4999 let query = self.selection.select("digest");
5000 query.execute(self.graphql_client.clone()).await
5001 }
5002 pub fn directory(&self, path: impl Into<String>) -> Directory {
5008 let mut query = self.selection.select("directory");
5009 query = query.arg("path", path.into());
5010 Directory {
5011 proc: self.proc.clone(),
5012 selection: query,
5013 graphql_client: self.graphql_client.clone(),
5014 }
5015 }
5016 pub fn docker_build(&self) -> Container {
5022 let query = self.selection.select("dockerBuild");
5023 Container {
5024 proc: self.proc.clone(),
5025 selection: query,
5026 graphql_client: self.graphql_client.clone(),
5027 }
5028 }
5029 pub fn docker_build_opts<'a>(&self, opts: DirectoryDockerBuildOpts<'a>) -> Container {
5035 let mut query = self.selection.select("dockerBuild");
5036 if let Some(dockerfile) = opts.dockerfile {
5037 query = query.arg("dockerfile", dockerfile);
5038 }
5039 if let Some(platform) = opts.platform {
5040 query = query.arg("platform", platform);
5041 }
5042 if let Some(build_args) = opts.build_args {
5043 query = query.arg("buildArgs", build_args);
5044 }
5045 if let Some(target) = opts.target {
5046 query = query.arg("target", target);
5047 }
5048 if let Some(secrets) = opts.secrets {
5049 query = query.arg("secrets", secrets);
5050 }
5051 if let Some(no_init) = opts.no_init {
5052 query = query.arg("noInit", no_init);
5053 }
5054 if let Some(ssh) = opts.ssh {
5055 query = query.arg("ssh", ssh);
5056 }
5057 Container {
5058 proc: self.proc.clone(),
5059 selection: query,
5060 graphql_client: self.graphql_client.clone(),
5061 }
5062 }
5063 pub async fn entries(&self) -> Result<Vec<String>, DaggerError> {
5069 let query = self.selection.select("entries");
5070 query.execute(self.graphql_client.clone()).await
5071 }
5072 pub async fn entries_opts<'a>(
5078 &self,
5079 opts: DirectoryEntriesOpts<'a>,
5080 ) -> Result<Vec<String>, DaggerError> {
5081 let mut query = self.selection.select("entries");
5082 if let Some(path) = opts.path {
5083 query = query.arg("path", path);
5084 }
5085 query.execute(self.graphql_client.clone()).await
5086 }
5087 pub async fn exists(&self, path: impl Into<String>) -> Result<bool, DaggerError> {
5094 let mut query = self.selection.select("exists");
5095 query = query.arg("path", path.into());
5096 query.execute(self.graphql_client.clone()).await
5097 }
5098 pub async fn exists_opts(
5105 &self,
5106 path: impl Into<String>,
5107 opts: DirectoryExistsOpts,
5108 ) -> Result<bool, DaggerError> {
5109 let mut query = self.selection.select("exists");
5110 query = query.arg("path", path.into());
5111 if let Some(expected_type) = opts.expected_type {
5112 query = query.arg("expectedType", expected_type);
5113 }
5114 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5115 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5116 }
5117 query.execute(self.graphql_client.clone()).await
5118 }
5119 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
5126 let mut query = self.selection.select("export");
5127 query = query.arg("path", path.into());
5128 query.execute(self.graphql_client.clone()).await
5129 }
5130 pub async fn export_opts(
5137 &self,
5138 path: impl Into<String>,
5139 opts: DirectoryExportOpts,
5140 ) -> Result<String, DaggerError> {
5141 let mut query = self.selection.select("export");
5142 query = query.arg("path", path.into());
5143 if let Some(wipe) = opts.wipe {
5144 query = query.arg("wipe", wipe);
5145 }
5146 query.execute(self.graphql_client.clone()).await
5147 }
5148 pub fn file(&self, path: impl Into<String>) -> File {
5154 let mut query = self.selection.select("file");
5155 query = query.arg("path", path.into());
5156 File {
5157 proc: self.proc.clone(),
5158 selection: query,
5159 graphql_client: self.graphql_client.clone(),
5160 }
5161 }
5162 pub fn filter(&self) -> Directory {
5168 let query = self.selection.select("filter");
5169 Directory {
5170 proc: self.proc.clone(),
5171 selection: query,
5172 graphql_client: self.graphql_client.clone(),
5173 }
5174 }
5175 pub fn filter_opts<'a>(&self, opts: DirectoryFilterOpts<'a>) -> Directory {
5181 let mut query = self.selection.select("filter");
5182 if let Some(exclude) = opts.exclude {
5183 query = query.arg("exclude", exclude);
5184 }
5185 if let Some(include) = opts.include {
5186 query = query.arg("include", include);
5187 }
5188 if let Some(gitignore) = opts.gitignore {
5189 query = query.arg("gitignore", gitignore);
5190 }
5191 Directory {
5192 proc: self.proc.clone(),
5193 selection: query,
5194 graphql_client: self.graphql_client.clone(),
5195 }
5196 }
5197 pub async fn find_up(
5204 &self,
5205 name: impl Into<String>,
5206 start: impl Into<String>,
5207 ) -> Result<String, DaggerError> {
5208 let mut query = self.selection.select("findUp");
5209 query = query.arg("name", name.into());
5210 query = query.arg("start", start.into());
5211 query.execute(self.graphql_client.clone()).await
5212 }
5213 pub async fn glob(&self, pattern: impl Into<String>) -> Result<Vec<String>, DaggerError> {
5219 let mut query = self.selection.select("glob");
5220 query = query.arg("pattern", pattern.into());
5221 query.execute(self.graphql_client.clone()).await
5222 }
5223 pub async fn id(&self) -> Result<Id, DaggerError> {
5225 let query = self.selection.select("id");
5226 query.execute(self.graphql_client.clone()).await
5227 }
5228 pub async fn name(&self) -> Result<String, DaggerError> {
5230 let query = self.selection.select("name");
5231 query.execute(self.graphql_client.clone()).await
5232 }
5233 pub async fn search(
5241 &self,
5242 pattern: impl Into<String>,
5243 ) -> Result<Vec<SearchResult>, DaggerError> {
5244 let mut query = self.selection.select("search");
5245 query = query.arg("pattern", pattern.into());
5246 let query = query.select("id");
5247 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5248 Ok(ids
5249 .into_iter()
5250 .map(|id| SearchResult {
5251 proc: self.proc.clone(),
5252 selection: crate::querybuilder::query()
5253 .select("node")
5254 .arg("id", &id.0)
5255 .inline_fragment("SearchResult"),
5256 graphql_client: self.graphql_client.clone(),
5257 })
5258 .collect())
5259 }
5260 pub async fn search_opts<'a>(
5268 &self,
5269 pattern: impl Into<String>,
5270 opts: DirectorySearchOpts<'a>,
5271 ) -> Result<Vec<SearchResult>, DaggerError> {
5272 let mut query = self.selection.select("search");
5273 query = query.arg("pattern", pattern.into());
5274 if let Some(paths) = opts.paths {
5275 query = query.arg("paths", paths);
5276 }
5277 if let Some(globs) = opts.globs {
5278 query = query.arg("globs", globs);
5279 }
5280 if let Some(literal) = opts.literal {
5281 query = query.arg("literal", literal);
5282 }
5283 if let Some(multiline) = opts.multiline {
5284 query = query.arg("multiline", multiline);
5285 }
5286 if let Some(dotall) = opts.dotall {
5287 query = query.arg("dotall", dotall);
5288 }
5289 if let Some(insensitive) = opts.insensitive {
5290 query = query.arg("insensitive", insensitive);
5291 }
5292 if let Some(skip_ignored) = opts.skip_ignored {
5293 query = query.arg("skipIgnored", skip_ignored);
5294 }
5295 if let Some(skip_hidden) = opts.skip_hidden {
5296 query = query.arg("skipHidden", skip_hidden);
5297 }
5298 if let Some(files_only) = opts.files_only {
5299 query = query.arg("filesOnly", files_only);
5300 }
5301 if let Some(limit) = opts.limit {
5302 query = query.arg("limit", limit);
5303 }
5304 let query = query.select("id");
5305 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
5306 Ok(ids
5307 .into_iter()
5308 .map(|id| SearchResult {
5309 proc: self.proc.clone(),
5310 selection: crate::querybuilder::query()
5311 .select("node")
5312 .arg("id", &id.0)
5313 .inline_fragment("SearchResult"),
5314 graphql_client: self.graphql_client.clone(),
5315 })
5316 .collect())
5317 }
5318 pub fn stat(&self, path: impl Into<String>) -> Stat {
5325 let mut query = self.selection.select("stat");
5326 query = query.arg("path", path.into());
5327 Stat {
5328 proc: self.proc.clone(),
5329 selection: query,
5330 graphql_client: self.graphql_client.clone(),
5331 }
5332 }
5333 pub fn stat_opts(&self, path: impl Into<String>, opts: DirectoryStatOpts) -> Stat {
5340 let mut query = self.selection.select("stat");
5341 query = query.arg("path", path.into());
5342 if let Some(do_not_follow_symlinks) = opts.do_not_follow_symlinks {
5343 query = query.arg("doNotFollowSymlinks", do_not_follow_symlinks);
5344 }
5345 Stat {
5346 proc: self.proc.clone(),
5347 selection: query,
5348 graphql_client: self.graphql_client.clone(),
5349 }
5350 }
5351 pub async fn sync(&self) -> Result<Directory, DaggerError> {
5353 let query = self.selection.select("sync");
5354 let id: Id = query.execute(self.graphql_client.clone()).await?;
5355 Ok(Directory {
5356 proc: self.proc.clone(),
5357 selection: query
5358 .root()
5359 .select("node")
5360 .arg("id", &id.0)
5361 .inline_fragment("Directory"),
5362 graphql_client: self.graphql_client.clone(),
5363 })
5364 }
5365 pub fn terminal(&self) -> Directory {
5371 let query = self.selection.select("terminal");
5372 Directory {
5373 proc: self.proc.clone(),
5374 selection: query,
5375 graphql_client: self.graphql_client.clone(),
5376 }
5377 }
5378 pub fn terminal_opts<'a>(&self, opts: DirectoryTerminalOpts<'a>) -> Directory {
5384 let mut query = self.selection.select("terminal");
5385 if let Some(container) = opts.container {
5386 query = query.arg("container", container);
5387 }
5388 if let Some(cmd) = opts.cmd {
5389 query = query.arg("cmd", cmd);
5390 }
5391 if let Some(experimental_privileged_nesting) = opts.experimental_privileged_nesting {
5392 query = query.arg(
5393 "experimentalPrivilegedNesting",
5394 experimental_privileged_nesting,
5395 );
5396 }
5397 if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
5398 query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
5399 }
5400 Directory {
5401 proc: self.proc.clone(),
5402 selection: query,
5403 graphql_client: self.graphql_client.clone(),
5404 }
5405 }
5406 pub fn with_changes(&self, changes: impl IntoID<Id>) -> Directory {
5412 let mut query = self.selection.select("withChanges");
5413 query = query.arg_lazy(
5414 "changes",
5415 Box::new(move || {
5416 let changes = changes.clone();
5417 Box::pin(async move { changes.into_id().await.unwrap().quote() })
5418 }),
5419 );
5420 Directory {
5421 proc: self.proc.clone(),
5422 selection: query,
5423 graphql_client: self.graphql_client.clone(),
5424 }
5425 }
5426 pub fn with_directory(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5434 let mut query = self.selection.select("withDirectory");
5435 query = query.arg("path", path.into());
5436 query = query.arg_lazy(
5437 "source",
5438 Box::new(move || {
5439 let source = source.clone();
5440 Box::pin(async move { source.into_id().await.unwrap().quote() })
5441 }),
5442 );
5443 Directory {
5444 proc: self.proc.clone(),
5445 selection: query,
5446 graphql_client: self.graphql_client.clone(),
5447 }
5448 }
5449 pub fn with_directory_opts<'a>(
5457 &self,
5458 path: impl Into<String>,
5459 source: impl IntoID<Id>,
5460 opts: DirectoryWithDirectoryOpts<'a>,
5461 ) -> Directory {
5462 let mut query = self.selection.select("withDirectory");
5463 query = query.arg("path", path.into());
5464 query = query.arg_lazy(
5465 "source",
5466 Box::new(move || {
5467 let source = source.clone();
5468 Box::pin(async move { source.into_id().await.unwrap().quote() })
5469 }),
5470 );
5471 if let Some(exclude) = opts.exclude {
5472 query = query.arg("exclude", exclude);
5473 }
5474 if let Some(include) = opts.include {
5475 query = query.arg("include", include);
5476 }
5477 if let Some(gitignore) = opts.gitignore {
5478 query = query.arg("gitignore", gitignore);
5479 }
5480 if let Some(owner) = opts.owner {
5481 query = query.arg("owner", owner);
5482 }
5483 if let Some(permissions) = opts.permissions {
5484 query = query.arg("permissions", permissions);
5485 }
5486 Directory {
5487 proc: self.proc.clone(),
5488 selection: query,
5489 graphql_client: self.graphql_client.clone(),
5490 }
5491 }
5492 pub fn with_error(&self, err: impl Into<String>) -> Directory {
5498 let mut query = self.selection.select("withError");
5499 query = query.arg("err", err.into());
5500 Directory {
5501 proc: self.proc.clone(),
5502 selection: query,
5503 graphql_client: self.graphql_client.clone(),
5504 }
5505 }
5506 pub fn with_file(&self, path: impl Into<String>, source: impl IntoID<Id>) -> Directory {
5514 let mut query = self.selection.select("withFile");
5515 query = query.arg("path", path.into());
5516 query = query.arg_lazy(
5517 "source",
5518 Box::new(move || {
5519 let source = source.clone();
5520 Box::pin(async move { source.into_id().await.unwrap().quote() })
5521 }),
5522 );
5523 Directory {
5524 proc: self.proc.clone(),
5525 selection: query,
5526 graphql_client: self.graphql_client.clone(),
5527 }
5528 }
5529 pub fn with_file_opts<'a>(
5537 &self,
5538 path: impl Into<String>,
5539 source: impl IntoID<Id>,
5540 opts: DirectoryWithFileOpts<'a>,
5541 ) -> Directory {
5542 let mut query = self.selection.select("withFile");
5543 query = query.arg("path", path.into());
5544 query = query.arg_lazy(
5545 "source",
5546 Box::new(move || {
5547 let source = source.clone();
5548 Box::pin(async move { source.into_id().await.unwrap().quote() })
5549 }),
5550 );
5551 if let Some(permissions) = opts.permissions {
5552 query = query.arg("permissions", permissions);
5553 }
5554 if let Some(owner) = opts.owner {
5555 query = query.arg("owner", owner);
5556 }
5557 Directory {
5558 proc: self.proc.clone(),
5559 selection: query,
5560 graphql_client: self.graphql_client.clone(),
5561 }
5562 }
5563 pub fn with_files(&self, path: impl Into<String>, sources: Vec<Id>) -> Directory {
5571 let mut query = self.selection.select("withFiles");
5572 query = query.arg("path", path.into());
5573 query = query.arg("sources", sources);
5574 Directory {
5575 proc: self.proc.clone(),
5576 selection: query,
5577 graphql_client: self.graphql_client.clone(),
5578 }
5579 }
5580 pub fn with_files_opts(
5588 &self,
5589 path: impl Into<String>,
5590 sources: Vec<Id>,
5591 opts: DirectoryWithFilesOpts,
5592 ) -> Directory {
5593 let mut query = self.selection.select("withFiles");
5594 query = query.arg("path", path.into());
5595 query = query.arg("sources", sources);
5596 if let Some(permissions) = opts.permissions {
5597 query = query.arg("permissions", permissions);
5598 }
5599 Directory {
5600 proc: self.proc.clone(),
5601 selection: query,
5602 graphql_client: self.graphql_client.clone(),
5603 }
5604 }
5605 pub fn with_new_directory(&self, path: impl Into<String>) -> Directory {
5612 let mut query = self.selection.select("withNewDirectory");
5613 query = query.arg("path", path.into());
5614 Directory {
5615 proc: self.proc.clone(),
5616 selection: query,
5617 graphql_client: self.graphql_client.clone(),
5618 }
5619 }
5620 pub fn with_new_directory_opts(
5627 &self,
5628 path: impl Into<String>,
5629 opts: DirectoryWithNewDirectoryOpts,
5630 ) -> Directory {
5631 let mut query = self.selection.select("withNewDirectory");
5632 query = query.arg("path", path.into());
5633 if let Some(permissions) = opts.permissions {
5634 query = query.arg("permissions", permissions);
5635 }
5636 Directory {
5637 proc: self.proc.clone(),
5638 selection: query,
5639 graphql_client: self.graphql_client.clone(),
5640 }
5641 }
5642 pub fn with_new_file(&self, path: impl Into<String>, contents: impl Into<String>) -> Directory {
5650 let mut query = self.selection.select("withNewFile");
5651 query = query.arg("path", path.into());
5652 query = query.arg("contents", contents.into());
5653 Directory {
5654 proc: self.proc.clone(),
5655 selection: query,
5656 graphql_client: self.graphql_client.clone(),
5657 }
5658 }
5659 pub fn with_new_file_opts(
5667 &self,
5668 path: impl Into<String>,
5669 contents: impl Into<String>,
5670 opts: DirectoryWithNewFileOpts,
5671 ) -> Directory {
5672 let mut query = self.selection.select("withNewFile");
5673 query = query.arg("path", path.into());
5674 query = query.arg("contents", contents.into());
5675 if let Some(permissions) = opts.permissions {
5676 query = query.arg("permissions", permissions);
5677 }
5678 Directory {
5679 proc: self.proc.clone(),
5680 selection: query,
5681 graphql_client: self.graphql_client.clone(),
5682 }
5683 }
5684 pub fn with_patch(&self, patch: impl Into<String>) -> Directory {
5690 let mut query = self.selection.select("withPatch");
5691 query = query.arg("patch", patch.into());
5692 Directory {
5693 proc: self.proc.clone(),
5694 selection: query,
5695 graphql_client: self.graphql_client.clone(),
5696 }
5697 }
5698 pub fn with_patch_file(&self, patch: impl IntoID<Id>) -> Directory {
5704 let mut query = self.selection.select("withPatchFile");
5705 query = query.arg_lazy(
5706 "patch",
5707 Box::new(move || {
5708 let patch = patch.clone();
5709 Box::pin(async move { patch.into_id().await.unwrap().quote() })
5710 }),
5711 );
5712 Directory {
5713 proc: self.proc.clone(),
5714 selection: query,
5715 graphql_client: self.graphql_client.clone(),
5716 }
5717 }
5718 pub fn with_symlink(
5725 &self,
5726 target: impl Into<String>,
5727 link_name: impl Into<String>,
5728 ) -> Directory {
5729 let mut query = self.selection.select("withSymlink");
5730 query = query.arg("target", target.into());
5731 query = query.arg("linkName", link_name.into());
5732 Directory {
5733 proc: self.proc.clone(),
5734 selection: query,
5735 graphql_client: self.graphql_client.clone(),
5736 }
5737 }
5738 pub fn with_timestamps(&self, timestamp: isize) -> Directory {
5746 let mut query = self.selection.select("withTimestamps");
5747 query = query.arg("timestamp", timestamp);
5748 Directory {
5749 proc: self.proc.clone(),
5750 selection: query,
5751 graphql_client: self.graphql_client.clone(),
5752 }
5753 }
5754 pub fn without_directory(&self, path: impl Into<String>) -> Directory {
5760 let mut query = self.selection.select("withoutDirectory");
5761 query = query.arg("path", path.into());
5762 Directory {
5763 proc: self.proc.clone(),
5764 selection: query,
5765 graphql_client: self.graphql_client.clone(),
5766 }
5767 }
5768 pub fn without_file(&self, path: impl Into<String>) -> Directory {
5774 let mut query = self.selection.select("withoutFile");
5775 query = query.arg("path", path.into());
5776 Directory {
5777 proc: self.proc.clone(),
5778 selection: query,
5779 graphql_client: self.graphql_client.clone(),
5780 }
5781 }
5782 pub fn without_files(&self, paths: Vec<impl Into<String>>) -> Directory {
5788 let mut query = self.selection.select("withoutFiles");
5789 query = query.arg(
5790 "paths",
5791 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
5792 );
5793 Directory {
5794 proc: self.proc.clone(),
5795 selection: query,
5796 graphql_client: self.graphql_client.clone(),
5797 }
5798 }
5799}
5800impl Exportable for Directory {
5801 fn export(
5802 &self,
5803 path: impl Into<String>,
5804 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
5805 let mut query = self.selection.select("export");
5806 query = query.arg("path", path.into());
5807 let graphql_client = self.graphql_client.clone();
5808 async move { query.execute(graphql_client).await }
5809 }
5810 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5811 let query = self.selection.select("id");
5812 let graphql_client = self.graphql_client.clone();
5813 async move { query.execute(graphql_client).await }
5814 }
5815}
5816impl Node for Directory {
5817 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5818 let query = self.selection.select("id");
5819 let graphql_client = self.graphql_client.clone();
5820 async move { query.execute(graphql_client).await }
5821 }
5822}
5823impl Syncer for Directory {
5824 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5825 let query = self.selection.select("id");
5826 let graphql_client = self.graphql_client.clone();
5827 async move { query.execute(graphql_client).await }
5828 }
5829 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5830 let query = self.selection.select("sync");
5831 let graphql_client = self.graphql_client.clone();
5832 async move { query.execute(graphql_client).await }
5833 }
5834}
5835#[derive(Clone)]
5836pub struct Engine {
5837 pub proc: Option<Arc<DaggerSessionProc>>,
5838 pub selection: Selection,
5839 pub graphql_client: DynGraphQLClient,
5840}
5841impl IntoID<Id> for Engine {
5842 fn into_id(
5843 self,
5844 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
5845 Box::pin(async move { self.id().await })
5846 }
5847}
5848impl Loadable for Engine {
5849 fn graphql_type() -> &'static str {
5850 "Engine"
5851 }
5852 fn from_query(
5853 proc: Option<Arc<DaggerSessionProc>>,
5854 selection: Selection,
5855 graphql_client: DynGraphQLClient,
5856 ) -> Self {
5857 Self {
5858 proc,
5859 selection,
5860 graphql_client,
5861 }
5862 }
5863}
5864impl Engine {
5865 pub async fn clients(&self) -> Result<Vec<String>, DaggerError> {
5867 let query = self.selection.select("clients");
5868 query.execute(self.graphql_client.clone()).await
5869 }
5870 pub async fn id(&self) -> Result<Id, DaggerError> {
5872 let query = self.selection.select("id");
5873 query.execute(self.graphql_client.clone()).await
5874 }
5875 pub fn local_cache(&self) -> EngineCache {
5877 let query = self.selection.select("localCache");
5878 EngineCache {
5879 proc: self.proc.clone(),
5880 selection: query,
5881 graphql_client: self.graphql_client.clone(),
5882 }
5883 }
5884 pub async fn name(&self) -> Result<String, DaggerError> {
5886 let query = self.selection.select("name");
5887 query.execute(self.graphql_client.clone()).await
5888 }
5889}
5890impl Node for Engine {
5891 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
5892 let query = self.selection.select("id");
5893 let graphql_client = self.graphql_client.clone();
5894 async move { query.execute(graphql_client).await }
5895 }
5896}
5897#[derive(Clone)]
5898pub struct EngineCache {
5899 pub proc: Option<Arc<DaggerSessionProc>>,
5900 pub selection: Selection,
5901 pub graphql_client: DynGraphQLClient,
5902}
5903#[derive(Builder, Debug, PartialEq)]
5904pub struct EngineCacheEntrySetOpts<'a> {
5905 #[builder(setter(into, strip_option), default)]
5906 pub key: Option<&'a str>,
5907}
5908#[derive(Builder, Debug, PartialEq)]
5909pub struct EngineCachePruneOpts<'a> {
5910 #[builder(setter(into, strip_option), default)]
5912 pub max_used_space: Option<&'a str>,
5913 #[builder(setter(into, strip_option), default)]
5915 pub min_free_space: Option<&'a str>,
5916 #[builder(setter(into, strip_option), default)]
5918 pub reserved_space: Option<&'a str>,
5919 #[builder(setter(into, strip_option), default)]
5921 pub target_space: Option<&'a str>,
5922 #[builder(setter(into, strip_option), default)]
5924 pub use_default_policy: Option<bool>,
5925}
5926impl IntoID<Id> for EngineCache {
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 EngineCache {
5934 fn graphql_type() -> &'static str {
5935 "EngineCache"
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 EngineCache {
5950 pub fn entry_set(&self) -> EngineCacheEntrySet {
5956 let query = self.selection.select("entrySet");
5957 EngineCacheEntrySet {
5958 proc: self.proc.clone(),
5959 selection: query,
5960 graphql_client: self.graphql_client.clone(),
5961 }
5962 }
5963 pub fn entry_set_opts<'a>(&self, opts: EngineCacheEntrySetOpts<'a>) -> EngineCacheEntrySet {
5969 let mut query = self.selection.select("entrySet");
5970 if let Some(key) = opts.key {
5971 query = query.arg("key", key);
5972 }
5973 EngineCacheEntrySet {
5974 proc: self.proc.clone(),
5975 selection: query,
5976 graphql_client: self.graphql_client.clone(),
5977 }
5978 }
5979 pub async fn id(&self) -> Result<Id, DaggerError> {
5981 let query = self.selection.select("id");
5982 query.execute(self.graphql_client.clone()).await
5983 }
5984 pub async fn max_used_space(&self) -> Result<isize, DaggerError> {
5986 let query = self.selection.select("maxUsedSpace");
5987 query.execute(self.graphql_client.clone()).await
5988 }
5989 pub async fn min_free_space(&self) -> Result<isize, DaggerError> {
5991 let query = self.selection.select("minFreeSpace");
5992 query.execute(self.graphql_client.clone()).await
5993 }
5994 pub async fn prune(&self) -> Result<Void, DaggerError> {
6000 let query = self.selection.select("prune");
6001 query.execute(self.graphql_client.clone()).await
6002 }
6003 pub async fn prune_opts<'a>(
6009 &self,
6010 opts: EngineCachePruneOpts<'a>,
6011 ) -> Result<Void, DaggerError> {
6012 let mut query = self.selection.select("prune");
6013 if let Some(use_default_policy) = opts.use_default_policy {
6014 query = query.arg("useDefaultPolicy", use_default_policy);
6015 }
6016 if let Some(max_used_space) = opts.max_used_space {
6017 query = query.arg("maxUsedSpace", max_used_space);
6018 }
6019 if let Some(reserved_space) = opts.reserved_space {
6020 query = query.arg("reservedSpace", reserved_space);
6021 }
6022 if let Some(min_free_space) = opts.min_free_space {
6023 query = query.arg("minFreeSpace", min_free_space);
6024 }
6025 if let Some(target_space) = opts.target_space {
6026 query = query.arg("targetSpace", target_space);
6027 }
6028 query.execute(self.graphql_client.clone()).await
6029 }
6030 pub async fn reserved_space(&self) -> Result<isize, DaggerError> {
6032 let query = self.selection.select("reservedSpace");
6033 query.execute(self.graphql_client.clone()).await
6034 }
6035 pub async fn target_space(&self) -> Result<isize, DaggerError> {
6037 let query = self.selection.select("targetSpace");
6038 query.execute(self.graphql_client.clone()).await
6039 }
6040}
6041impl Node for EngineCache {
6042 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6043 let query = self.selection.select("id");
6044 let graphql_client = self.graphql_client.clone();
6045 async move { query.execute(graphql_client).await }
6046 }
6047}
6048#[derive(Clone)]
6049pub struct EngineCacheEntry {
6050 pub proc: Option<Arc<DaggerSessionProc>>,
6051 pub selection: Selection,
6052 pub graphql_client: DynGraphQLClient,
6053}
6054impl IntoID<Id> for EngineCacheEntry {
6055 fn into_id(
6056 self,
6057 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6058 Box::pin(async move { self.id().await })
6059 }
6060}
6061impl Loadable for EngineCacheEntry {
6062 fn graphql_type() -> &'static str {
6063 "EngineCacheEntry"
6064 }
6065 fn from_query(
6066 proc: Option<Arc<DaggerSessionProc>>,
6067 selection: Selection,
6068 graphql_client: DynGraphQLClient,
6069 ) -> Self {
6070 Self {
6071 proc,
6072 selection,
6073 graphql_client,
6074 }
6075 }
6076}
6077impl EngineCacheEntry {
6078 pub async fn actively_used(&self) -> Result<bool, DaggerError> {
6080 let query = self.selection.select("activelyUsed");
6081 query.execute(self.graphql_client.clone()).await
6082 }
6083 pub async fn created_time_unix_nano(&self) -> Result<isize, DaggerError> {
6085 let query = self.selection.select("createdTimeUnixNano");
6086 query.execute(self.graphql_client.clone()).await
6087 }
6088 pub async fn dagql_call(&self) -> Result<String, DaggerError> {
6090 let query = self.selection.select("dagqlCall");
6091 query.execute(self.graphql_client.clone()).await
6092 }
6093 pub async fn description(&self) -> Result<String, DaggerError> {
6095 let query = self.selection.select("description");
6096 query.execute(self.graphql_client.clone()).await
6097 }
6098 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6100 let query = self.selection.select("diskSpaceBytes");
6101 query.execute(self.graphql_client.clone()).await
6102 }
6103 pub async fn id(&self) -> Result<Id, DaggerError> {
6105 let query = self.selection.select("id");
6106 query.execute(self.graphql_client.clone()).await
6107 }
6108 pub async fn most_recent_use_time_unix_nano(&self) -> Result<isize, DaggerError> {
6110 let query = self.selection.select("mostRecentUseTimeUnixNano");
6111 query.execute(self.graphql_client.clone()).await
6112 }
6113 pub async fn record_type(&self) -> Result<String, DaggerError> {
6115 let query = self.selection.select("recordType");
6116 query.execute(self.graphql_client.clone()).await
6117 }
6118 pub async fn record_types(&self) -> Result<Vec<String>, DaggerError> {
6120 let query = self.selection.select("recordTypes");
6121 query.execute(self.graphql_client.clone()).await
6122 }
6123}
6124impl Node for EngineCacheEntry {
6125 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6126 let query = self.selection.select("id");
6127 let graphql_client = self.graphql_client.clone();
6128 async move { query.execute(graphql_client).await }
6129 }
6130}
6131#[derive(Clone)]
6132pub struct EngineCacheEntrySet {
6133 pub proc: Option<Arc<DaggerSessionProc>>,
6134 pub selection: Selection,
6135 pub graphql_client: DynGraphQLClient,
6136}
6137impl IntoID<Id> for EngineCacheEntrySet {
6138 fn into_id(
6139 self,
6140 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6141 Box::pin(async move { self.id().await })
6142 }
6143}
6144impl Loadable for EngineCacheEntrySet {
6145 fn graphql_type() -> &'static str {
6146 "EngineCacheEntrySet"
6147 }
6148 fn from_query(
6149 proc: Option<Arc<DaggerSessionProc>>,
6150 selection: Selection,
6151 graphql_client: DynGraphQLClient,
6152 ) -> Self {
6153 Self {
6154 proc,
6155 selection,
6156 graphql_client,
6157 }
6158 }
6159}
6160impl EngineCacheEntrySet {
6161 pub async fn disk_space_bytes(&self) -> Result<isize, DaggerError> {
6163 let query = self.selection.select("diskSpaceBytes");
6164 query.execute(self.graphql_client.clone()).await
6165 }
6166 pub async fn entries(&self) -> Result<Vec<EngineCacheEntry>, DaggerError> {
6168 let query = self.selection.select("entries");
6169 let query = query.select("id");
6170 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6171 Ok(ids
6172 .into_iter()
6173 .map(|id| EngineCacheEntry {
6174 proc: self.proc.clone(),
6175 selection: crate::querybuilder::query()
6176 .select("node")
6177 .arg("id", &id.0)
6178 .inline_fragment("EngineCacheEntry"),
6179 graphql_client: self.graphql_client.clone(),
6180 })
6181 .collect())
6182 }
6183 pub async fn entry_count(&self) -> Result<isize, DaggerError> {
6185 let query = self.selection.select("entryCount");
6186 query.execute(self.graphql_client.clone()).await
6187 }
6188 pub async fn id(&self) -> Result<Id, DaggerError> {
6190 let query = self.selection.select("id");
6191 query.execute(self.graphql_client.clone()).await
6192 }
6193}
6194impl Node for EngineCacheEntrySet {
6195 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6196 let query = self.selection.select("id");
6197 let graphql_client = self.graphql_client.clone();
6198 async move { query.execute(graphql_client).await }
6199 }
6200}
6201#[derive(Clone)]
6202pub struct EnumTypeDef {
6203 pub proc: Option<Arc<DaggerSessionProc>>,
6204 pub selection: Selection,
6205 pub graphql_client: DynGraphQLClient,
6206}
6207impl IntoID<Id> for EnumTypeDef {
6208 fn into_id(
6209 self,
6210 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6211 Box::pin(async move { self.id().await })
6212 }
6213}
6214impl Loadable for EnumTypeDef {
6215 fn graphql_type() -> &'static str {
6216 "EnumTypeDef"
6217 }
6218 fn from_query(
6219 proc: Option<Arc<DaggerSessionProc>>,
6220 selection: Selection,
6221 graphql_client: DynGraphQLClient,
6222 ) -> Self {
6223 Self {
6224 proc,
6225 selection,
6226 graphql_client,
6227 }
6228 }
6229}
6230impl EnumTypeDef {
6231 pub async fn description(&self) -> Result<String, DaggerError> {
6233 let query = self.selection.select("description");
6234 query.execute(self.graphql_client.clone()).await
6235 }
6236 pub async fn id(&self) -> Result<Id, DaggerError> {
6238 let query = self.selection.select("id");
6239 query.execute(self.graphql_client.clone()).await
6240 }
6241 pub async fn members(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6243 let query = self.selection.select("members");
6244 let query = query.select("id");
6245 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6246 Ok(ids
6247 .into_iter()
6248 .map(|id| EnumValueTypeDef {
6249 proc: self.proc.clone(),
6250 selection: crate::querybuilder::query()
6251 .select("node")
6252 .arg("id", &id.0)
6253 .inline_fragment("EnumValueTypeDef"),
6254 graphql_client: self.graphql_client.clone(),
6255 })
6256 .collect())
6257 }
6258 pub async fn name(&self) -> Result<String, DaggerError> {
6260 let query = self.selection.select("name");
6261 query.execute(self.graphql_client.clone()).await
6262 }
6263 pub fn source_map(&self) -> SourceMap {
6265 let query = self.selection.select("sourceMap");
6266 SourceMap {
6267 proc: self.proc.clone(),
6268 selection: query,
6269 graphql_client: self.graphql_client.clone(),
6270 }
6271 }
6272 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
6274 let query = self.selection.select("sourceModuleName");
6275 query.execute(self.graphql_client.clone()).await
6276 }
6277 pub async fn values(&self) -> Result<Vec<EnumValueTypeDef>, DaggerError> {
6279 let query = self.selection.select("values");
6280 let query = query.select("id");
6281 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6282 Ok(ids
6283 .into_iter()
6284 .map(|id| EnumValueTypeDef {
6285 proc: self.proc.clone(),
6286 selection: crate::querybuilder::query()
6287 .select("node")
6288 .arg("id", &id.0)
6289 .inline_fragment("EnumValueTypeDef"),
6290 graphql_client: self.graphql_client.clone(),
6291 })
6292 .collect())
6293 }
6294}
6295impl Node for EnumTypeDef {
6296 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6297 let query = self.selection.select("id");
6298 let graphql_client = self.graphql_client.clone();
6299 async move { query.execute(graphql_client).await }
6300 }
6301}
6302#[derive(Clone)]
6303pub struct EnumValueTypeDef {
6304 pub proc: Option<Arc<DaggerSessionProc>>,
6305 pub selection: Selection,
6306 pub graphql_client: DynGraphQLClient,
6307}
6308impl IntoID<Id> for EnumValueTypeDef {
6309 fn into_id(
6310 self,
6311 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6312 Box::pin(async move { self.id().await })
6313 }
6314}
6315impl Loadable for EnumValueTypeDef {
6316 fn graphql_type() -> &'static str {
6317 "EnumValueTypeDef"
6318 }
6319 fn from_query(
6320 proc: Option<Arc<DaggerSessionProc>>,
6321 selection: Selection,
6322 graphql_client: DynGraphQLClient,
6323 ) -> Self {
6324 Self {
6325 proc,
6326 selection,
6327 graphql_client,
6328 }
6329 }
6330}
6331impl EnumValueTypeDef {
6332 pub async fn deprecated(&self) -> Result<String, DaggerError> {
6334 let query = self.selection.select("deprecated");
6335 query.execute(self.graphql_client.clone()).await
6336 }
6337 pub async fn description(&self) -> Result<String, DaggerError> {
6339 let query = self.selection.select("description");
6340 query.execute(self.graphql_client.clone()).await
6341 }
6342 pub async fn id(&self) -> Result<Id, DaggerError> {
6344 let query = self.selection.select("id");
6345 query.execute(self.graphql_client.clone()).await
6346 }
6347 pub async fn name(&self) -> Result<String, DaggerError> {
6349 let query = self.selection.select("name");
6350 query.execute(self.graphql_client.clone()).await
6351 }
6352 pub fn source_map(&self) -> SourceMap {
6354 let query = self.selection.select("sourceMap");
6355 SourceMap {
6356 proc: self.proc.clone(),
6357 selection: query,
6358 graphql_client: self.graphql_client.clone(),
6359 }
6360 }
6361 pub async fn value(&self) -> Result<String, DaggerError> {
6363 let query = self.selection.select("value");
6364 query.execute(self.graphql_client.clone()).await
6365 }
6366}
6367impl Node for EnumValueTypeDef {
6368 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
6369 let query = self.selection.select("id");
6370 let graphql_client = self.graphql_client.clone();
6371 async move { query.execute(graphql_client).await }
6372 }
6373}
6374#[derive(Clone)]
6375pub struct Env {
6376 pub proc: Option<Arc<DaggerSessionProc>>,
6377 pub selection: Selection,
6378 pub graphql_client: DynGraphQLClient,
6379}
6380#[derive(Builder, Debug, PartialEq)]
6381pub struct EnvChecksOpts<'a> {
6382 #[builder(setter(into, strip_option), default)]
6384 pub include: Option<Vec<&'a str>>,
6385 #[builder(setter(into, strip_option), default)]
6387 pub no_generate: Option<bool>,
6388}
6389#[derive(Builder, Debug, PartialEq)]
6390pub struct EnvServicesOpts<'a> {
6391 #[builder(setter(into, strip_option), default)]
6393 pub include: Option<Vec<&'a str>>,
6394}
6395impl IntoID<Id> for Env {
6396 fn into_id(
6397 self,
6398 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
6399 Box::pin(async move { self.id().await })
6400 }
6401}
6402impl Loadable for Env {
6403 fn graphql_type() -> &'static str {
6404 "Env"
6405 }
6406 fn from_query(
6407 proc: Option<Arc<DaggerSessionProc>>,
6408 selection: Selection,
6409 graphql_client: DynGraphQLClient,
6410 ) -> Self {
6411 Self {
6412 proc,
6413 selection,
6414 graphql_client,
6415 }
6416 }
6417}
6418impl Env {
6419 pub fn check(&self, name: impl Into<String>) -> Check {
6425 let mut query = self.selection.select("check");
6426 query = query.arg("name", name.into());
6427 Check {
6428 proc: self.proc.clone(),
6429 selection: query,
6430 graphql_client: self.graphql_client.clone(),
6431 }
6432 }
6433 pub fn checks(&self) -> CheckGroup {
6439 let query = self.selection.select("checks");
6440 CheckGroup {
6441 proc: self.proc.clone(),
6442 selection: query,
6443 graphql_client: self.graphql_client.clone(),
6444 }
6445 }
6446 pub fn checks_opts<'a>(&self, opts: EnvChecksOpts<'a>) -> CheckGroup {
6452 let mut query = self.selection.select("checks");
6453 if let Some(include) = opts.include {
6454 query = query.arg("include", include);
6455 }
6456 if let Some(no_generate) = opts.no_generate {
6457 query = query.arg("noGenerate", no_generate);
6458 }
6459 CheckGroup {
6460 proc: self.proc.clone(),
6461 selection: query,
6462 graphql_client: self.graphql_client.clone(),
6463 }
6464 }
6465 pub async fn id(&self) -> Result<Id, DaggerError> {
6467 let query = self.selection.select("id");
6468 query.execute(self.graphql_client.clone()).await
6469 }
6470 pub fn input(&self, name: impl Into<String>) -> Binding {
6472 let mut query = self.selection.select("input");
6473 query = query.arg("name", name.into());
6474 Binding {
6475 proc: self.proc.clone(),
6476 selection: query,
6477 graphql_client: self.graphql_client.clone(),
6478 }
6479 }
6480 pub async fn inputs(&self) -> Result<Vec<Binding>, DaggerError> {
6482 let query = self.selection.select("inputs");
6483 let query = query.select("id");
6484 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6485 Ok(ids
6486 .into_iter()
6487 .map(|id| Binding {
6488 proc: self.proc.clone(),
6489 selection: crate::querybuilder::query()
6490 .select("node")
6491 .arg("id", &id.0)
6492 .inline_fragment("Binding"),
6493 graphql_client: self.graphql_client.clone(),
6494 })
6495 .collect())
6496 }
6497 pub fn output(&self, name: impl Into<String>) -> Binding {
6499 let mut query = self.selection.select("output");
6500 query = query.arg("name", name.into());
6501 Binding {
6502 proc: self.proc.clone(),
6503 selection: query,
6504 graphql_client: self.graphql_client.clone(),
6505 }
6506 }
6507 pub async fn outputs(&self) -> Result<Vec<Binding>, DaggerError> {
6509 let query = self.selection.select("outputs");
6510 let query = query.select("id");
6511 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
6512 Ok(ids
6513 .into_iter()
6514 .map(|id| Binding {
6515 proc: self.proc.clone(),
6516 selection: crate::querybuilder::query()
6517 .select("node")
6518 .arg("id", &id.0)
6519 .inline_fragment("Binding"),
6520 graphql_client: self.graphql_client.clone(),
6521 })
6522 .collect())
6523 }
6524 pub fn services(&self) -> UpGroup {
6530 let query = self.selection.select("services");
6531 UpGroup {
6532 proc: self.proc.clone(),
6533 selection: query,
6534 graphql_client: self.graphql_client.clone(),
6535 }
6536 }
6537 pub fn services_opts<'a>(&self, opts: EnvServicesOpts<'a>) -> UpGroup {
6543 let mut query = self.selection.select("services");
6544 if let Some(include) = opts.include {
6545 query = query.arg("include", include);
6546 }
6547 UpGroup {
6548 proc: self.proc.clone(),
6549 selection: query,
6550 graphql_client: self.graphql_client.clone(),
6551 }
6552 }
6553 pub fn with_address_input(
6561 &self,
6562 name: impl Into<String>,
6563 value: impl IntoID<Id>,
6564 description: impl Into<String>,
6565 ) -> Env {
6566 let mut query = self.selection.select("withAddressInput");
6567 query = query.arg("name", name.into());
6568 query = query.arg_lazy(
6569 "value",
6570 Box::new(move || {
6571 let value = value.clone();
6572 Box::pin(async move { value.into_id().await.unwrap().quote() })
6573 }),
6574 );
6575 query = query.arg("description", description.into());
6576 Env {
6577 proc: self.proc.clone(),
6578 selection: query,
6579 graphql_client: self.graphql_client.clone(),
6580 }
6581 }
6582 pub fn with_address_output(
6589 &self,
6590 name: impl Into<String>,
6591 description: impl Into<String>,
6592 ) -> Env {
6593 let mut query = self.selection.select("withAddressOutput");
6594 query = query.arg("name", name.into());
6595 query = query.arg("description", description.into());
6596 Env {
6597 proc: self.proc.clone(),
6598 selection: query,
6599 graphql_client: self.graphql_client.clone(),
6600 }
6601 }
6602 pub fn with_cache_volume_input(
6610 &self,
6611 name: impl Into<String>,
6612 value: impl IntoID<Id>,
6613 description: impl Into<String>,
6614 ) -> Env {
6615 let mut query = self.selection.select("withCacheVolumeInput");
6616 query = query.arg("name", name.into());
6617 query = query.arg_lazy(
6618 "value",
6619 Box::new(move || {
6620 let value = value.clone();
6621 Box::pin(async move { value.into_id().await.unwrap().quote() })
6622 }),
6623 );
6624 query = query.arg("description", description.into());
6625 Env {
6626 proc: self.proc.clone(),
6627 selection: query,
6628 graphql_client: self.graphql_client.clone(),
6629 }
6630 }
6631 pub fn with_cache_volume_output(
6638 &self,
6639 name: impl Into<String>,
6640 description: impl Into<String>,
6641 ) -> Env {
6642 let mut query = self.selection.select("withCacheVolumeOutput");
6643 query = query.arg("name", name.into());
6644 query = query.arg("description", description.into());
6645 Env {
6646 proc: self.proc.clone(),
6647 selection: query,
6648 graphql_client: self.graphql_client.clone(),
6649 }
6650 }
6651 pub fn with_changeset_input(
6659 &self,
6660 name: impl Into<String>,
6661 value: impl IntoID<Id>,
6662 description: impl Into<String>,
6663 ) -> Env {
6664 let mut query = self.selection.select("withChangesetInput");
6665 query = query.arg("name", name.into());
6666 query = query.arg_lazy(
6667 "value",
6668 Box::new(move || {
6669 let value = value.clone();
6670 Box::pin(async move { value.into_id().await.unwrap().quote() })
6671 }),
6672 );
6673 query = query.arg("description", description.into());
6674 Env {
6675 proc: self.proc.clone(),
6676 selection: query,
6677 graphql_client: self.graphql_client.clone(),
6678 }
6679 }
6680 pub fn with_changeset_output(
6687 &self,
6688 name: impl Into<String>,
6689 description: impl Into<String>,
6690 ) -> Env {
6691 let mut query = self.selection.select("withChangesetOutput");
6692 query = query.arg("name", name.into());
6693 query = query.arg("description", description.into());
6694 Env {
6695 proc: self.proc.clone(),
6696 selection: query,
6697 graphql_client: self.graphql_client.clone(),
6698 }
6699 }
6700 pub fn with_check_group_input(
6708 &self,
6709 name: impl Into<String>,
6710 value: impl IntoID<Id>,
6711 description: impl Into<String>,
6712 ) -> Env {
6713 let mut query = self.selection.select("withCheckGroupInput");
6714 query = query.arg("name", name.into());
6715 query = query.arg_lazy(
6716 "value",
6717 Box::new(move || {
6718 let value = value.clone();
6719 Box::pin(async move { value.into_id().await.unwrap().quote() })
6720 }),
6721 );
6722 query = query.arg("description", description.into());
6723 Env {
6724 proc: self.proc.clone(),
6725 selection: query,
6726 graphql_client: self.graphql_client.clone(),
6727 }
6728 }
6729 pub fn with_check_group_output(
6736 &self,
6737 name: impl Into<String>,
6738 description: impl Into<String>,
6739 ) -> Env {
6740 let mut query = self.selection.select("withCheckGroupOutput");
6741 query = query.arg("name", name.into());
6742 query = query.arg("description", description.into());
6743 Env {
6744 proc: self.proc.clone(),
6745 selection: query,
6746 graphql_client: self.graphql_client.clone(),
6747 }
6748 }
6749 pub fn with_check_input(
6757 &self,
6758 name: impl Into<String>,
6759 value: impl IntoID<Id>,
6760 description: impl Into<String>,
6761 ) -> Env {
6762 let mut query = self.selection.select("withCheckInput");
6763 query = query.arg("name", name.into());
6764 query = query.arg_lazy(
6765 "value",
6766 Box::new(move || {
6767 let value = value.clone();
6768 Box::pin(async move { value.into_id().await.unwrap().quote() })
6769 }),
6770 );
6771 query = query.arg("description", description.into());
6772 Env {
6773 proc: self.proc.clone(),
6774 selection: query,
6775 graphql_client: self.graphql_client.clone(),
6776 }
6777 }
6778 pub fn with_check_output(
6785 &self,
6786 name: impl Into<String>,
6787 description: impl Into<String>,
6788 ) -> Env {
6789 let mut query = self.selection.select("withCheckOutput");
6790 query = query.arg("name", name.into());
6791 query = query.arg("description", description.into());
6792 Env {
6793 proc: self.proc.clone(),
6794 selection: query,
6795 graphql_client: self.graphql_client.clone(),
6796 }
6797 }
6798 pub fn with_cloud_input(
6806 &self,
6807 name: impl Into<String>,
6808 value: impl IntoID<Id>,
6809 description: impl Into<String>,
6810 ) -> Env {
6811 let mut query = self.selection.select("withCloudInput");
6812 query = query.arg("name", name.into());
6813 query = query.arg_lazy(
6814 "value",
6815 Box::new(move || {
6816 let value = value.clone();
6817 Box::pin(async move { value.into_id().await.unwrap().quote() })
6818 }),
6819 );
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_cloud_output(
6834 &self,
6835 name: impl Into<String>,
6836 description: impl Into<String>,
6837 ) -> Env {
6838 let mut query = self.selection.select("withCloudOutput");
6839 query = query.arg("name", name.into());
6840 query = query.arg("description", description.into());
6841 Env {
6842 proc: self.proc.clone(),
6843 selection: query,
6844 graphql_client: self.graphql_client.clone(),
6845 }
6846 }
6847 pub fn with_container_input(
6855 &self,
6856 name: impl Into<String>,
6857 value: impl IntoID<Id>,
6858 description: impl Into<String>,
6859 ) -> Env {
6860 let mut query = self.selection.select("withContainerInput");
6861 query = query.arg("name", name.into());
6862 query = query.arg_lazy(
6863 "value",
6864 Box::new(move || {
6865 let value = value.clone();
6866 Box::pin(async move { value.into_id().await.unwrap().quote() })
6867 }),
6868 );
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_container_output(
6883 &self,
6884 name: impl Into<String>,
6885 description: impl Into<String>,
6886 ) -> Env {
6887 let mut query = self.selection.select("withContainerOutput");
6888 query = query.arg("name", name.into());
6889 query = query.arg("description", description.into());
6890 Env {
6891 proc: self.proc.clone(),
6892 selection: query,
6893 graphql_client: self.graphql_client.clone(),
6894 }
6895 }
6896 pub fn with_current_module(&self) -> Env {
6899 let query = self.selection.select("withCurrentModule");
6900 Env {
6901 proc: self.proc.clone(),
6902 selection: query,
6903 graphql_client: self.graphql_client.clone(),
6904 }
6905 }
6906 pub fn with_diff_stat_input(
6914 &self,
6915 name: impl Into<String>,
6916 value: impl IntoID<Id>,
6917 description: impl Into<String>,
6918 ) -> Env {
6919 let mut query = self.selection.select("withDiffStatInput");
6920 query = query.arg("name", name.into());
6921 query = query.arg_lazy(
6922 "value",
6923 Box::new(move || {
6924 let value = value.clone();
6925 Box::pin(async move { value.into_id().await.unwrap().quote() })
6926 }),
6927 );
6928 query = query.arg("description", description.into());
6929 Env {
6930 proc: self.proc.clone(),
6931 selection: query,
6932 graphql_client: self.graphql_client.clone(),
6933 }
6934 }
6935 pub fn with_diff_stat_output(
6942 &self,
6943 name: impl Into<String>,
6944 description: impl Into<String>,
6945 ) -> Env {
6946 let mut query = self.selection.select("withDiffStatOutput");
6947 query = query.arg("name", name.into());
6948 query = query.arg("description", description.into());
6949 Env {
6950 proc: self.proc.clone(),
6951 selection: query,
6952 graphql_client: self.graphql_client.clone(),
6953 }
6954 }
6955 pub fn with_directory_input(
6963 &self,
6964 name: impl Into<String>,
6965 value: impl IntoID<Id>,
6966 description: impl Into<String>,
6967 ) -> Env {
6968 let mut query = self.selection.select("withDirectoryInput");
6969 query = query.arg("name", name.into());
6970 query = query.arg_lazy(
6971 "value",
6972 Box::new(move || {
6973 let value = value.clone();
6974 Box::pin(async move { value.into_id().await.unwrap().quote() })
6975 }),
6976 );
6977 query = query.arg("description", description.into());
6978 Env {
6979 proc: self.proc.clone(),
6980 selection: query,
6981 graphql_client: self.graphql_client.clone(),
6982 }
6983 }
6984 pub fn with_directory_output(
6991 &self,
6992 name: impl Into<String>,
6993 description: impl Into<String>,
6994 ) -> Env {
6995 let mut query = self.selection.select("withDirectoryOutput");
6996 query = query.arg("name", name.into());
6997 query = query.arg("description", description.into());
6998 Env {
6999 proc: self.proc.clone(),
7000 selection: query,
7001 graphql_client: self.graphql_client.clone(),
7002 }
7003 }
7004 pub fn with_env_file_input(
7012 &self,
7013 name: impl Into<String>,
7014 value: impl IntoID<Id>,
7015 description: impl Into<String>,
7016 ) -> Env {
7017 let mut query = self.selection.select("withEnvFileInput");
7018 query = query.arg("name", name.into());
7019 query = query.arg_lazy(
7020 "value",
7021 Box::new(move || {
7022 let value = value.clone();
7023 Box::pin(async move { value.into_id().await.unwrap().quote() })
7024 }),
7025 );
7026 query = query.arg("description", description.into());
7027 Env {
7028 proc: self.proc.clone(),
7029 selection: query,
7030 graphql_client: self.graphql_client.clone(),
7031 }
7032 }
7033 pub fn with_env_file_output(
7040 &self,
7041 name: impl Into<String>,
7042 description: impl Into<String>,
7043 ) -> Env {
7044 let mut query = self.selection.select("withEnvFileOutput");
7045 query = query.arg("name", name.into());
7046 query = query.arg("description", description.into());
7047 Env {
7048 proc: self.proc.clone(),
7049 selection: query,
7050 graphql_client: self.graphql_client.clone(),
7051 }
7052 }
7053 pub fn with_env_input(
7061 &self,
7062 name: impl Into<String>,
7063 value: impl IntoID<Id>,
7064 description: impl Into<String>,
7065 ) -> Env {
7066 let mut query = self.selection.select("withEnvInput");
7067 query = query.arg("name", name.into());
7068 query = query.arg_lazy(
7069 "value",
7070 Box::new(move || {
7071 let value = value.clone();
7072 Box::pin(async move { value.into_id().await.unwrap().quote() })
7073 }),
7074 );
7075 query = query.arg("description", description.into());
7076 Env {
7077 proc: self.proc.clone(),
7078 selection: query,
7079 graphql_client: self.graphql_client.clone(),
7080 }
7081 }
7082 pub fn with_env_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7089 let mut query = self.selection.select("withEnvOutput");
7090 query = query.arg("name", name.into());
7091 query = query.arg("description", description.into());
7092 Env {
7093 proc: self.proc.clone(),
7094 selection: query,
7095 graphql_client: self.graphql_client.clone(),
7096 }
7097 }
7098 pub fn with_file_input(
7106 &self,
7107 name: impl Into<String>,
7108 value: impl IntoID<Id>,
7109 description: impl Into<String>,
7110 ) -> Env {
7111 let mut query = self.selection.select("withFileInput");
7112 query = query.arg("name", name.into());
7113 query = query.arg_lazy(
7114 "value",
7115 Box::new(move || {
7116 let value = value.clone();
7117 Box::pin(async move { value.into_id().await.unwrap().quote() })
7118 }),
7119 );
7120 query = query.arg("description", description.into());
7121 Env {
7122 proc: self.proc.clone(),
7123 selection: query,
7124 graphql_client: self.graphql_client.clone(),
7125 }
7126 }
7127 pub fn with_file_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7134 let mut query = self.selection.select("withFileOutput");
7135 query = query.arg("name", name.into());
7136 query = query.arg("description", description.into());
7137 Env {
7138 proc: self.proc.clone(),
7139 selection: query,
7140 graphql_client: self.graphql_client.clone(),
7141 }
7142 }
7143 pub fn with_generator_group_input(
7151 &self,
7152 name: impl Into<String>,
7153 value: impl IntoID<Id>,
7154 description: impl Into<String>,
7155 ) -> Env {
7156 let mut query = self.selection.select("withGeneratorGroupInput");
7157 query = query.arg("name", name.into());
7158 query = query.arg_lazy(
7159 "value",
7160 Box::new(move || {
7161 let value = value.clone();
7162 Box::pin(async move { value.into_id().await.unwrap().quote() })
7163 }),
7164 );
7165 query = query.arg("description", description.into());
7166 Env {
7167 proc: self.proc.clone(),
7168 selection: query,
7169 graphql_client: self.graphql_client.clone(),
7170 }
7171 }
7172 pub fn with_generator_group_output(
7179 &self,
7180 name: impl Into<String>,
7181 description: impl Into<String>,
7182 ) -> Env {
7183 let mut query = self.selection.select("withGeneratorGroupOutput");
7184 query = query.arg("name", name.into());
7185 query = query.arg("description", description.into());
7186 Env {
7187 proc: self.proc.clone(),
7188 selection: query,
7189 graphql_client: self.graphql_client.clone(),
7190 }
7191 }
7192 pub fn with_generator_input(
7200 &self,
7201 name: impl Into<String>,
7202 value: impl IntoID<Id>,
7203 description: impl Into<String>,
7204 ) -> Env {
7205 let mut query = self.selection.select("withGeneratorInput");
7206 query = query.arg("name", name.into());
7207 query = query.arg_lazy(
7208 "value",
7209 Box::new(move || {
7210 let value = value.clone();
7211 Box::pin(async move { value.into_id().await.unwrap().quote() })
7212 }),
7213 );
7214 query = query.arg("description", description.into());
7215 Env {
7216 proc: self.proc.clone(),
7217 selection: query,
7218 graphql_client: self.graphql_client.clone(),
7219 }
7220 }
7221 pub fn with_generator_output(
7228 &self,
7229 name: impl Into<String>,
7230 description: impl Into<String>,
7231 ) -> Env {
7232 let mut query = self.selection.select("withGeneratorOutput");
7233 query = query.arg("name", name.into());
7234 query = query.arg("description", description.into());
7235 Env {
7236 proc: self.proc.clone(),
7237 selection: query,
7238 graphql_client: self.graphql_client.clone(),
7239 }
7240 }
7241 pub fn with_git_ref_input(
7249 &self,
7250 name: impl Into<String>,
7251 value: impl IntoID<Id>,
7252 description: impl Into<String>,
7253 ) -> Env {
7254 let mut query = self.selection.select("withGitRefInput");
7255 query = query.arg("name", name.into());
7256 query = query.arg_lazy(
7257 "value",
7258 Box::new(move || {
7259 let value = value.clone();
7260 Box::pin(async move { value.into_id().await.unwrap().quote() })
7261 }),
7262 );
7263 query = query.arg("description", description.into());
7264 Env {
7265 proc: self.proc.clone(),
7266 selection: query,
7267 graphql_client: self.graphql_client.clone(),
7268 }
7269 }
7270 pub fn with_git_ref_output(
7277 &self,
7278 name: impl Into<String>,
7279 description: impl Into<String>,
7280 ) -> Env {
7281 let mut query = self.selection.select("withGitRefOutput");
7282 query = query.arg("name", name.into());
7283 query = query.arg("description", description.into());
7284 Env {
7285 proc: self.proc.clone(),
7286 selection: query,
7287 graphql_client: self.graphql_client.clone(),
7288 }
7289 }
7290 pub fn with_git_repository_input(
7298 &self,
7299 name: impl Into<String>,
7300 value: impl IntoID<Id>,
7301 description: impl Into<String>,
7302 ) -> Env {
7303 let mut query = self.selection.select("withGitRepositoryInput");
7304 query = query.arg("name", name.into());
7305 query = query.arg_lazy(
7306 "value",
7307 Box::new(move || {
7308 let value = value.clone();
7309 Box::pin(async move { value.into_id().await.unwrap().quote() })
7310 }),
7311 );
7312 query = query.arg("description", description.into());
7313 Env {
7314 proc: self.proc.clone(),
7315 selection: query,
7316 graphql_client: self.graphql_client.clone(),
7317 }
7318 }
7319 pub fn with_git_repository_output(
7326 &self,
7327 name: impl Into<String>,
7328 description: impl Into<String>,
7329 ) -> Env {
7330 let mut query = self.selection.select("withGitRepositoryOutput");
7331 query = query.arg("name", name.into());
7332 query = query.arg("description", description.into());
7333 Env {
7334 proc: self.proc.clone(),
7335 selection: query,
7336 graphql_client: self.graphql_client.clone(),
7337 }
7338 }
7339 pub fn with_http_state_input(
7347 &self,
7348 name: impl Into<String>,
7349 value: impl IntoID<Id>,
7350 description: impl Into<String>,
7351 ) -> Env {
7352 let mut query = self.selection.select("withHTTPStateInput");
7353 query = query.arg("name", name.into());
7354 query = query.arg_lazy(
7355 "value",
7356 Box::new(move || {
7357 let value = value.clone();
7358 Box::pin(async move { value.into_id().await.unwrap().quote() })
7359 }),
7360 );
7361 query = query.arg("description", description.into());
7362 Env {
7363 proc: self.proc.clone(),
7364 selection: query,
7365 graphql_client: self.graphql_client.clone(),
7366 }
7367 }
7368 pub fn with_http_state_output(
7375 &self,
7376 name: impl Into<String>,
7377 description: impl Into<String>,
7378 ) -> Env {
7379 let mut query = self.selection.select("withHTTPStateOutput");
7380 query = query.arg("name", name.into());
7381 query = query.arg("description", description.into());
7382 Env {
7383 proc: self.proc.clone(),
7384 selection: query,
7385 graphql_client: self.graphql_client.clone(),
7386 }
7387 }
7388 pub fn with_json_value_input(
7396 &self,
7397 name: impl Into<String>,
7398 value: impl IntoID<Id>,
7399 description: impl Into<String>,
7400 ) -> Env {
7401 let mut query = self.selection.select("withJSONValueInput");
7402 query = query.arg("name", name.into());
7403 query = query.arg_lazy(
7404 "value",
7405 Box::new(move || {
7406 let value = value.clone();
7407 Box::pin(async move { value.into_id().await.unwrap().quote() })
7408 }),
7409 );
7410 query = query.arg("description", description.into());
7411 Env {
7412 proc: self.proc.clone(),
7413 selection: query,
7414 graphql_client: self.graphql_client.clone(),
7415 }
7416 }
7417 pub fn with_json_value_output(
7424 &self,
7425 name: impl Into<String>,
7426 description: impl Into<String>,
7427 ) -> Env {
7428 let mut query = self.selection.select("withJSONValueOutput");
7429 query = query.arg("name", name.into());
7430 query = query.arg("description", description.into());
7431 Env {
7432 proc: self.proc.clone(),
7433 selection: query,
7434 graphql_client: self.graphql_client.clone(),
7435 }
7436 }
7437 pub fn with_main_module(&self, module: impl IntoID<Id>) -> Env {
7440 let mut query = self.selection.select("withMainModule");
7441 query = query.arg_lazy(
7442 "module",
7443 Box::new(move || {
7444 let module = module.clone();
7445 Box::pin(async move { module.into_id().await.unwrap().quote() })
7446 }),
7447 );
7448 Env {
7449 proc: self.proc.clone(),
7450 selection: query,
7451 graphql_client: self.graphql_client.clone(),
7452 }
7453 }
7454 pub fn with_module(&self, module: impl IntoID<Id>) -> Env {
7457 let mut query = self.selection.select("withModule");
7458 query = query.arg_lazy(
7459 "module",
7460 Box::new(move || {
7461 let module = module.clone();
7462 Box::pin(async move { module.into_id().await.unwrap().quote() })
7463 }),
7464 );
7465 Env {
7466 proc: self.proc.clone(),
7467 selection: query,
7468 graphql_client: self.graphql_client.clone(),
7469 }
7470 }
7471 pub fn with_module_config_client_input(
7479 &self,
7480 name: impl Into<String>,
7481 value: impl IntoID<Id>,
7482 description: impl Into<String>,
7483 ) -> Env {
7484 let mut query = self.selection.select("withModuleConfigClientInput");
7485 query = query.arg("name", name.into());
7486 query = query.arg_lazy(
7487 "value",
7488 Box::new(move || {
7489 let value = value.clone();
7490 Box::pin(async move { value.into_id().await.unwrap().quote() })
7491 }),
7492 );
7493 query = query.arg("description", description.into());
7494 Env {
7495 proc: self.proc.clone(),
7496 selection: query,
7497 graphql_client: self.graphql_client.clone(),
7498 }
7499 }
7500 pub fn with_module_config_client_output(
7507 &self,
7508 name: impl Into<String>,
7509 description: impl Into<String>,
7510 ) -> Env {
7511 let mut query = self.selection.select("withModuleConfigClientOutput");
7512 query = query.arg("name", name.into());
7513 query = query.arg("description", description.into());
7514 Env {
7515 proc: self.proc.clone(),
7516 selection: query,
7517 graphql_client: self.graphql_client.clone(),
7518 }
7519 }
7520 pub fn with_module_input(
7528 &self,
7529 name: impl Into<String>,
7530 value: impl IntoID<Id>,
7531 description: impl Into<String>,
7532 ) -> Env {
7533 let mut query = self.selection.select("withModuleInput");
7534 query = query.arg("name", name.into());
7535 query = query.arg_lazy(
7536 "value",
7537 Box::new(move || {
7538 let value = value.clone();
7539 Box::pin(async move { value.into_id().await.unwrap().quote() })
7540 }),
7541 );
7542 query = query.arg("description", description.into());
7543 Env {
7544 proc: self.proc.clone(),
7545 selection: query,
7546 graphql_client: self.graphql_client.clone(),
7547 }
7548 }
7549 pub fn with_module_output(
7556 &self,
7557 name: impl Into<String>,
7558 description: impl Into<String>,
7559 ) -> Env {
7560 let mut query = self.selection.select("withModuleOutput");
7561 query = query.arg("name", name.into());
7562 query = query.arg("description", description.into());
7563 Env {
7564 proc: self.proc.clone(),
7565 selection: query,
7566 graphql_client: self.graphql_client.clone(),
7567 }
7568 }
7569 pub fn with_module_source_input(
7577 &self,
7578 name: impl Into<String>,
7579 value: impl IntoID<Id>,
7580 description: impl Into<String>,
7581 ) -> Env {
7582 let mut query = self.selection.select("withModuleSourceInput");
7583 query = query.arg("name", name.into());
7584 query = query.arg_lazy(
7585 "value",
7586 Box::new(move || {
7587 let value = value.clone();
7588 Box::pin(async move { value.into_id().await.unwrap().quote() })
7589 }),
7590 );
7591 query = query.arg("description", description.into());
7592 Env {
7593 proc: self.proc.clone(),
7594 selection: query,
7595 graphql_client: self.graphql_client.clone(),
7596 }
7597 }
7598 pub fn with_module_source_output(
7605 &self,
7606 name: impl Into<String>,
7607 description: impl Into<String>,
7608 ) -> Env {
7609 let mut query = self.selection.select("withModuleSourceOutput");
7610 query = query.arg("name", name.into());
7611 query = query.arg("description", description.into());
7612 Env {
7613 proc: self.proc.clone(),
7614 selection: query,
7615 graphql_client: self.graphql_client.clone(),
7616 }
7617 }
7618 pub fn with_search_result_input(
7626 &self,
7627 name: impl Into<String>,
7628 value: impl IntoID<Id>,
7629 description: impl Into<String>,
7630 ) -> Env {
7631 let mut query = self.selection.select("withSearchResultInput");
7632 query = query.arg("name", name.into());
7633 query = query.arg_lazy(
7634 "value",
7635 Box::new(move || {
7636 let value = value.clone();
7637 Box::pin(async move { value.into_id().await.unwrap().quote() })
7638 }),
7639 );
7640 query = query.arg("description", description.into());
7641 Env {
7642 proc: self.proc.clone(),
7643 selection: query,
7644 graphql_client: self.graphql_client.clone(),
7645 }
7646 }
7647 pub fn with_search_result_output(
7654 &self,
7655 name: impl Into<String>,
7656 description: impl Into<String>,
7657 ) -> Env {
7658 let mut query = self.selection.select("withSearchResultOutput");
7659 query = query.arg("name", name.into());
7660 query = query.arg("description", description.into());
7661 Env {
7662 proc: self.proc.clone(),
7663 selection: query,
7664 graphql_client: self.graphql_client.clone(),
7665 }
7666 }
7667 pub fn with_search_submatch_input(
7675 &self,
7676 name: impl Into<String>,
7677 value: impl IntoID<Id>,
7678 description: impl Into<String>,
7679 ) -> Env {
7680 let mut query = self.selection.select("withSearchSubmatchInput");
7681 query = query.arg("name", name.into());
7682 query = query.arg_lazy(
7683 "value",
7684 Box::new(move || {
7685 let value = value.clone();
7686 Box::pin(async move { value.into_id().await.unwrap().quote() })
7687 }),
7688 );
7689 query = query.arg("description", description.into());
7690 Env {
7691 proc: self.proc.clone(),
7692 selection: query,
7693 graphql_client: self.graphql_client.clone(),
7694 }
7695 }
7696 pub fn with_search_submatch_output(
7703 &self,
7704 name: impl Into<String>,
7705 description: impl Into<String>,
7706 ) -> Env {
7707 let mut query = self.selection.select("withSearchSubmatchOutput");
7708 query = query.arg("name", name.into());
7709 query = query.arg("description", description.into());
7710 Env {
7711 proc: self.proc.clone(),
7712 selection: query,
7713 graphql_client: self.graphql_client.clone(),
7714 }
7715 }
7716 pub fn with_secret_input(
7724 &self,
7725 name: impl Into<String>,
7726 value: impl IntoID<Id>,
7727 description: impl Into<String>,
7728 ) -> Env {
7729 let mut query = self.selection.select("withSecretInput");
7730 query = query.arg("name", name.into());
7731 query = query.arg_lazy(
7732 "value",
7733 Box::new(move || {
7734 let value = value.clone();
7735 Box::pin(async move { value.into_id().await.unwrap().quote() })
7736 }),
7737 );
7738 query = query.arg("description", description.into());
7739 Env {
7740 proc: self.proc.clone(),
7741 selection: query,
7742 graphql_client: self.graphql_client.clone(),
7743 }
7744 }
7745 pub fn with_secret_output(
7752 &self,
7753 name: impl Into<String>,
7754 description: impl Into<String>,
7755 ) -> Env {
7756 let mut query = self.selection.select("withSecretOutput");
7757 query = query.arg("name", name.into());
7758 query = query.arg("description", description.into());
7759 Env {
7760 proc: self.proc.clone(),
7761 selection: query,
7762 graphql_client: self.graphql_client.clone(),
7763 }
7764 }
7765 pub fn with_service_input(
7773 &self,
7774 name: impl Into<String>,
7775 value: impl IntoID<Id>,
7776 description: impl Into<String>,
7777 ) -> Env {
7778 let mut query = self.selection.select("withServiceInput");
7779 query = query.arg("name", name.into());
7780 query = query.arg_lazy(
7781 "value",
7782 Box::new(move || {
7783 let value = value.clone();
7784 Box::pin(async move { value.into_id().await.unwrap().quote() })
7785 }),
7786 );
7787 query = query.arg("description", description.into());
7788 Env {
7789 proc: self.proc.clone(),
7790 selection: query,
7791 graphql_client: self.graphql_client.clone(),
7792 }
7793 }
7794 pub fn with_service_output(
7801 &self,
7802 name: impl Into<String>,
7803 description: impl Into<String>,
7804 ) -> Env {
7805 let mut query = self.selection.select("withServiceOutput");
7806 query = query.arg("name", name.into());
7807 query = query.arg("description", description.into());
7808 Env {
7809 proc: self.proc.clone(),
7810 selection: query,
7811 graphql_client: self.graphql_client.clone(),
7812 }
7813 }
7814 pub fn with_socket_input(
7822 &self,
7823 name: impl Into<String>,
7824 value: impl IntoID<Id>,
7825 description: impl Into<String>,
7826 ) -> Env {
7827 let mut query = self.selection.select("withSocketInput");
7828 query = query.arg("name", name.into());
7829 query = query.arg_lazy(
7830 "value",
7831 Box::new(move || {
7832 let value = value.clone();
7833 Box::pin(async move { value.into_id().await.unwrap().quote() })
7834 }),
7835 );
7836 query = query.arg("description", description.into());
7837 Env {
7838 proc: self.proc.clone(),
7839 selection: query,
7840 graphql_client: self.graphql_client.clone(),
7841 }
7842 }
7843 pub fn with_socket_output(
7850 &self,
7851 name: impl Into<String>,
7852 description: impl Into<String>,
7853 ) -> Env {
7854 let mut query = self.selection.select("withSocketOutput");
7855 query = query.arg("name", name.into());
7856 query = query.arg("description", description.into());
7857 Env {
7858 proc: self.proc.clone(),
7859 selection: query,
7860 graphql_client: self.graphql_client.clone(),
7861 }
7862 }
7863 pub fn with_stat_input(
7871 &self,
7872 name: impl Into<String>,
7873 value: impl IntoID<Id>,
7874 description: impl Into<String>,
7875 ) -> Env {
7876 let mut query = self.selection.select("withStatInput");
7877 query = query.arg("name", name.into());
7878 query = query.arg_lazy(
7879 "value",
7880 Box::new(move || {
7881 let value = value.clone();
7882 Box::pin(async move { value.into_id().await.unwrap().quote() })
7883 }),
7884 );
7885 query = query.arg("description", description.into());
7886 Env {
7887 proc: self.proc.clone(),
7888 selection: query,
7889 graphql_client: self.graphql_client.clone(),
7890 }
7891 }
7892 pub fn with_stat_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
7899 let mut query = self.selection.select("withStatOutput");
7900 query = query.arg("name", name.into());
7901 query = query.arg("description", description.into());
7902 Env {
7903 proc: self.proc.clone(),
7904 selection: query,
7905 graphql_client: self.graphql_client.clone(),
7906 }
7907 }
7908 pub fn with_string_input(
7916 &self,
7917 name: impl Into<String>,
7918 value: impl Into<String>,
7919 description: impl Into<String>,
7920 ) -> Env {
7921 let mut query = self.selection.select("withStringInput");
7922 query = query.arg("name", name.into());
7923 query = query.arg("value", value.into());
7924 query = query.arg("description", description.into());
7925 Env {
7926 proc: self.proc.clone(),
7927 selection: query,
7928 graphql_client: self.graphql_client.clone(),
7929 }
7930 }
7931 pub fn with_string_output(
7938 &self,
7939 name: impl Into<String>,
7940 description: impl Into<String>,
7941 ) -> Env {
7942 let mut query = self.selection.select("withStringOutput");
7943 query = query.arg("name", name.into());
7944 query = query.arg("description", description.into());
7945 Env {
7946 proc: self.proc.clone(),
7947 selection: query,
7948 graphql_client: self.graphql_client.clone(),
7949 }
7950 }
7951 pub fn with_up_group_input(
7959 &self,
7960 name: impl Into<String>,
7961 value: impl IntoID<Id>,
7962 description: impl Into<String>,
7963 ) -> Env {
7964 let mut query = self.selection.select("withUpGroupInput");
7965 query = query.arg("name", name.into());
7966 query = query.arg_lazy(
7967 "value",
7968 Box::new(move || {
7969 let value = value.clone();
7970 Box::pin(async move { value.into_id().await.unwrap().quote() })
7971 }),
7972 );
7973 query = query.arg("description", description.into());
7974 Env {
7975 proc: self.proc.clone(),
7976 selection: query,
7977 graphql_client: self.graphql_client.clone(),
7978 }
7979 }
7980 pub fn with_up_group_output(
7987 &self,
7988 name: impl Into<String>,
7989 description: impl Into<String>,
7990 ) -> Env {
7991 let mut query = self.selection.select("withUpGroupOutput");
7992 query = query.arg("name", name.into());
7993 query = query.arg("description", description.into());
7994 Env {
7995 proc: self.proc.clone(),
7996 selection: query,
7997 graphql_client: self.graphql_client.clone(),
7998 }
7999 }
8000 pub fn with_up_input(
8008 &self,
8009 name: impl Into<String>,
8010 value: impl IntoID<Id>,
8011 description: impl Into<String>,
8012 ) -> Env {
8013 let mut query = self.selection.select("withUpInput");
8014 query = query.arg("name", name.into());
8015 query = query.arg_lazy(
8016 "value",
8017 Box::new(move || {
8018 let value = value.clone();
8019 Box::pin(async move { value.into_id().await.unwrap().quote() })
8020 }),
8021 );
8022 query = query.arg("description", description.into());
8023 Env {
8024 proc: self.proc.clone(),
8025 selection: query,
8026 graphql_client: self.graphql_client.clone(),
8027 }
8028 }
8029 pub fn with_up_output(&self, name: impl Into<String>, description: impl Into<String>) -> Env {
8036 let mut query = self.selection.select("withUpOutput");
8037 query = query.arg("name", name.into());
8038 query = query.arg("description", description.into());
8039 Env {
8040 proc: self.proc.clone(),
8041 selection: query,
8042 graphql_client: self.graphql_client.clone(),
8043 }
8044 }
8045 pub fn with_volume_input(
8053 &self,
8054 name: impl Into<String>,
8055 value: impl IntoID<Id>,
8056 description: impl Into<String>,
8057 ) -> Env {
8058 let mut query = self.selection.select("withVolumeInput");
8059 query = query.arg("name", name.into());
8060 query = query.arg_lazy(
8061 "value",
8062 Box::new(move || {
8063 let value = value.clone();
8064 Box::pin(async move { value.into_id().await.unwrap().quote() })
8065 }),
8066 );
8067 query = query.arg("description", description.into());
8068 Env {
8069 proc: self.proc.clone(),
8070 selection: query,
8071 graphql_client: self.graphql_client.clone(),
8072 }
8073 }
8074 pub fn with_volume_output(
8081 &self,
8082 name: impl Into<String>,
8083 description: impl Into<String>,
8084 ) -> Env {
8085 let mut query = self.selection.select("withVolumeOutput");
8086 query = query.arg("name", name.into());
8087 query = query.arg("description", description.into());
8088 Env {
8089 proc: self.proc.clone(),
8090 selection: query,
8091 graphql_client: self.graphql_client.clone(),
8092 }
8093 }
8094 pub fn with_workspace(&self, workspace: impl IntoID<Id>) -> Env {
8100 let mut query = self.selection.select("withWorkspace");
8101 query = query.arg_lazy(
8102 "workspace",
8103 Box::new(move || {
8104 let workspace = workspace.clone();
8105 Box::pin(async move { workspace.into_id().await.unwrap().quote() })
8106 }),
8107 );
8108 Env {
8109 proc: self.proc.clone(),
8110 selection: query,
8111 graphql_client: self.graphql_client.clone(),
8112 }
8113 }
8114 pub fn with_workspace_input(
8122 &self,
8123 name: impl Into<String>,
8124 value: impl IntoID<Id>,
8125 description: impl Into<String>,
8126 ) -> Env {
8127 let mut query = self.selection.select("withWorkspaceInput");
8128 query = query.arg("name", name.into());
8129 query = query.arg_lazy(
8130 "value",
8131 Box::new(move || {
8132 let value = value.clone();
8133 Box::pin(async move { value.into_id().await.unwrap().quote() })
8134 }),
8135 );
8136 query = query.arg("description", description.into());
8137 Env {
8138 proc: self.proc.clone(),
8139 selection: query,
8140 graphql_client: self.graphql_client.clone(),
8141 }
8142 }
8143 pub fn with_workspace_output(
8150 &self,
8151 name: impl Into<String>,
8152 description: impl Into<String>,
8153 ) -> Env {
8154 let mut query = self.selection.select("withWorkspaceOutput");
8155 query = query.arg("name", name.into());
8156 query = query.arg("description", description.into());
8157 Env {
8158 proc: self.proc.clone(),
8159 selection: query,
8160 graphql_client: self.graphql_client.clone(),
8161 }
8162 }
8163 pub fn without_outputs(&self) -> Env {
8165 let query = self.selection.select("withoutOutputs");
8166 Env {
8167 proc: self.proc.clone(),
8168 selection: query,
8169 graphql_client: self.graphql_client.clone(),
8170 }
8171 }
8172 pub fn workspace(&self) -> Directory {
8173 let query = self.selection.select("workspace");
8174 Directory {
8175 proc: self.proc.clone(),
8176 selection: query,
8177 graphql_client: self.graphql_client.clone(),
8178 }
8179 }
8180}
8181impl Node for Env {
8182 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8183 let query = self.selection.select("id");
8184 let graphql_client = self.graphql_client.clone();
8185 async move { query.execute(graphql_client).await }
8186 }
8187}
8188#[derive(Clone)]
8189pub struct EnvFile {
8190 pub proc: Option<Arc<DaggerSessionProc>>,
8191 pub selection: Selection,
8192 pub graphql_client: DynGraphQLClient,
8193}
8194#[derive(Builder, Debug, PartialEq)]
8195pub struct EnvFileGetOpts {
8196 #[builder(setter(into, strip_option), default)]
8198 pub raw: Option<bool>,
8199}
8200#[derive(Builder, Debug, PartialEq)]
8201pub struct EnvFileVariablesOpts {
8202 #[builder(setter(into, strip_option), default)]
8204 pub raw: Option<bool>,
8205}
8206impl IntoID<Id> for EnvFile {
8207 fn into_id(
8208 self,
8209 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8210 Box::pin(async move { self.id().await })
8211 }
8212}
8213impl Loadable for EnvFile {
8214 fn graphql_type() -> &'static str {
8215 "EnvFile"
8216 }
8217 fn from_query(
8218 proc: Option<Arc<DaggerSessionProc>>,
8219 selection: Selection,
8220 graphql_client: DynGraphQLClient,
8221 ) -> Self {
8222 Self {
8223 proc,
8224 selection,
8225 graphql_client,
8226 }
8227 }
8228}
8229impl EnvFile {
8230 pub fn as_file(&self) -> File {
8232 let query = self.selection.select("asFile");
8233 File {
8234 proc: self.proc.clone(),
8235 selection: query,
8236 graphql_client: self.graphql_client.clone(),
8237 }
8238 }
8239 pub async fn exists(&self, name: impl Into<String>) -> Result<bool, DaggerError> {
8245 let mut query = self.selection.select("exists");
8246 query = query.arg("name", name.into());
8247 query.execute(self.graphql_client.clone()).await
8248 }
8249 pub async fn get(&self, name: impl Into<String>) -> Result<String, DaggerError> {
8256 let mut query = self.selection.select("get");
8257 query = query.arg("name", name.into());
8258 query.execute(self.graphql_client.clone()).await
8259 }
8260 pub async fn get_opts(
8267 &self,
8268 name: impl Into<String>,
8269 opts: EnvFileGetOpts,
8270 ) -> Result<String, DaggerError> {
8271 let mut query = self.selection.select("get");
8272 query = query.arg("name", name.into());
8273 if let Some(raw) = opts.raw {
8274 query = query.arg("raw", raw);
8275 }
8276 query.execute(self.graphql_client.clone()).await
8277 }
8278 pub async fn id(&self) -> Result<Id, DaggerError> {
8280 let query = self.selection.select("id");
8281 query.execute(self.graphql_client.clone()).await
8282 }
8283 pub fn namespace(&self, prefix: impl Into<String>) -> EnvFile {
8289 let mut query = self.selection.select("namespace");
8290 query = query.arg("prefix", prefix.into());
8291 EnvFile {
8292 proc: self.proc.clone(),
8293 selection: query,
8294 graphql_client: self.graphql_client.clone(),
8295 }
8296 }
8297 pub async fn variables(&self) -> Result<Vec<EnvVariable>, DaggerError> {
8303 let query = self.selection.select("variables");
8304 let query = query.select("id");
8305 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8306 Ok(ids
8307 .into_iter()
8308 .map(|id| EnvVariable {
8309 proc: self.proc.clone(),
8310 selection: crate::querybuilder::query()
8311 .select("node")
8312 .arg("id", &id.0)
8313 .inline_fragment("EnvVariable"),
8314 graphql_client: self.graphql_client.clone(),
8315 })
8316 .collect())
8317 }
8318 pub async fn variables_opts(
8324 &self,
8325 opts: EnvFileVariablesOpts,
8326 ) -> Result<Vec<EnvVariable>, DaggerError> {
8327 let mut query = self.selection.select("variables");
8328 if let Some(raw) = opts.raw {
8329 query = query.arg("raw", raw);
8330 }
8331 let query = query.select("id");
8332 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8333 Ok(ids
8334 .into_iter()
8335 .map(|id| EnvVariable {
8336 proc: self.proc.clone(),
8337 selection: crate::querybuilder::query()
8338 .select("node")
8339 .arg("id", &id.0)
8340 .inline_fragment("EnvVariable"),
8341 graphql_client: self.graphql_client.clone(),
8342 })
8343 .collect())
8344 }
8345 pub fn with_variable(&self, name: impl Into<String>, value: impl Into<String>) -> EnvFile {
8352 let mut query = self.selection.select("withVariable");
8353 query = query.arg("name", name.into());
8354 query = query.arg("value", value.into());
8355 EnvFile {
8356 proc: self.proc.clone(),
8357 selection: query,
8358 graphql_client: self.graphql_client.clone(),
8359 }
8360 }
8361 pub fn without_variable(&self, name: impl Into<String>) -> EnvFile {
8367 let mut query = self.selection.select("withoutVariable");
8368 query = query.arg("name", name.into());
8369 EnvFile {
8370 proc: self.proc.clone(),
8371 selection: query,
8372 graphql_client: self.graphql_client.clone(),
8373 }
8374 }
8375}
8376impl Node for EnvFile {
8377 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8378 let query = self.selection.select("id");
8379 let graphql_client = self.graphql_client.clone();
8380 async move { query.execute(graphql_client).await }
8381 }
8382}
8383#[derive(Clone)]
8384pub struct EnvVariable {
8385 pub proc: Option<Arc<DaggerSessionProc>>,
8386 pub selection: Selection,
8387 pub graphql_client: DynGraphQLClient,
8388}
8389impl IntoID<Id> for EnvVariable {
8390 fn into_id(
8391 self,
8392 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8393 Box::pin(async move { self.id().await })
8394 }
8395}
8396impl Loadable for EnvVariable {
8397 fn graphql_type() -> &'static str {
8398 "EnvVariable"
8399 }
8400 fn from_query(
8401 proc: Option<Arc<DaggerSessionProc>>,
8402 selection: Selection,
8403 graphql_client: DynGraphQLClient,
8404 ) -> Self {
8405 Self {
8406 proc,
8407 selection,
8408 graphql_client,
8409 }
8410 }
8411}
8412impl EnvVariable {
8413 pub async fn id(&self) -> Result<Id, DaggerError> {
8415 let query = self.selection.select("id");
8416 query.execute(self.graphql_client.clone()).await
8417 }
8418 pub async fn name(&self) -> Result<String, DaggerError> {
8420 let query = self.selection.select("name");
8421 query.execute(self.graphql_client.clone()).await
8422 }
8423 pub async fn value(&self) -> Result<String, DaggerError> {
8425 let query = self.selection.select("value");
8426 query.execute(self.graphql_client.clone()).await
8427 }
8428}
8429impl Node for EnvVariable {
8430 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8431 let query = self.selection.select("id");
8432 let graphql_client = self.graphql_client.clone();
8433 async move { query.execute(graphql_client).await }
8434 }
8435}
8436#[derive(Clone)]
8437pub struct Error {
8438 pub proc: Option<Arc<DaggerSessionProc>>,
8439 pub selection: Selection,
8440 pub graphql_client: DynGraphQLClient,
8441}
8442impl IntoID<Id> for Error {
8443 fn into_id(
8444 self,
8445 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8446 Box::pin(async move { self.id().await })
8447 }
8448}
8449impl Loadable for Error {
8450 fn graphql_type() -> &'static str {
8451 "Error"
8452 }
8453 fn from_query(
8454 proc: Option<Arc<DaggerSessionProc>>,
8455 selection: Selection,
8456 graphql_client: DynGraphQLClient,
8457 ) -> Self {
8458 Self {
8459 proc,
8460 selection,
8461 graphql_client,
8462 }
8463 }
8464}
8465impl Error {
8466 pub async fn id(&self) -> Result<Id, DaggerError> {
8468 let query = self.selection.select("id");
8469 query.execute(self.graphql_client.clone()).await
8470 }
8471 pub async fn message(&self) -> Result<String, DaggerError> {
8473 let query = self.selection.select("message");
8474 query.execute(self.graphql_client.clone()).await
8475 }
8476 pub async fn values(&self) -> Result<Vec<ErrorValue>, DaggerError> {
8478 let query = self.selection.select("values");
8479 let query = query.select("id");
8480 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8481 Ok(ids
8482 .into_iter()
8483 .map(|id| ErrorValue {
8484 proc: self.proc.clone(),
8485 selection: crate::querybuilder::query()
8486 .select("node")
8487 .arg("id", &id.0)
8488 .inline_fragment("ErrorValue"),
8489 graphql_client: self.graphql_client.clone(),
8490 })
8491 .collect())
8492 }
8493 pub fn with_value(&self, name: impl Into<String>, value: Json) -> Error {
8500 let mut query = self.selection.select("withValue");
8501 query = query.arg("name", name.into());
8502 query = query.arg("value", value);
8503 Error {
8504 proc: self.proc.clone(),
8505 selection: query,
8506 graphql_client: self.graphql_client.clone(),
8507 }
8508 }
8509}
8510impl Node for Error {
8511 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8512 let query = self.selection.select("id");
8513 let graphql_client = self.graphql_client.clone();
8514 async move { query.execute(graphql_client).await }
8515 }
8516}
8517#[derive(Clone)]
8518pub struct ErrorValue {
8519 pub proc: Option<Arc<DaggerSessionProc>>,
8520 pub selection: Selection,
8521 pub graphql_client: DynGraphQLClient,
8522}
8523impl IntoID<Id> for ErrorValue {
8524 fn into_id(
8525 self,
8526 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8527 Box::pin(async move { self.id().await })
8528 }
8529}
8530impl Loadable for ErrorValue {
8531 fn graphql_type() -> &'static str {
8532 "ErrorValue"
8533 }
8534 fn from_query(
8535 proc: Option<Arc<DaggerSessionProc>>,
8536 selection: Selection,
8537 graphql_client: DynGraphQLClient,
8538 ) -> Self {
8539 Self {
8540 proc,
8541 selection,
8542 graphql_client,
8543 }
8544 }
8545}
8546impl ErrorValue {
8547 pub async fn id(&self) -> Result<Id, DaggerError> {
8549 let query = self.selection.select("id");
8550 query.execute(self.graphql_client.clone()).await
8551 }
8552 pub async fn name(&self) -> Result<String, DaggerError> {
8554 let query = self.selection.select("name");
8555 query.execute(self.graphql_client.clone()).await
8556 }
8557 pub async fn value(&self) -> Result<Json, DaggerError> {
8559 let query = self.selection.select("value");
8560 query.execute(self.graphql_client.clone()).await
8561 }
8562}
8563impl Node for ErrorValue {
8564 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8565 let query = self.selection.select("id");
8566 let graphql_client = self.graphql_client.clone();
8567 async move { query.execute(graphql_client).await }
8568 }
8569}
8570#[derive(Clone)]
8571pub struct FieldTypeDef {
8572 pub proc: Option<Arc<DaggerSessionProc>>,
8573 pub selection: Selection,
8574 pub graphql_client: DynGraphQLClient,
8575}
8576impl IntoID<Id> for FieldTypeDef {
8577 fn into_id(
8578 self,
8579 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8580 Box::pin(async move { self.id().await })
8581 }
8582}
8583impl Loadable for FieldTypeDef {
8584 fn graphql_type() -> &'static str {
8585 "FieldTypeDef"
8586 }
8587 fn from_query(
8588 proc: Option<Arc<DaggerSessionProc>>,
8589 selection: Selection,
8590 graphql_client: DynGraphQLClient,
8591 ) -> Self {
8592 Self {
8593 proc,
8594 selection,
8595 graphql_client,
8596 }
8597 }
8598}
8599impl FieldTypeDef {
8600 pub async fn deprecated(&self) -> Result<String, DaggerError> {
8602 let query = self.selection.select("deprecated");
8603 query.execute(self.graphql_client.clone()).await
8604 }
8605 pub async fn description(&self) -> Result<String, DaggerError> {
8607 let query = self.selection.select("description");
8608 query.execute(self.graphql_client.clone()).await
8609 }
8610 pub async fn id(&self) -> Result<Id, DaggerError> {
8612 let query = self.selection.select("id");
8613 query.execute(self.graphql_client.clone()).await
8614 }
8615 pub async fn name(&self) -> Result<String, DaggerError> {
8617 let query = self.selection.select("name");
8618 query.execute(self.graphql_client.clone()).await
8619 }
8620 pub fn source_map(&self) -> SourceMap {
8622 let query = self.selection.select("sourceMap");
8623 SourceMap {
8624 proc: self.proc.clone(),
8625 selection: query,
8626 graphql_client: self.graphql_client.clone(),
8627 }
8628 }
8629 pub fn type_def(&self) -> TypeDef {
8631 let query = self.selection.select("typeDef");
8632 TypeDef {
8633 proc: self.proc.clone(),
8634 selection: query,
8635 graphql_client: self.graphql_client.clone(),
8636 }
8637 }
8638}
8639impl Node for FieldTypeDef {
8640 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
8641 let query = self.selection.select("id");
8642 let graphql_client = self.graphql_client.clone();
8643 async move { query.execute(graphql_client).await }
8644 }
8645}
8646#[derive(Clone)]
8647pub struct File {
8648 pub proc: Option<Arc<DaggerSessionProc>>,
8649 pub selection: Selection,
8650 pub graphql_client: DynGraphQLClient,
8651}
8652#[derive(Builder, Debug, PartialEq)]
8653pub struct FileAsEnvFileOpts {
8654 #[builder(setter(into, strip_option), default)]
8656 pub expand: Option<bool>,
8657}
8658#[derive(Builder, Debug, PartialEq)]
8659pub struct FileContentsOpts {
8660 #[builder(setter(into, strip_option), default)]
8662 pub limit_lines: Option<isize>,
8663 #[builder(setter(into, strip_option), default)]
8665 pub offset_lines: Option<isize>,
8666}
8667#[derive(Builder, Debug, PartialEq)]
8668pub struct FileDigestOpts {
8669 #[builder(setter(into, strip_option), default)]
8671 pub exclude_metadata: Option<bool>,
8672}
8673#[derive(Builder, Debug, PartialEq)]
8674pub struct FileExportOpts {
8675 #[builder(setter(into, strip_option), default)]
8677 pub allow_parent_dir_path: Option<bool>,
8678}
8679#[derive(Builder, Debug, PartialEq)]
8680pub struct FileSearchOpts<'a> {
8681 #[builder(setter(into, strip_option), default)]
8683 pub dotall: Option<bool>,
8684 #[builder(setter(into, strip_option), default)]
8686 pub files_only: Option<bool>,
8687 #[builder(setter(into, strip_option), default)]
8688 pub globs: Option<Vec<&'a str>>,
8689 #[builder(setter(into, strip_option), default)]
8691 pub insensitive: Option<bool>,
8692 #[builder(setter(into, strip_option), default)]
8694 pub limit: Option<isize>,
8695 #[builder(setter(into, strip_option), default)]
8697 pub literal: Option<bool>,
8698 #[builder(setter(into, strip_option), default)]
8700 pub multiline: Option<bool>,
8701 #[builder(setter(into, strip_option), default)]
8702 pub paths: Option<Vec<&'a str>>,
8703 #[builder(setter(into, strip_option), default)]
8705 pub skip_hidden: Option<bool>,
8706 #[builder(setter(into, strip_option), default)]
8708 pub skip_ignored: Option<bool>,
8709}
8710#[derive(Builder, Debug, PartialEq)]
8711pub struct FileWithReplacedOpts {
8712 #[builder(setter(into, strip_option), default)]
8714 pub all: Option<bool>,
8715 #[builder(setter(into, strip_option), default)]
8717 pub first_from: Option<isize>,
8718}
8719impl IntoID<Id> for File {
8720 fn into_id(
8721 self,
8722 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
8723 Box::pin(async move { self.id().await })
8724 }
8725}
8726impl Loadable for File {
8727 fn graphql_type() -> &'static str {
8728 "File"
8729 }
8730 fn from_query(
8731 proc: Option<Arc<DaggerSessionProc>>,
8732 selection: Selection,
8733 graphql_client: DynGraphQLClient,
8734 ) -> Self {
8735 Self {
8736 proc,
8737 selection,
8738 graphql_client,
8739 }
8740 }
8741}
8742impl File {
8743 pub fn as_env_file(&self) -> EnvFile {
8749 let query = self.selection.select("asEnvFile");
8750 EnvFile {
8751 proc: self.proc.clone(),
8752 selection: query,
8753 graphql_client: self.graphql_client.clone(),
8754 }
8755 }
8756 pub fn as_env_file_opts(&self, opts: FileAsEnvFileOpts) -> EnvFile {
8762 let mut query = self.selection.select("asEnvFile");
8763 if let Some(expand) = opts.expand {
8764 query = query.arg("expand", expand);
8765 }
8766 EnvFile {
8767 proc: self.proc.clone(),
8768 selection: query,
8769 graphql_client: self.graphql_client.clone(),
8770 }
8771 }
8772 pub fn as_json(&self) -> JsonValue {
8774 let query = self.selection.select("asJSON");
8775 JsonValue {
8776 proc: self.proc.clone(),
8777 selection: query,
8778 graphql_client: self.graphql_client.clone(),
8779 }
8780 }
8781 pub fn chown(&self, owner: impl Into<String>) -> File {
8791 let mut query = self.selection.select("chown");
8792 query = query.arg("owner", owner.into());
8793 File {
8794 proc: self.proc.clone(),
8795 selection: query,
8796 graphql_client: self.graphql_client.clone(),
8797 }
8798 }
8799 pub async fn contents(&self) -> Result<String, DaggerError> {
8805 let query = self.selection.select("contents");
8806 query.execute(self.graphql_client.clone()).await
8807 }
8808 pub async fn contents_opts(&self, opts: FileContentsOpts) -> Result<String, DaggerError> {
8814 let mut query = self.selection.select("contents");
8815 if let Some(offset_lines) = opts.offset_lines {
8816 query = query.arg("offsetLines", offset_lines);
8817 }
8818 if let Some(limit_lines) = opts.limit_lines {
8819 query = query.arg("limitLines", limit_lines);
8820 }
8821 query.execute(self.graphql_client.clone()).await
8822 }
8823 pub async fn digest(&self) -> Result<String, DaggerError> {
8829 let query = self.selection.select("digest");
8830 query.execute(self.graphql_client.clone()).await
8831 }
8832 pub async fn digest_opts(&self, opts: FileDigestOpts) -> Result<String, DaggerError> {
8838 let mut query = self.selection.select("digest");
8839 if let Some(exclude_metadata) = opts.exclude_metadata {
8840 query = query.arg("excludeMetadata", exclude_metadata);
8841 }
8842 query.execute(self.graphql_client.clone()).await
8843 }
8844 pub async fn export(&self, path: impl Into<String>) -> Result<String, DaggerError> {
8851 let mut query = self.selection.select("export");
8852 query = query.arg("path", path.into());
8853 query.execute(self.graphql_client.clone()).await
8854 }
8855 pub async fn export_opts(
8862 &self,
8863 path: impl Into<String>,
8864 opts: FileExportOpts,
8865 ) -> Result<String, DaggerError> {
8866 let mut query = self.selection.select("export");
8867 query = query.arg("path", path.into());
8868 if let Some(allow_parent_dir_path) = opts.allow_parent_dir_path {
8869 query = query.arg("allowParentDirPath", allow_parent_dir_path);
8870 }
8871 query.execute(self.graphql_client.clone()).await
8872 }
8873 pub async fn id(&self) -> Result<Id, DaggerError> {
8875 let query = self.selection.select("id");
8876 query.execute(self.graphql_client.clone()).await
8877 }
8878 pub async fn name(&self) -> Result<String, DaggerError> {
8880 let query = self.selection.select("name");
8881 query.execute(self.graphql_client.clone()).await
8882 }
8883 pub async fn search(
8891 &self,
8892 pattern: impl Into<String>,
8893 ) -> Result<Vec<SearchResult>, DaggerError> {
8894 let mut query = self.selection.select("search");
8895 query = query.arg("pattern", pattern.into());
8896 let query = query.select("id");
8897 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8898 Ok(ids
8899 .into_iter()
8900 .map(|id| SearchResult {
8901 proc: self.proc.clone(),
8902 selection: crate::querybuilder::query()
8903 .select("node")
8904 .arg("id", &id.0)
8905 .inline_fragment("SearchResult"),
8906 graphql_client: self.graphql_client.clone(),
8907 })
8908 .collect())
8909 }
8910 pub async fn search_opts<'a>(
8918 &self,
8919 pattern: impl Into<String>,
8920 opts: FileSearchOpts<'a>,
8921 ) -> Result<Vec<SearchResult>, DaggerError> {
8922 let mut query = self.selection.select("search");
8923 query = query.arg("pattern", pattern.into());
8924 if let Some(literal) = opts.literal {
8925 query = query.arg("literal", literal);
8926 }
8927 if let Some(multiline) = opts.multiline {
8928 query = query.arg("multiline", multiline);
8929 }
8930 if let Some(dotall) = opts.dotall {
8931 query = query.arg("dotall", dotall);
8932 }
8933 if let Some(insensitive) = opts.insensitive {
8934 query = query.arg("insensitive", insensitive);
8935 }
8936 if let Some(skip_ignored) = opts.skip_ignored {
8937 query = query.arg("skipIgnored", skip_ignored);
8938 }
8939 if let Some(skip_hidden) = opts.skip_hidden {
8940 query = query.arg("skipHidden", skip_hidden);
8941 }
8942 if let Some(files_only) = opts.files_only {
8943 query = query.arg("filesOnly", files_only);
8944 }
8945 if let Some(limit) = opts.limit {
8946 query = query.arg("limit", limit);
8947 }
8948 if let Some(paths) = opts.paths {
8949 query = query.arg("paths", paths);
8950 }
8951 if let Some(globs) = opts.globs {
8952 query = query.arg("globs", globs);
8953 }
8954 let query = query.select("id");
8955 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
8956 Ok(ids
8957 .into_iter()
8958 .map(|id| SearchResult {
8959 proc: self.proc.clone(),
8960 selection: crate::querybuilder::query()
8961 .select("node")
8962 .arg("id", &id.0)
8963 .inline_fragment("SearchResult"),
8964 graphql_client: self.graphql_client.clone(),
8965 })
8966 .collect())
8967 }
8968 pub async fn size(&self) -> Result<isize, DaggerError> {
8970 let query = self.selection.select("size");
8971 query.execute(self.graphql_client.clone()).await
8972 }
8973 pub fn stat(&self) -> Stat {
8975 let query = self.selection.select("stat");
8976 Stat {
8977 proc: self.proc.clone(),
8978 selection: query,
8979 graphql_client: self.graphql_client.clone(),
8980 }
8981 }
8982 pub async fn sync(&self) -> Result<File, DaggerError> {
8984 let query = self.selection.select("sync");
8985 let id: Id = query.execute(self.graphql_client.clone()).await?;
8986 Ok(File {
8987 proc: self.proc.clone(),
8988 selection: query
8989 .root()
8990 .select("node")
8991 .arg("id", &id.0)
8992 .inline_fragment("File"),
8993 graphql_client: self.graphql_client.clone(),
8994 })
8995 }
8996 pub fn with_name(&self, name: impl Into<String>) -> File {
9002 let mut query = self.selection.select("withName");
9003 query = query.arg("name", name.into());
9004 File {
9005 proc: self.proc.clone(),
9006 selection: query,
9007 graphql_client: self.graphql_client.clone(),
9008 }
9009 }
9010 pub fn with_replaced(&self, search: impl Into<String>, replacement: impl Into<String>) -> File {
9022 let mut query = self.selection.select("withReplaced");
9023 query = query.arg("search", search.into());
9024 query = query.arg("replacement", replacement.into());
9025 File {
9026 proc: self.proc.clone(),
9027 selection: query,
9028 graphql_client: self.graphql_client.clone(),
9029 }
9030 }
9031 pub fn with_replaced_opts(
9043 &self,
9044 search: impl Into<String>,
9045 replacement: impl Into<String>,
9046 opts: FileWithReplacedOpts,
9047 ) -> File {
9048 let mut query = self.selection.select("withReplaced");
9049 query = query.arg("search", search.into());
9050 query = query.arg("replacement", replacement.into());
9051 if let Some(all) = opts.all {
9052 query = query.arg("all", all);
9053 }
9054 if let Some(first_from) = opts.first_from {
9055 query = query.arg("firstFrom", first_from);
9056 }
9057 File {
9058 proc: self.proc.clone(),
9059 selection: query,
9060 graphql_client: self.graphql_client.clone(),
9061 }
9062 }
9063 pub fn with_timestamps(&self, timestamp: isize) -> File {
9071 let mut query = self.selection.select("withTimestamps");
9072 query = query.arg("timestamp", timestamp);
9073 File {
9074 proc: self.proc.clone(),
9075 selection: query,
9076 graphql_client: self.graphql_client.clone(),
9077 }
9078 }
9079}
9080impl Exportable for File {
9081 fn export(
9082 &self,
9083 path: impl Into<String>,
9084 ) -> impl core::future::Future<Output = Result<String, DaggerError>> + Send {
9085 let mut query = self.selection.select("export");
9086 query = query.arg("path", path.into());
9087 let graphql_client = self.graphql_client.clone();
9088 async move { query.execute(graphql_client).await }
9089 }
9090 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9091 let query = self.selection.select("id");
9092 let graphql_client = self.graphql_client.clone();
9093 async move { query.execute(graphql_client).await }
9094 }
9095}
9096impl Node for File {
9097 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9098 let query = self.selection.select("id");
9099 let graphql_client = self.graphql_client.clone();
9100 async move { query.execute(graphql_client).await }
9101 }
9102}
9103impl Syncer for File {
9104 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9105 let query = self.selection.select("id");
9106 let graphql_client = self.graphql_client.clone();
9107 async move { query.execute(graphql_client).await }
9108 }
9109 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9110 let query = self.selection.select("sync");
9111 let graphql_client = self.graphql_client.clone();
9112 async move { query.execute(graphql_client).await }
9113 }
9114}
9115#[derive(Clone)]
9116pub struct Function {
9117 pub proc: Option<Arc<DaggerSessionProc>>,
9118 pub selection: Selection,
9119 pub graphql_client: DynGraphQLClient,
9120}
9121#[derive(Builder, Debug, PartialEq)]
9122pub struct FunctionWithArgOpts<'a> {
9123 #[builder(setter(into, strip_option), default)]
9124 pub default_address: Option<&'a str>,
9125 #[builder(setter(into, strip_option), default)]
9127 pub default_path: Option<&'a str>,
9128 #[builder(setter(into, strip_option), default)]
9130 pub default_value: Option<Json>,
9131 #[builder(setter(into, strip_option), default)]
9133 pub deprecated: Option<&'a str>,
9134 #[builder(setter(into, strip_option), default)]
9136 pub description: Option<&'a str>,
9137 #[builder(setter(into, strip_option), default)]
9139 pub ignore: Option<Vec<&'a str>>,
9140 #[builder(setter(into, strip_option), default)]
9142 pub source_map: Option<Id>,
9143}
9144#[derive(Builder, Debug, PartialEq)]
9145pub struct FunctionWithCachePolicyOpts<'a> {
9146 #[builder(setter(into, strip_option), default)]
9148 pub time_to_live: Option<&'a str>,
9149}
9150#[derive(Builder, Debug, PartialEq)]
9151pub struct FunctionWithDeprecatedOpts<'a> {
9152 #[builder(setter(into, strip_option), default)]
9154 pub reason: Option<&'a str>,
9155}
9156impl IntoID<Id> for Function {
9157 fn into_id(
9158 self,
9159 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9160 Box::pin(async move { self.id().await })
9161 }
9162}
9163impl Loadable for Function {
9164 fn graphql_type() -> &'static str {
9165 "Function"
9166 }
9167 fn from_query(
9168 proc: Option<Arc<DaggerSessionProc>>,
9169 selection: Selection,
9170 graphql_client: DynGraphQLClient,
9171 ) -> Self {
9172 Self {
9173 proc,
9174 selection,
9175 graphql_client,
9176 }
9177 }
9178}
9179impl Function {
9180 pub async fn args(&self) -> Result<Vec<FunctionArg>, DaggerError> {
9182 let query = self.selection.select("args");
9183 let query = query.select("id");
9184 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9185 Ok(ids
9186 .into_iter()
9187 .map(|id| FunctionArg {
9188 proc: self.proc.clone(),
9189 selection: crate::querybuilder::query()
9190 .select("node")
9191 .arg("id", &id.0)
9192 .inline_fragment("FunctionArg"),
9193 graphql_client: self.graphql_client.clone(),
9194 })
9195 .collect())
9196 }
9197 pub async fn deprecated(&self) -> Result<String, DaggerError> {
9199 let query = self.selection.select("deprecated");
9200 query.execute(self.graphql_client.clone()).await
9201 }
9202 pub async fn description(&self) -> Result<String, DaggerError> {
9204 let query = self.selection.select("description");
9205 query.execute(self.graphql_client.clone()).await
9206 }
9207 pub async fn id(&self) -> Result<Id, DaggerError> {
9209 let query = self.selection.select("id");
9210 query.execute(self.graphql_client.clone()).await
9211 }
9212 pub async fn name(&self) -> Result<String, DaggerError> {
9214 let query = self.selection.select("name");
9215 query.execute(self.graphql_client.clone()).await
9216 }
9217 pub fn return_type(&self) -> TypeDef {
9219 let query = self.selection.select("returnType");
9220 TypeDef {
9221 proc: self.proc.clone(),
9222 selection: query,
9223 graphql_client: self.graphql_client.clone(),
9224 }
9225 }
9226 pub fn source_map(&self) -> SourceMap {
9228 let query = self.selection.select("sourceMap");
9229 SourceMap {
9230 proc: self.proc.clone(),
9231 selection: query,
9232 graphql_client: self.graphql_client.clone(),
9233 }
9234 }
9235 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
9237 let query = self.selection.select("sourceModuleName");
9238 query.execute(self.graphql_client.clone()).await
9239 }
9240 pub fn with_arg(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> Function {
9248 let mut query = self.selection.select("withArg");
9249 query = query.arg("name", name.into());
9250 query = query.arg_lazy(
9251 "typeDef",
9252 Box::new(move || {
9253 let type_def = type_def.clone();
9254 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9255 }),
9256 );
9257 Function {
9258 proc: self.proc.clone(),
9259 selection: query,
9260 graphql_client: self.graphql_client.clone(),
9261 }
9262 }
9263 pub fn with_arg_opts<'a>(
9271 &self,
9272 name: impl Into<String>,
9273 type_def: impl IntoID<Id>,
9274 opts: FunctionWithArgOpts<'a>,
9275 ) -> Function {
9276 let mut query = self.selection.select("withArg");
9277 query = query.arg("name", name.into());
9278 query = query.arg_lazy(
9279 "typeDef",
9280 Box::new(move || {
9281 let type_def = type_def.clone();
9282 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
9283 }),
9284 );
9285 if let Some(description) = opts.description {
9286 query = query.arg("description", description);
9287 }
9288 if let Some(default_value) = opts.default_value {
9289 query = query.arg("defaultValue", default_value);
9290 }
9291 if let Some(default_path) = opts.default_path {
9292 query = query.arg("defaultPath", default_path);
9293 }
9294 if let Some(ignore) = opts.ignore {
9295 query = query.arg("ignore", ignore);
9296 }
9297 if let Some(source_map) = opts.source_map {
9298 query = query.arg("sourceMap", source_map);
9299 }
9300 if let Some(deprecated) = opts.deprecated {
9301 query = query.arg("deprecated", deprecated);
9302 }
9303 if let Some(default_address) = opts.default_address {
9304 query = query.arg("defaultAddress", default_address);
9305 }
9306 Function {
9307 proc: self.proc.clone(),
9308 selection: query,
9309 graphql_client: self.graphql_client.clone(),
9310 }
9311 }
9312 pub fn with_cache_policy(&self, policy: FunctionCachePolicy) -> Function {
9319 let mut query = self.selection.select("withCachePolicy");
9320 query = query.arg("policy", policy);
9321 Function {
9322 proc: self.proc.clone(),
9323 selection: query,
9324 graphql_client: self.graphql_client.clone(),
9325 }
9326 }
9327 pub fn with_cache_policy_opts<'a>(
9334 &self,
9335 policy: FunctionCachePolicy,
9336 opts: FunctionWithCachePolicyOpts<'a>,
9337 ) -> Function {
9338 let mut query = self.selection.select("withCachePolicy");
9339 query = query.arg("policy", policy);
9340 if let Some(time_to_live) = opts.time_to_live {
9341 query = query.arg("timeToLive", time_to_live);
9342 }
9343 Function {
9344 proc: self.proc.clone(),
9345 selection: query,
9346 graphql_client: self.graphql_client.clone(),
9347 }
9348 }
9349 pub fn with_check(&self) -> Function {
9351 let query = self.selection.select("withCheck");
9352 Function {
9353 proc: self.proc.clone(),
9354 selection: query,
9355 graphql_client: self.graphql_client.clone(),
9356 }
9357 }
9358 pub fn with_deprecated(&self) -> Function {
9364 let query = self.selection.select("withDeprecated");
9365 Function {
9366 proc: self.proc.clone(),
9367 selection: query,
9368 graphql_client: self.graphql_client.clone(),
9369 }
9370 }
9371 pub fn with_deprecated_opts<'a>(&self, opts: FunctionWithDeprecatedOpts<'a>) -> Function {
9377 let mut query = self.selection.select("withDeprecated");
9378 if let Some(reason) = opts.reason {
9379 query = query.arg("reason", reason);
9380 }
9381 Function {
9382 proc: self.proc.clone(),
9383 selection: query,
9384 graphql_client: self.graphql_client.clone(),
9385 }
9386 }
9387 pub fn with_description(&self, description: impl Into<String>) -> Function {
9393 let mut query = self.selection.select("withDescription");
9394 query = query.arg("description", description.into());
9395 Function {
9396 proc: self.proc.clone(),
9397 selection: query,
9398 graphql_client: self.graphql_client.clone(),
9399 }
9400 }
9401 pub fn with_generator(&self) -> Function {
9403 let query = self.selection.select("withGenerator");
9404 Function {
9405 proc: self.proc.clone(),
9406 selection: query,
9407 graphql_client: self.graphql_client.clone(),
9408 }
9409 }
9410 pub fn with_source_map(&self, source_map: impl IntoID<Id>) -> Function {
9416 let mut query = self.selection.select("withSourceMap");
9417 query = query.arg_lazy(
9418 "sourceMap",
9419 Box::new(move || {
9420 let source_map = source_map.clone();
9421 Box::pin(async move { source_map.into_id().await.unwrap().quote() })
9422 }),
9423 );
9424 Function {
9425 proc: self.proc.clone(),
9426 selection: query,
9427 graphql_client: self.graphql_client.clone(),
9428 }
9429 }
9430 pub fn with_up(&self) -> Function {
9432 let query = self.selection.select("withUp");
9433 Function {
9434 proc: self.proc.clone(),
9435 selection: query,
9436 graphql_client: self.graphql_client.clone(),
9437 }
9438 }
9439}
9440impl Node for Function {
9441 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9442 let query = self.selection.select("id");
9443 let graphql_client = self.graphql_client.clone();
9444 async move { query.execute(graphql_client).await }
9445 }
9446}
9447#[derive(Clone)]
9448pub struct FunctionArg {
9449 pub proc: Option<Arc<DaggerSessionProc>>,
9450 pub selection: Selection,
9451 pub graphql_client: DynGraphQLClient,
9452}
9453impl IntoID<Id> for FunctionArg {
9454 fn into_id(
9455 self,
9456 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9457 Box::pin(async move { self.id().await })
9458 }
9459}
9460impl Loadable for FunctionArg {
9461 fn graphql_type() -> &'static str {
9462 "FunctionArg"
9463 }
9464 fn from_query(
9465 proc: Option<Arc<DaggerSessionProc>>,
9466 selection: Selection,
9467 graphql_client: DynGraphQLClient,
9468 ) -> Self {
9469 Self {
9470 proc,
9471 selection,
9472 graphql_client,
9473 }
9474 }
9475}
9476impl FunctionArg {
9477 pub async fn default_address(&self) -> Result<String, DaggerError> {
9479 let query = self.selection.select("defaultAddress");
9480 query.execute(self.graphql_client.clone()).await
9481 }
9482 pub async fn default_path(&self) -> Result<String, DaggerError> {
9484 let query = self.selection.select("defaultPath");
9485 query.execute(self.graphql_client.clone()).await
9486 }
9487 pub async fn default_value(&self) -> Result<Json, DaggerError> {
9489 let query = self.selection.select("defaultValue");
9490 query.execute(self.graphql_client.clone()).await
9491 }
9492 pub async fn deprecated(&self) -> Result<String, DaggerError> {
9494 let query = self.selection.select("deprecated");
9495 query.execute(self.graphql_client.clone()).await
9496 }
9497 pub async fn description(&self) -> Result<String, DaggerError> {
9499 let query = self.selection.select("description");
9500 query.execute(self.graphql_client.clone()).await
9501 }
9502 pub async fn id(&self) -> Result<Id, DaggerError> {
9504 let query = self.selection.select("id");
9505 query.execute(self.graphql_client.clone()).await
9506 }
9507 pub async fn ignore(&self) -> Result<Vec<String>, DaggerError> {
9509 let query = self.selection.select("ignore");
9510 query.execute(self.graphql_client.clone()).await
9511 }
9512 pub async fn name(&self) -> Result<String, DaggerError> {
9514 let query = self.selection.select("name");
9515 query.execute(self.graphql_client.clone()).await
9516 }
9517 pub fn source_map(&self) -> SourceMap {
9519 let query = self.selection.select("sourceMap");
9520 SourceMap {
9521 proc: self.proc.clone(),
9522 selection: query,
9523 graphql_client: self.graphql_client.clone(),
9524 }
9525 }
9526 pub fn type_def(&self) -> TypeDef {
9528 let query = self.selection.select("typeDef");
9529 TypeDef {
9530 proc: self.proc.clone(),
9531 selection: query,
9532 graphql_client: self.graphql_client.clone(),
9533 }
9534 }
9535}
9536impl Node for FunctionArg {
9537 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9538 let query = self.selection.select("id");
9539 let graphql_client = self.graphql_client.clone();
9540 async move { query.execute(graphql_client).await }
9541 }
9542}
9543#[derive(Clone)]
9544pub struct FunctionCall {
9545 pub proc: Option<Arc<DaggerSessionProc>>,
9546 pub selection: Selection,
9547 pub graphql_client: DynGraphQLClient,
9548}
9549impl IntoID<Id> for FunctionCall {
9550 fn into_id(
9551 self,
9552 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9553 Box::pin(async move { self.id().await })
9554 }
9555}
9556impl Loadable for FunctionCall {
9557 fn graphql_type() -> &'static str {
9558 "FunctionCall"
9559 }
9560 fn from_query(
9561 proc: Option<Arc<DaggerSessionProc>>,
9562 selection: Selection,
9563 graphql_client: DynGraphQLClient,
9564 ) -> Self {
9565 Self {
9566 proc,
9567 selection,
9568 graphql_client,
9569 }
9570 }
9571}
9572impl FunctionCall {
9573 pub async fn id(&self) -> Result<Id, DaggerError> {
9575 let query = self.selection.select("id");
9576 query.execute(self.graphql_client.clone()).await
9577 }
9578 pub async fn input_args(&self) -> Result<Vec<FunctionCallArgValue>, DaggerError> {
9580 let query = self.selection.select("inputArgs");
9581 let query = query.select("id");
9582 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9583 Ok(ids
9584 .into_iter()
9585 .map(|id| FunctionCallArgValue {
9586 proc: self.proc.clone(),
9587 selection: crate::querybuilder::query()
9588 .select("node")
9589 .arg("id", &id.0)
9590 .inline_fragment("FunctionCallArgValue"),
9591 graphql_client: self.graphql_client.clone(),
9592 })
9593 .collect())
9594 }
9595 pub async fn name(&self) -> Result<String, DaggerError> {
9597 let query = self.selection.select("name");
9598 query.execute(self.graphql_client.clone()).await
9599 }
9600 pub async fn parent(&self) -> Result<Json, DaggerError> {
9602 let query = self.selection.select("parent");
9603 query.execute(self.graphql_client.clone()).await
9604 }
9605 pub async fn parent_name(&self) -> Result<String, DaggerError> {
9607 let query = self.selection.select("parentName");
9608 query.execute(self.graphql_client.clone()).await
9609 }
9610 pub async fn return_error(&self, error: impl IntoID<Id>) -> Result<Void, DaggerError> {
9616 let mut query = self.selection.select("returnError");
9617 query = query.arg_lazy(
9618 "error",
9619 Box::new(move || {
9620 let error = error.clone();
9621 Box::pin(async move { error.into_id().await.unwrap().quote() })
9622 }),
9623 );
9624 query.execute(self.graphql_client.clone()).await
9625 }
9626 pub async fn return_value(&self, value: Json) -> Result<Void, DaggerError> {
9632 let mut query = self.selection.select("returnValue");
9633 query = query.arg("value", value);
9634 query.execute(self.graphql_client.clone()).await
9635 }
9636}
9637impl Node for FunctionCall {
9638 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9639 let query = self.selection.select("id");
9640 let graphql_client = self.graphql_client.clone();
9641 async move { query.execute(graphql_client).await }
9642 }
9643}
9644#[derive(Clone)]
9645pub struct FunctionCallArgValue {
9646 pub proc: Option<Arc<DaggerSessionProc>>,
9647 pub selection: Selection,
9648 pub graphql_client: DynGraphQLClient,
9649}
9650impl IntoID<Id> for FunctionCallArgValue {
9651 fn into_id(
9652 self,
9653 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9654 Box::pin(async move { self.id().await })
9655 }
9656}
9657impl Loadable for FunctionCallArgValue {
9658 fn graphql_type() -> &'static str {
9659 "FunctionCallArgValue"
9660 }
9661 fn from_query(
9662 proc: Option<Arc<DaggerSessionProc>>,
9663 selection: Selection,
9664 graphql_client: DynGraphQLClient,
9665 ) -> Self {
9666 Self {
9667 proc,
9668 selection,
9669 graphql_client,
9670 }
9671 }
9672}
9673impl FunctionCallArgValue {
9674 pub async fn id(&self) -> Result<Id, DaggerError> {
9676 let query = self.selection.select("id");
9677 query.execute(self.graphql_client.clone()).await
9678 }
9679 pub async fn name(&self) -> Result<String, DaggerError> {
9681 let query = self.selection.select("name");
9682 query.execute(self.graphql_client.clone()).await
9683 }
9684 pub async fn value(&self) -> Result<Json, DaggerError> {
9686 let query = self.selection.select("value");
9687 query.execute(self.graphql_client.clone()).await
9688 }
9689}
9690impl Node for FunctionCallArgValue {
9691 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9692 let query = self.selection.select("id");
9693 let graphql_client = self.graphql_client.clone();
9694 async move { query.execute(graphql_client).await }
9695 }
9696}
9697#[derive(Clone)]
9698pub struct GeneratedCode {
9699 pub proc: Option<Arc<DaggerSessionProc>>,
9700 pub selection: Selection,
9701 pub graphql_client: DynGraphQLClient,
9702}
9703impl IntoID<Id> for GeneratedCode {
9704 fn into_id(
9705 self,
9706 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9707 Box::pin(async move { self.id().await })
9708 }
9709}
9710impl Loadable for GeneratedCode {
9711 fn graphql_type() -> &'static str {
9712 "GeneratedCode"
9713 }
9714 fn from_query(
9715 proc: Option<Arc<DaggerSessionProc>>,
9716 selection: Selection,
9717 graphql_client: DynGraphQLClient,
9718 ) -> Self {
9719 Self {
9720 proc,
9721 selection,
9722 graphql_client,
9723 }
9724 }
9725}
9726impl GeneratedCode {
9727 pub fn code(&self) -> Directory {
9729 let query = self.selection.select("code");
9730 Directory {
9731 proc: self.proc.clone(),
9732 selection: query,
9733 graphql_client: self.graphql_client.clone(),
9734 }
9735 }
9736 pub async fn id(&self) -> Result<Id, DaggerError> {
9738 let query = self.selection.select("id");
9739 query.execute(self.graphql_client.clone()).await
9740 }
9741 pub async fn vcs_generated_paths(&self) -> Result<Vec<String>, DaggerError> {
9743 let query = self.selection.select("vcsGeneratedPaths");
9744 query.execute(self.graphql_client.clone()).await
9745 }
9746 pub async fn vcs_ignored_paths(&self) -> Result<Vec<String>, DaggerError> {
9748 let query = self.selection.select("vcsIgnoredPaths");
9749 query.execute(self.graphql_client.clone()).await
9750 }
9751 pub fn with_vcs_generated_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9753 let mut query = self.selection.select("withVCSGeneratedPaths");
9754 query = query.arg(
9755 "paths",
9756 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9757 );
9758 GeneratedCode {
9759 proc: self.proc.clone(),
9760 selection: query,
9761 graphql_client: self.graphql_client.clone(),
9762 }
9763 }
9764 pub fn with_vcs_ignored_paths(&self, paths: Vec<impl Into<String>>) -> GeneratedCode {
9766 let mut query = self.selection.select("withVCSIgnoredPaths");
9767 query = query.arg(
9768 "paths",
9769 paths.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
9770 );
9771 GeneratedCode {
9772 proc: self.proc.clone(),
9773 selection: query,
9774 graphql_client: self.graphql_client.clone(),
9775 }
9776 }
9777}
9778impl Node for GeneratedCode {
9779 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9780 let query = self.selection.select("id");
9781 let graphql_client = self.graphql_client.clone();
9782 async move { query.execute(graphql_client).await }
9783 }
9784}
9785#[derive(Clone)]
9786pub struct Generator {
9787 pub proc: Option<Arc<DaggerSessionProc>>,
9788 pub selection: Selection,
9789 pub graphql_client: DynGraphQLClient,
9790}
9791impl IntoID<Id> for Generator {
9792 fn into_id(
9793 self,
9794 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9795 Box::pin(async move { self.id().await })
9796 }
9797}
9798impl Loadable for Generator {
9799 fn graphql_type() -> &'static str {
9800 "Generator"
9801 }
9802 fn from_query(
9803 proc: Option<Arc<DaggerSessionProc>>,
9804 selection: Selection,
9805 graphql_client: DynGraphQLClient,
9806 ) -> Self {
9807 Self {
9808 proc,
9809 selection,
9810 graphql_client,
9811 }
9812 }
9813}
9814impl Generator {
9815 pub fn changes(&self) -> Changeset {
9817 let query = self.selection.select("changes");
9818 Changeset {
9819 proc: self.proc.clone(),
9820 selection: query,
9821 graphql_client: self.graphql_client.clone(),
9822 }
9823 }
9824 pub async fn completed(&self) -> Result<bool, DaggerError> {
9826 let query = self.selection.select("completed");
9827 query.execute(self.graphql_client.clone()).await
9828 }
9829 pub async fn description(&self) -> Result<String, DaggerError> {
9831 let query = self.selection.select("description");
9832 query.execute(self.graphql_client.clone()).await
9833 }
9834 pub async fn id(&self) -> Result<Id, DaggerError> {
9836 let query = self.selection.select("id");
9837 query.execute(self.graphql_client.clone()).await
9838 }
9839 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9841 let query = self.selection.select("isEmpty");
9842 query.execute(self.graphql_client.clone()).await
9843 }
9844 pub async fn name(&self) -> Result<String, DaggerError> {
9846 let query = self.selection.select("name");
9847 query.execute(self.graphql_client.clone()).await
9848 }
9849 pub fn original_module(&self) -> Module {
9851 let query = self.selection.select("originalModule");
9852 Module {
9853 proc: self.proc.clone(),
9854 selection: query,
9855 graphql_client: self.graphql_client.clone(),
9856 }
9857 }
9858 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
9860 let query = self.selection.select("path");
9861 query.execute(self.graphql_client.clone()).await
9862 }
9863 pub fn run(&self) -> Generator {
9865 let query = self.selection.select("run");
9866 Generator {
9867 proc: self.proc.clone(),
9868 selection: query,
9869 graphql_client: self.graphql_client.clone(),
9870 }
9871 }
9872}
9873impl Node for Generator {
9874 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9875 let query = self.selection.select("id");
9876 let graphql_client = self.graphql_client.clone();
9877 async move { query.execute(graphql_client).await }
9878 }
9879}
9880#[derive(Clone)]
9881pub struct GeneratorGroup {
9882 pub proc: Option<Arc<DaggerSessionProc>>,
9883 pub selection: Selection,
9884 pub graphql_client: DynGraphQLClient,
9885}
9886#[derive(Builder, Debug, PartialEq)]
9887pub struct GeneratorGroupChangesOpts {
9888 #[builder(setter(into, strip_option), default)]
9890 pub on_conflict: Option<ChangesetsMergeConflict>,
9891}
9892impl IntoID<Id> for GeneratorGroup {
9893 fn into_id(
9894 self,
9895 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
9896 Box::pin(async move { self.id().await })
9897 }
9898}
9899impl Loadable for GeneratorGroup {
9900 fn graphql_type() -> &'static str {
9901 "GeneratorGroup"
9902 }
9903 fn from_query(
9904 proc: Option<Arc<DaggerSessionProc>>,
9905 selection: Selection,
9906 graphql_client: DynGraphQLClient,
9907 ) -> Self {
9908 Self {
9909 proc,
9910 selection,
9911 graphql_client,
9912 }
9913 }
9914}
9915impl GeneratorGroup {
9916 pub fn changes(&self) -> Changeset {
9924 let query = self.selection.select("changes");
9925 Changeset {
9926 proc: self.proc.clone(),
9927 selection: query,
9928 graphql_client: self.graphql_client.clone(),
9929 }
9930 }
9931 pub fn changes_opts(&self, opts: GeneratorGroupChangesOpts) -> Changeset {
9939 let mut query = self.selection.select("changes");
9940 if let Some(on_conflict) = opts.on_conflict {
9941 query = query.arg("onConflict", on_conflict);
9942 }
9943 Changeset {
9944 proc: self.proc.clone(),
9945 selection: query,
9946 graphql_client: self.graphql_client.clone(),
9947 }
9948 }
9949 pub async fn id(&self) -> Result<Id, DaggerError> {
9951 let query = self.selection.select("id");
9952 query.execute(self.graphql_client.clone()).await
9953 }
9954 pub async fn is_empty(&self) -> Result<bool, DaggerError> {
9956 let query = self.selection.select("isEmpty");
9957 query.execute(self.graphql_client.clone()).await
9958 }
9959 pub async fn list(&self) -> Result<Vec<Generator>, DaggerError> {
9961 let query = self.selection.select("list");
9962 let query = query.select("id");
9963 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
9964 Ok(ids
9965 .into_iter()
9966 .map(|id| Generator {
9967 proc: self.proc.clone(),
9968 selection: crate::querybuilder::query()
9969 .select("node")
9970 .arg("id", &id.0)
9971 .inline_fragment("Generator"),
9972 graphql_client: self.graphql_client.clone(),
9973 })
9974 .collect())
9975 }
9976 pub fn run(&self) -> GeneratorGroup {
9978 let query = self.selection.select("run");
9979 GeneratorGroup {
9980 proc: self.proc.clone(),
9981 selection: query,
9982 graphql_client: self.graphql_client.clone(),
9983 }
9984 }
9985}
9986impl Node for GeneratorGroup {
9987 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
9988 let query = self.selection.select("id");
9989 let graphql_client = self.graphql_client.clone();
9990 async move { query.execute(graphql_client).await }
9991 }
9992}
9993#[derive(Clone)]
9994pub struct GitRef {
9995 pub proc: Option<Arc<DaggerSessionProc>>,
9996 pub selection: Selection,
9997 pub graphql_client: DynGraphQLClient,
9998}
9999#[derive(Builder, Debug, PartialEq)]
10000pub struct GitRefTreeOpts {
10001 #[builder(setter(into, strip_option), default)]
10003 pub depth: Option<isize>,
10004 #[builder(setter(into, strip_option), default)]
10006 pub discard_git_dir: Option<bool>,
10007 #[builder(setter(into, strip_option), default)]
10009 pub include_tags: Option<bool>,
10010}
10011impl IntoID<Id> for GitRef {
10012 fn into_id(
10013 self,
10014 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10015 Box::pin(async move { self.id().await })
10016 }
10017}
10018impl Loadable for GitRef {
10019 fn graphql_type() -> &'static str {
10020 "GitRef"
10021 }
10022 fn from_query(
10023 proc: Option<Arc<DaggerSessionProc>>,
10024 selection: Selection,
10025 graphql_client: DynGraphQLClient,
10026 ) -> Self {
10027 Self {
10028 proc,
10029 selection,
10030 graphql_client,
10031 }
10032 }
10033}
10034impl GitRef {
10035 pub async fn commit(&self) -> Result<String, DaggerError> {
10037 let query = self.selection.select("commit");
10038 query.execute(self.graphql_client.clone()).await
10039 }
10040 pub fn common_ancestor(&self, other: impl IntoID<Id>) -> GitRef {
10046 let mut query = self.selection.select("commonAncestor");
10047 query = query.arg_lazy(
10048 "other",
10049 Box::new(move || {
10050 let other = other.clone();
10051 Box::pin(async move { other.into_id().await.unwrap().quote() })
10052 }),
10053 );
10054 GitRef {
10055 proc: self.proc.clone(),
10056 selection: query,
10057 graphql_client: self.graphql_client.clone(),
10058 }
10059 }
10060 pub async fn id(&self) -> Result<Id, DaggerError> {
10062 let query = self.selection.select("id");
10063 query.execute(self.graphql_client.clone()).await
10064 }
10065 pub async fn r#ref(&self) -> Result<String, DaggerError> {
10067 let query = self.selection.select("ref");
10068 query.execute(self.graphql_client.clone()).await
10069 }
10070 pub fn tree(&self) -> Directory {
10076 let query = self.selection.select("tree");
10077 Directory {
10078 proc: self.proc.clone(),
10079 selection: query,
10080 graphql_client: self.graphql_client.clone(),
10081 }
10082 }
10083 pub fn tree_opts(&self, opts: GitRefTreeOpts) -> Directory {
10089 let mut query = self.selection.select("tree");
10090 if let Some(discard_git_dir) = opts.discard_git_dir {
10091 query = query.arg("discardGitDir", discard_git_dir);
10092 }
10093 if let Some(depth) = opts.depth {
10094 query = query.arg("depth", depth);
10095 }
10096 if let Some(include_tags) = opts.include_tags {
10097 query = query.arg("includeTags", include_tags);
10098 }
10099 Directory {
10100 proc: self.proc.clone(),
10101 selection: query,
10102 graphql_client: self.graphql_client.clone(),
10103 }
10104 }
10105}
10106impl Node for GitRef {
10107 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10108 let query = self.selection.select("id");
10109 let graphql_client = self.graphql_client.clone();
10110 async move { query.execute(graphql_client).await }
10111 }
10112}
10113#[derive(Clone)]
10114pub struct GitRepository {
10115 pub proc: Option<Arc<DaggerSessionProc>>,
10116 pub selection: Selection,
10117 pub graphql_client: DynGraphQLClient,
10118}
10119#[derive(Builder, Debug, PartialEq)]
10120pub struct GitRepositoryBranchesOpts<'a> {
10121 #[builder(setter(into, strip_option), default)]
10123 pub patterns: Option<Vec<&'a str>>,
10124}
10125#[derive(Builder, Debug, PartialEq)]
10126pub struct GitRepositoryTagsOpts<'a> {
10127 #[builder(setter(into, strip_option), default)]
10129 pub patterns: Option<Vec<&'a str>>,
10130}
10131impl IntoID<Id> for GitRepository {
10132 fn into_id(
10133 self,
10134 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10135 Box::pin(async move { self.id().await })
10136 }
10137}
10138impl Loadable for GitRepository {
10139 fn graphql_type() -> &'static str {
10140 "GitRepository"
10141 }
10142 fn from_query(
10143 proc: Option<Arc<DaggerSessionProc>>,
10144 selection: Selection,
10145 graphql_client: DynGraphQLClient,
10146 ) -> Self {
10147 Self {
10148 proc,
10149 selection,
10150 graphql_client,
10151 }
10152 }
10153}
10154impl GitRepository {
10155 pub fn branch(&self, name: impl Into<String>) -> GitRef {
10161 let mut query = self.selection.select("branch");
10162 query = query.arg("name", name.into());
10163 GitRef {
10164 proc: self.proc.clone(),
10165 selection: query,
10166 graphql_client: self.graphql_client.clone(),
10167 }
10168 }
10169 pub async fn branches(&self) -> Result<Vec<String>, DaggerError> {
10175 let query = self.selection.select("branches");
10176 query.execute(self.graphql_client.clone()).await
10177 }
10178 pub async fn branches_opts<'a>(
10184 &self,
10185 opts: GitRepositoryBranchesOpts<'a>,
10186 ) -> Result<Vec<String>, DaggerError> {
10187 let mut query = self.selection.select("branches");
10188 if let Some(patterns) = opts.patterns {
10189 query = query.arg("patterns", patterns);
10190 }
10191 query.execute(self.graphql_client.clone()).await
10192 }
10193 pub fn commit(&self, id: impl Into<String>) -> GitRef {
10199 let mut query = self.selection.select("commit");
10200 query = query.arg("id", id.into());
10201 GitRef {
10202 proc: self.proc.clone(),
10203 selection: query,
10204 graphql_client: self.graphql_client.clone(),
10205 }
10206 }
10207 pub fn head(&self) -> GitRef {
10209 let query = self.selection.select("head");
10210 GitRef {
10211 proc: self.proc.clone(),
10212 selection: query,
10213 graphql_client: self.graphql_client.clone(),
10214 }
10215 }
10216 pub async fn id(&self) -> Result<Id, DaggerError> {
10218 let query = self.selection.select("id");
10219 query.execute(self.graphql_client.clone()).await
10220 }
10221 pub fn latest_version(&self) -> GitRef {
10223 let query = self.selection.select("latestVersion");
10224 GitRef {
10225 proc: self.proc.clone(),
10226 selection: query,
10227 graphql_client: self.graphql_client.clone(),
10228 }
10229 }
10230 pub fn r#ref(&self, name: impl Into<String>) -> GitRef {
10236 let mut query = self.selection.select("ref");
10237 query = query.arg("name", name.into());
10238 GitRef {
10239 proc: self.proc.clone(),
10240 selection: query,
10241 graphql_client: self.graphql_client.clone(),
10242 }
10243 }
10244 pub fn tag(&self, name: impl Into<String>) -> GitRef {
10250 let mut query = self.selection.select("tag");
10251 query = query.arg("name", name.into());
10252 GitRef {
10253 proc: self.proc.clone(),
10254 selection: query,
10255 graphql_client: self.graphql_client.clone(),
10256 }
10257 }
10258 pub async fn tags(&self) -> Result<Vec<String>, DaggerError> {
10264 let query = self.selection.select("tags");
10265 query.execute(self.graphql_client.clone()).await
10266 }
10267 pub async fn tags_opts<'a>(
10273 &self,
10274 opts: GitRepositoryTagsOpts<'a>,
10275 ) -> Result<Vec<String>, DaggerError> {
10276 let mut query = self.selection.select("tags");
10277 if let Some(patterns) = opts.patterns {
10278 query = query.arg("patterns", patterns);
10279 }
10280 query.execute(self.graphql_client.clone()).await
10281 }
10282 pub fn uncommitted(&self) -> Changeset {
10284 let query = self.selection.select("uncommitted");
10285 Changeset {
10286 proc: self.proc.clone(),
10287 selection: query,
10288 graphql_client: self.graphql_client.clone(),
10289 }
10290 }
10291 pub async fn url(&self) -> Result<String, DaggerError> {
10293 let query = self.selection.select("url");
10294 query.execute(self.graphql_client.clone()).await
10295 }
10296}
10297impl Node for GitRepository {
10298 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10299 let query = self.selection.select("id");
10300 let graphql_client = self.graphql_client.clone();
10301 async move { query.execute(graphql_client).await }
10302 }
10303}
10304#[derive(Clone)]
10305pub struct HttpState {
10306 pub proc: Option<Arc<DaggerSessionProc>>,
10307 pub selection: Selection,
10308 pub graphql_client: DynGraphQLClient,
10309}
10310impl IntoID<Id> for HttpState {
10311 fn into_id(
10312 self,
10313 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10314 Box::pin(async move { self.id().await })
10315 }
10316}
10317impl Loadable for HttpState {
10318 fn graphql_type() -> &'static str {
10319 "HTTPState"
10320 }
10321 fn from_query(
10322 proc: Option<Arc<DaggerSessionProc>>,
10323 selection: Selection,
10324 graphql_client: DynGraphQLClient,
10325 ) -> Self {
10326 Self {
10327 proc,
10328 selection,
10329 graphql_client,
10330 }
10331 }
10332}
10333impl HttpState {
10334 pub async fn id(&self) -> Result<Id, DaggerError> {
10336 let query = self.selection.select("id");
10337 query.execute(self.graphql_client.clone()).await
10338 }
10339}
10340impl Node for HttpState {
10341 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10342 let query = self.selection.select("id");
10343 let graphql_client = self.graphql_client.clone();
10344 async move { query.execute(graphql_client).await }
10345 }
10346}
10347#[derive(Clone)]
10348pub struct HealthcheckConfig {
10349 pub proc: Option<Arc<DaggerSessionProc>>,
10350 pub selection: Selection,
10351 pub graphql_client: DynGraphQLClient,
10352}
10353impl IntoID<Id> for HealthcheckConfig {
10354 fn into_id(
10355 self,
10356 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10357 Box::pin(async move { self.id().await })
10358 }
10359}
10360impl Loadable for HealthcheckConfig {
10361 fn graphql_type() -> &'static str {
10362 "HealthcheckConfig"
10363 }
10364 fn from_query(
10365 proc: Option<Arc<DaggerSessionProc>>,
10366 selection: Selection,
10367 graphql_client: DynGraphQLClient,
10368 ) -> Self {
10369 Self {
10370 proc,
10371 selection,
10372 graphql_client,
10373 }
10374 }
10375}
10376impl HealthcheckConfig {
10377 pub async fn args(&self) -> Result<Vec<String>, DaggerError> {
10379 let query = self.selection.select("args");
10380 query.execute(self.graphql_client.clone()).await
10381 }
10382 pub async fn id(&self) -> Result<Id, DaggerError> {
10384 let query = self.selection.select("id");
10385 query.execute(self.graphql_client.clone()).await
10386 }
10387 pub async fn interval(&self) -> Result<String, DaggerError> {
10389 let query = self.selection.select("interval");
10390 query.execute(self.graphql_client.clone()).await
10391 }
10392 pub async fn retries(&self) -> Result<isize, DaggerError> {
10394 let query = self.selection.select("retries");
10395 query.execute(self.graphql_client.clone()).await
10396 }
10397 pub async fn shell(&self) -> Result<bool, DaggerError> {
10399 let query = self.selection.select("shell");
10400 query.execute(self.graphql_client.clone()).await
10401 }
10402 pub async fn start_interval(&self) -> Result<String, DaggerError> {
10404 let query = self.selection.select("startInterval");
10405 query.execute(self.graphql_client.clone()).await
10406 }
10407 pub async fn start_period(&self) -> Result<String, DaggerError> {
10409 let query = self.selection.select("startPeriod");
10410 query.execute(self.graphql_client.clone()).await
10411 }
10412 pub async fn timeout(&self) -> Result<String, DaggerError> {
10414 let query = self.selection.select("timeout");
10415 query.execute(self.graphql_client.clone()).await
10416 }
10417}
10418impl Node for HealthcheckConfig {
10419 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10420 let query = self.selection.select("id");
10421 let graphql_client = self.graphql_client.clone();
10422 async move { query.execute(graphql_client).await }
10423 }
10424}
10425#[derive(Clone)]
10426pub struct Host {
10427 pub proc: Option<Arc<DaggerSessionProc>>,
10428 pub selection: Selection,
10429 pub graphql_client: DynGraphQLClient,
10430}
10431#[derive(Builder, Debug, PartialEq)]
10432pub struct HostDirectoryOpts<'a> {
10433 #[builder(setter(into, strip_option), default)]
10435 pub exclude: Option<Vec<&'a str>>,
10436 #[builder(setter(into, strip_option), default)]
10438 pub gitignore: Option<bool>,
10439 #[builder(setter(into, strip_option), default)]
10441 pub include: Option<Vec<&'a str>>,
10442 #[builder(setter(into, strip_option), default)]
10444 pub no_cache: Option<bool>,
10445}
10446#[derive(Builder, Debug, PartialEq)]
10447pub struct HostFileOpts {
10448 #[builder(setter(into, strip_option), default)]
10450 pub no_cache: Option<bool>,
10451}
10452#[derive(Builder, Debug, PartialEq)]
10453pub struct HostFindUpOpts {
10454 #[builder(setter(into, strip_option), default)]
10455 pub no_cache: Option<bool>,
10456}
10457#[derive(Builder, Debug, PartialEq)]
10458pub struct HostServiceOpts<'a> {
10459 #[builder(setter(into, strip_option), default)]
10461 pub host: Option<&'a str>,
10462}
10463#[derive(Builder, Debug, PartialEq)]
10464pub struct HostTunnelOpts {
10465 #[builder(setter(into, strip_option), default)]
10468 pub native: Option<bool>,
10469 #[builder(setter(into, strip_option), default)]
10474 pub ports: Option<Vec<PortForward>>,
10475}
10476impl IntoID<Id> for Host {
10477 fn into_id(
10478 self,
10479 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10480 Box::pin(async move { self.id().await })
10481 }
10482}
10483impl Loadable for Host {
10484 fn graphql_type() -> &'static str {
10485 "Host"
10486 }
10487 fn from_query(
10488 proc: Option<Arc<DaggerSessionProc>>,
10489 selection: Selection,
10490 graphql_client: DynGraphQLClient,
10491 ) -> Self {
10492 Self {
10493 proc,
10494 selection,
10495 graphql_client,
10496 }
10497 }
10498}
10499impl Host {
10500 pub fn container_image(&self, name: impl Into<String>) -> Container {
10506 let mut query = self.selection.select("containerImage");
10507 query = query.arg("name", name.into());
10508 Container {
10509 proc: self.proc.clone(),
10510 selection: query,
10511 graphql_client: self.graphql_client.clone(),
10512 }
10513 }
10514 pub fn directory(&self, path: impl Into<String>) -> Directory {
10521 let mut query = self.selection.select("directory");
10522 query = query.arg("path", path.into());
10523 Directory {
10524 proc: self.proc.clone(),
10525 selection: query,
10526 graphql_client: self.graphql_client.clone(),
10527 }
10528 }
10529 pub fn directory_opts<'a>(
10536 &self,
10537 path: impl Into<String>,
10538 opts: HostDirectoryOpts<'a>,
10539 ) -> Directory {
10540 let mut query = self.selection.select("directory");
10541 query = query.arg("path", path.into());
10542 if let Some(exclude) = opts.exclude {
10543 query = query.arg("exclude", exclude);
10544 }
10545 if let Some(include) = opts.include {
10546 query = query.arg("include", include);
10547 }
10548 if let Some(no_cache) = opts.no_cache {
10549 query = query.arg("noCache", no_cache);
10550 }
10551 if let Some(gitignore) = opts.gitignore {
10552 query = query.arg("gitignore", gitignore);
10553 }
10554 Directory {
10555 proc: self.proc.clone(),
10556 selection: query,
10557 graphql_client: self.graphql_client.clone(),
10558 }
10559 }
10560 pub fn file(&self, path: impl Into<String>) -> File {
10567 let mut query = self.selection.select("file");
10568 query = query.arg("path", path.into());
10569 File {
10570 proc: self.proc.clone(),
10571 selection: query,
10572 graphql_client: self.graphql_client.clone(),
10573 }
10574 }
10575 pub fn file_opts(&self, path: impl Into<String>, opts: HostFileOpts) -> File {
10582 let mut query = self.selection.select("file");
10583 query = query.arg("path", path.into());
10584 if let Some(no_cache) = opts.no_cache {
10585 query = query.arg("noCache", no_cache);
10586 }
10587 File {
10588 proc: self.proc.clone(),
10589 selection: query,
10590 graphql_client: self.graphql_client.clone(),
10591 }
10592 }
10593 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
10600 let mut query = self.selection.select("findUp");
10601 query = query.arg("name", name.into());
10602 query.execute(self.graphql_client.clone()).await
10603 }
10604 pub async fn find_up_opts(
10611 &self,
10612 name: impl Into<String>,
10613 opts: HostFindUpOpts,
10614 ) -> Result<String, DaggerError> {
10615 let mut query = self.selection.select("findUp");
10616 query = query.arg("name", name.into());
10617 if let Some(no_cache) = opts.no_cache {
10618 query = query.arg("noCache", no_cache);
10619 }
10620 query.execute(self.graphql_client.clone()).await
10621 }
10622 pub async fn id(&self) -> Result<Id, DaggerError> {
10624 let query = self.selection.select("id");
10625 query.execute(self.graphql_client.clone()).await
10626 }
10627 pub fn service(&self, ports: Vec<PortForward>) -> Service {
10638 let mut query = self.selection.select("service");
10639 query = query.arg("ports", ports);
10640 Service {
10641 proc: self.proc.clone(),
10642 selection: query,
10643 graphql_client: self.graphql_client.clone(),
10644 }
10645 }
10646 pub fn service_opts<'a>(&self, ports: Vec<PortForward>, opts: HostServiceOpts<'a>) -> Service {
10657 let mut query = self.selection.select("service");
10658 query = query.arg("ports", ports);
10659 if let Some(host) = opts.host {
10660 query = query.arg("host", host);
10661 }
10662 Service {
10663 proc: self.proc.clone(),
10664 selection: query,
10665 graphql_client: self.graphql_client.clone(),
10666 }
10667 }
10668 pub fn tunnel(&self, service: impl IntoID<Id>) -> Service {
10675 let mut query = self.selection.select("tunnel");
10676 query = query.arg_lazy(
10677 "service",
10678 Box::new(move || {
10679 let service = service.clone();
10680 Box::pin(async move { service.into_id().await.unwrap().quote() })
10681 }),
10682 );
10683 Service {
10684 proc: self.proc.clone(),
10685 selection: query,
10686 graphql_client: self.graphql_client.clone(),
10687 }
10688 }
10689 pub fn tunnel_opts(&self, service: impl IntoID<Id>, opts: HostTunnelOpts) -> Service {
10696 let mut query = self.selection.select("tunnel");
10697 query = query.arg_lazy(
10698 "service",
10699 Box::new(move || {
10700 let service = service.clone();
10701 Box::pin(async move { service.into_id().await.unwrap().quote() })
10702 }),
10703 );
10704 if let Some(native) = opts.native {
10705 query = query.arg("native", native);
10706 }
10707 if let Some(ports) = opts.ports {
10708 query = query.arg("ports", ports);
10709 }
10710 Service {
10711 proc: self.proc.clone(),
10712 selection: query,
10713 graphql_client: self.graphql_client.clone(),
10714 }
10715 }
10716 pub fn unix_socket(&self, path: impl Into<String>) -> Socket {
10722 let mut query = self.selection.select("unixSocket");
10723 query = query.arg("path", path.into());
10724 Socket {
10725 proc: self.proc.clone(),
10726 selection: query,
10727 graphql_client: self.graphql_client.clone(),
10728 }
10729 }
10730}
10731impl Node for Host {
10732 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10733 let query = self.selection.select("id");
10734 let graphql_client = self.graphql_client.clone();
10735 async move { query.execute(graphql_client).await }
10736 }
10737}
10738#[derive(Clone)]
10739pub struct InputTypeDef {
10740 pub proc: Option<Arc<DaggerSessionProc>>,
10741 pub selection: Selection,
10742 pub graphql_client: DynGraphQLClient,
10743}
10744impl IntoID<Id> for InputTypeDef {
10745 fn into_id(
10746 self,
10747 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10748 Box::pin(async move { self.id().await })
10749 }
10750}
10751impl Loadable for InputTypeDef {
10752 fn graphql_type() -> &'static str {
10753 "InputTypeDef"
10754 }
10755 fn from_query(
10756 proc: Option<Arc<DaggerSessionProc>>,
10757 selection: Selection,
10758 graphql_client: DynGraphQLClient,
10759 ) -> Self {
10760 Self {
10761 proc,
10762 selection,
10763 graphql_client,
10764 }
10765 }
10766}
10767impl InputTypeDef {
10768 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
10770 let query = self.selection.select("fields");
10771 let query = query.select("id");
10772 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10773 Ok(ids
10774 .into_iter()
10775 .map(|id| FieldTypeDef {
10776 proc: self.proc.clone(),
10777 selection: crate::querybuilder::query()
10778 .select("node")
10779 .arg("id", &id.0)
10780 .inline_fragment("FieldTypeDef"),
10781 graphql_client: self.graphql_client.clone(),
10782 })
10783 .collect())
10784 }
10785 pub async fn id(&self) -> Result<Id, DaggerError> {
10787 let query = self.selection.select("id");
10788 query.execute(self.graphql_client.clone()).await
10789 }
10790 pub async fn name(&self) -> Result<String, DaggerError> {
10792 let query = self.selection.select("name");
10793 query.execute(self.graphql_client.clone()).await
10794 }
10795}
10796impl Node for InputTypeDef {
10797 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10798 let query = self.selection.select("id");
10799 let graphql_client = self.graphql_client.clone();
10800 async move { query.execute(graphql_client).await }
10801 }
10802}
10803#[derive(Clone)]
10804pub struct InterfaceTypeDef {
10805 pub proc: Option<Arc<DaggerSessionProc>>,
10806 pub selection: Selection,
10807 pub graphql_client: DynGraphQLClient,
10808}
10809impl IntoID<Id> for InterfaceTypeDef {
10810 fn into_id(
10811 self,
10812 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10813 Box::pin(async move { self.id().await })
10814 }
10815}
10816impl Loadable for InterfaceTypeDef {
10817 fn graphql_type() -> &'static str {
10818 "InterfaceTypeDef"
10819 }
10820 fn from_query(
10821 proc: Option<Arc<DaggerSessionProc>>,
10822 selection: Selection,
10823 graphql_client: DynGraphQLClient,
10824 ) -> Self {
10825 Self {
10826 proc,
10827 selection,
10828 graphql_client,
10829 }
10830 }
10831}
10832impl InterfaceTypeDef {
10833 pub async fn description(&self) -> Result<String, DaggerError> {
10835 let query = self.selection.select("description");
10836 query.execute(self.graphql_client.clone()).await
10837 }
10838 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
10840 let query = self.selection.select("functions");
10841 let query = query.select("id");
10842 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10843 Ok(ids
10844 .into_iter()
10845 .map(|id| Function {
10846 proc: self.proc.clone(),
10847 selection: crate::querybuilder::query()
10848 .select("node")
10849 .arg("id", &id.0)
10850 .inline_fragment("Function"),
10851 graphql_client: self.graphql_client.clone(),
10852 })
10853 .collect())
10854 }
10855 pub async fn id(&self) -> Result<Id, DaggerError> {
10857 let query = self.selection.select("id");
10858 query.execute(self.graphql_client.clone()).await
10859 }
10860 pub async fn name(&self) -> Result<String, DaggerError> {
10862 let query = self.selection.select("name");
10863 query.execute(self.graphql_client.clone()).await
10864 }
10865 pub fn source_map(&self) -> SourceMap {
10867 let query = self.selection.select("sourceMap");
10868 SourceMap {
10869 proc: self.proc.clone(),
10870 selection: query,
10871 graphql_client: self.graphql_client.clone(),
10872 }
10873 }
10874 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
10876 let query = self.selection.select("sourceModuleName");
10877 query.execute(self.graphql_client.clone()).await
10878 }
10879}
10880impl Node for InterfaceTypeDef {
10881 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
10882 let query = self.selection.select("id");
10883 let graphql_client = self.graphql_client.clone();
10884 async move { query.execute(graphql_client).await }
10885 }
10886}
10887#[derive(Clone)]
10888pub struct JsonValue {
10889 pub proc: Option<Arc<DaggerSessionProc>>,
10890 pub selection: Selection,
10891 pub graphql_client: DynGraphQLClient,
10892}
10893#[derive(Builder, Debug, PartialEq)]
10894pub struct JsonValueContentsOpts<'a> {
10895 #[builder(setter(into, strip_option), default)]
10897 pub indent: Option<&'a str>,
10898 #[builder(setter(into, strip_option), default)]
10900 pub pretty: Option<bool>,
10901}
10902impl IntoID<Id> for JsonValue {
10903 fn into_id(
10904 self,
10905 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
10906 Box::pin(async move { self.id().await })
10907 }
10908}
10909impl Loadable for JsonValue {
10910 fn graphql_type() -> &'static str {
10911 "JSONValue"
10912 }
10913 fn from_query(
10914 proc: Option<Arc<DaggerSessionProc>>,
10915 selection: Selection,
10916 graphql_client: DynGraphQLClient,
10917 ) -> Self {
10918 Self {
10919 proc,
10920 selection,
10921 graphql_client,
10922 }
10923 }
10924}
10925impl JsonValue {
10926 pub async fn as_array(&self) -> Result<Vec<JsonValue>, DaggerError> {
10928 let query = self.selection.select("asArray");
10929 let query = query.select("id");
10930 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
10931 Ok(ids
10932 .into_iter()
10933 .map(|id| JsonValue {
10934 proc: self.proc.clone(),
10935 selection: crate::querybuilder::query()
10936 .select("node")
10937 .arg("id", &id.0)
10938 .inline_fragment("JSONValue"),
10939 graphql_client: self.graphql_client.clone(),
10940 })
10941 .collect())
10942 }
10943 pub async fn as_boolean(&self) -> Result<bool, DaggerError> {
10945 let query = self.selection.select("asBoolean");
10946 query.execute(self.graphql_client.clone()).await
10947 }
10948 pub async fn as_integer(&self) -> Result<isize, DaggerError> {
10950 let query = self.selection.select("asInteger");
10951 query.execute(self.graphql_client.clone()).await
10952 }
10953 pub async fn as_string(&self) -> Result<String, DaggerError> {
10955 let query = self.selection.select("asString");
10956 query.execute(self.graphql_client.clone()).await
10957 }
10958 pub async fn contents(&self) -> Result<Json, DaggerError> {
10964 let query = self.selection.select("contents");
10965 query.execute(self.graphql_client.clone()).await
10966 }
10967 pub async fn contents_opts<'a>(
10973 &self,
10974 opts: JsonValueContentsOpts<'a>,
10975 ) -> Result<Json, DaggerError> {
10976 let mut query = self.selection.select("contents");
10977 if let Some(pretty) = opts.pretty {
10978 query = query.arg("pretty", pretty);
10979 }
10980 if let Some(indent) = opts.indent {
10981 query = query.arg("indent", indent);
10982 }
10983 query.execute(self.graphql_client.clone()).await
10984 }
10985 pub fn field(&self, path: Vec<impl Into<String>>) -> JsonValue {
10991 let mut query = self.selection.select("field");
10992 query = query.arg(
10993 "path",
10994 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
10995 );
10996 JsonValue {
10997 proc: self.proc.clone(),
10998 selection: query,
10999 graphql_client: self.graphql_client.clone(),
11000 }
11001 }
11002 pub async fn fields(&self) -> Result<Vec<String>, DaggerError> {
11004 let query = self.selection.select("fields");
11005 query.execute(self.graphql_client.clone()).await
11006 }
11007 pub async fn id(&self) -> Result<Id, DaggerError> {
11009 let query = self.selection.select("id");
11010 query.execute(self.graphql_client.clone()).await
11011 }
11012 pub fn new_boolean(&self, value: bool) -> JsonValue {
11018 let mut query = self.selection.select("newBoolean");
11019 query = query.arg("value", value);
11020 JsonValue {
11021 proc: self.proc.clone(),
11022 selection: query,
11023 graphql_client: self.graphql_client.clone(),
11024 }
11025 }
11026 pub fn new_integer(&self, value: isize) -> JsonValue {
11032 let mut query = self.selection.select("newInteger");
11033 query = query.arg("value", value);
11034 JsonValue {
11035 proc: self.proc.clone(),
11036 selection: query,
11037 graphql_client: self.graphql_client.clone(),
11038 }
11039 }
11040 pub fn new_string(&self, value: impl Into<String>) -> JsonValue {
11046 let mut query = self.selection.select("newString");
11047 query = query.arg("value", value.into());
11048 JsonValue {
11049 proc: self.proc.clone(),
11050 selection: query,
11051 graphql_client: self.graphql_client.clone(),
11052 }
11053 }
11054 pub fn with_contents(&self, contents: Json) -> JsonValue {
11060 let mut query = self.selection.select("withContents");
11061 query = query.arg("contents", contents);
11062 JsonValue {
11063 proc: self.proc.clone(),
11064 selection: query,
11065 graphql_client: self.graphql_client.clone(),
11066 }
11067 }
11068 pub fn with_field(&self, path: Vec<impl Into<String>>, value: impl IntoID<Id>) -> JsonValue {
11075 let mut query = self.selection.select("withField");
11076 query = query.arg(
11077 "path",
11078 path.into_iter().map(|i| i.into()).collect::<Vec<String>>(),
11079 );
11080 query = query.arg_lazy(
11081 "value",
11082 Box::new(move || {
11083 let value = value.clone();
11084 Box::pin(async move { value.into_id().await.unwrap().quote() })
11085 }),
11086 );
11087 JsonValue {
11088 proc: self.proc.clone(),
11089 selection: query,
11090 graphql_client: self.graphql_client.clone(),
11091 }
11092 }
11093}
11094impl Node for JsonValue {
11095 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11096 let query = self.selection.select("id");
11097 let graphql_client = self.graphql_client.clone();
11098 async move { query.execute(graphql_client).await }
11099 }
11100}
11101#[derive(Clone)]
11102pub struct Llm {
11103 pub proc: Option<Arc<DaggerSessionProc>>,
11104 pub selection: Selection,
11105 pub graphql_client: DynGraphQLClient,
11106}
11107impl IntoID<Id> for Llm {
11108 fn into_id(
11109 self,
11110 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11111 Box::pin(async move { self.id().await })
11112 }
11113}
11114impl Loadable for Llm {
11115 fn graphql_type() -> &'static str {
11116 "LLM"
11117 }
11118 fn from_query(
11119 proc: Option<Arc<DaggerSessionProc>>,
11120 selection: Selection,
11121 graphql_client: DynGraphQLClient,
11122 ) -> Self {
11123 Self {
11124 proc,
11125 selection,
11126 graphql_client,
11127 }
11128 }
11129}
11130impl Llm {
11131 pub fn attempt(&self, number: isize) -> Llm {
11133 let mut query = self.selection.select("attempt");
11134 query = query.arg("number", number);
11135 Llm {
11136 proc: self.proc.clone(),
11137 selection: query,
11138 graphql_client: self.graphql_client.clone(),
11139 }
11140 }
11141 pub fn bind_result(&self, name: impl Into<String>) -> Binding {
11143 let mut query = self.selection.select("bindResult");
11144 query = query.arg("name", name.into());
11145 Binding {
11146 proc: self.proc.clone(),
11147 selection: query,
11148 graphql_client: self.graphql_client.clone(),
11149 }
11150 }
11151 pub fn env(&self) -> Env {
11153 let query = self.selection.select("env");
11154 Env {
11155 proc: self.proc.clone(),
11156 selection: query,
11157 graphql_client: self.graphql_client.clone(),
11158 }
11159 }
11160 pub async fn has_prompt(&self) -> Result<bool, DaggerError> {
11162 let query = self.selection.select("hasPrompt");
11163 query.execute(self.graphql_client.clone()).await
11164 }
11165 pub async fn history(&self) -> Result<Vec<String>, DaggerError> {
11167 let query = self.selection.select("history");
11168 query.execute(self.graphql_client.clone()).await
11169 }
11170 pub async fn history_json(&self) -> Result<Json, DaggerError> {
11172 let query = self.selection.select("historyJSON");
11173 query.execute(self.graphql_client.clone()).await
11174 }
11175 pub async fn id(&self) -> Result<Id, DaggerError> {
11177 let query = self.selection.select("id");
11178 query.execute(self.graphql_client.clone()).await
11179 }
11180 pub async fn last_reply(&self) -> Result<String, DaggerError> {
11182 let query = self.selection.select("lastReply");
11183 query.execute(self.graphql_client.clone()).await
11184 }
11185 pub fn r#loop(&self) -> Llm {
11187 let query = self.selection.select("loop");
11188 Llm {
11189 proc: self.proc.clone(),
11190 selection: query,
11191 graphql_client: self.graphql_client.clone(),
11192 }
11193 }
11194 pub async fn model(&self) -> Result<String, DaggerError> {
11196 let query = self.selection.select("model");
11197 query.execute(self.graphql_client.clone()).await
11198 }
11199 pub async fn provider(&self) -> Result<String, DaggerError> {
11201 let query = self.selection.select("provider");
11202 query.execute(self.graphql_client.clone()).await
11203 }
11204 pub async fn step(&self) -> Result<Llm, DaggerError> {
11206 let query = self.selection.select("step");
11207 let id: Id = query.execute(self.graphql_client.clone()).await?;
11208 Ok(Llm {
11209 proc: self.proc.clone(),
11210 selection: query
11211 .root()
11212 .select("node")
11213 .arg("id", &id.0)
11214 .inline_fragment("LLM"),
11215 graphql_client: self.graphql_client.clone(),
11216 })
11217 }
11218 pub async fn sync(&self) -> Result<Llm, DaggerError> {
11220 let query = self.selection.select("sync");
11221 let id: Id = query.execute(self.graphql_client.clone()).await?;
11222 Ok(Llm {
11223 proc: self.proc.clone(),
11224 selection: query
11225 .root()
11226 .select("node")
11227 .arg("id", &id.0)
11228 .inline_fragment("LLM"),
11229 graphql_client: self.graphql_client.clone(),
11230 })
11231 }
11232 pub fn token_usage(&self) -> LlmTokenUsage {
11234 let query = self.selection.select("tokenUsage");
11235 LlmTokenUsage {
11236 proc: self.proc.clone(),
11237 selection: query,
11238 graphql_client: self.graphql_client.clone(),
11239 }
11240 }
11241 pub async fn tools(&self) -> Result<String, DaggerError> {
11243 let query = self.selection.select("tools");
11244 query.execute(self.graphql_client.clone()).await
11245 }
11246 pub fn with_blocked_function(
11255 &self,
11256 type_name: impl Into<String>,
11257 function: impl Into<String>,
11258 ) -> Llm {
11259 let mut query = self.selection.select("withBlockedFunction");
11260 query = query.arg("typeName", type_name.into());
11261 query = query.arg("function", function.into());
11262 Llm {
11263 proc: self.proc.clone(),
11264 selection: query,
11265 graphql_client: self.graphql_client.clone(),
11266 }
11267 }
11268 pub fn with_env(&self, env: impl IntoID<Id>) -> Llm {
11270 let mut query = self.selection.select("withEnv");
11271 query = query.arg_lazy(
11272 "env",
11273 Box::new(move || {
11274 let env = env.clone();
11275 Box::pin(async move { env.into_id().await.unwrap().quote() })
11276 }),
11277 );
11278 Llm {
11279 proc: self.proc.clone(),
11280 selection: query,
11281 graphql_client: self.graphql_client.clone(),
11282 }
11283 }
11284 pub fn with_mcp_server(&self, name: impl Into<String>, service: impl IntoID<Id>) -> Llm {
11291 let mut query = self.selection.select("withMCPServer");
11292 query = query.arg("name", name.into());
11293 query = query.arg_lazy(
11294 "service",
11295 Box::new(move || {
11296 let service = service.clone();
11297 Box::pin(async move { service.into_id().await.unwrap().quote() })
11298 }),
11299 );
11300 Llm {
11301 proc: self.proc.clone(),
11302 selection: query,
11303 graphql_client: self.graphql_client.clone(),
11304 }
11305 }
11306 pub fn with_model(&self, model: impl Into<String>) -> Llm {
11312 let mut query = self.selection.select("withModel");
11313 query = query.arg("model", model.into());
11314 Llm {
11315 proc: self.proc.clone(),
11316 selection: query,
11317 graphql_client: self.graphql_client.clone(),
11318 }
11319 }
11320 pub fn with_prompt(&self, prompt: impl Into<String>) -> Llm {
11326 let mut query = self.selection.select("withPrompt");
11327 query = query.arg("prompt", prompt.into());
11328 Llm {
11329 proc: self.proc.clone(),
11330 selection: query,
11331 graphql_client: self.graphql_client.clone(),
11332 }
11333 }
11334 pub fn with_prompt_file(&self, file: impl IntoID<Id>) -> Llm {
11340 let mut query = self.selection.select("withPromptFile");
11341 query = query.arg_lazy(
11342 "file",
11343 Box::new(move || {
11344 let file = file.clone();
11345 Box::pin(async move { file.into_id().await.unwrap().quote() })
11346 }),
11347 );
11348 Llm {
11349 proc: self.proc.clone(),
11350 selection: query,
11351 graphql_client: self.graphql_client.clone(),
11352 }
11353 }
11354 pub fn with_static_tools(&self) -> Llm {
11356 let query = self.selection.select("withStaticTools");
11357 Llm {
11358 proc: self.proc.clone(),
11359 selection: query,
11360 graphql_client: self.graphql_client.clone(),
11361 }
11362 }
11363 pub fn with_system_prompt(&self, prompt: impl Into<String>) -> Llm {
11369 let mut query = self.selection.select("withSystemPrompt");
11370 query = query.arg("prompt", prompt.into());
11371 Llm {
11372 proc: self.proc.clone(),
11373 selection: query,
11374 graphql_client: self.graphql_client.clone(),
11375 }
11376 }
11377 pub fn without_default_system_prompt(&self) -> Llm {
11379 let query = self.selection.select("withoutDefaultSystemPrompt");
11380 Llm {
11381 proc: self.proc.clone(),
11382 selection: query,
11383 graphql_client: self.graphql_client.clone(),
11384 }
11385 }
11386 pub fn without_message_history(&self) -> Llm {
11388 let query = self.selection.select("withoutMessageHistory");
11389 Llm {
11390 proc: self.proc.clone(),
11391 selection: query,
11392 graphql_client: self.graphql_client.clone(),
11393 }
11394 }
11395 pub fn without_system_prompts(&self) -> Llm {
11397 let query = self.selection.select("withoutSystemPrompts");
11398 Llm {
11399 proc: self.proc.clone(),
11400 selection: query,
11401 graphql_client: self.graphql_client.clone(),
11402 }
11403 }
11404}
11405impl Node for Llm {
11406 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11407 let query = self.selection.select("id");
11408 let graphql_client = self.graphql_client.clone();
11409 async move { query.execute(graphql_client).await }
11410 }
11411}
11412impl Syncer for Llm {
11413 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11414 let query = self.selection.select("id");
11415 let graphql_client = self.graphql_client.clone();
11416 async move { query.execute(graphql_client).await }
11417 }
11418 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11419 let query = self.selection.select("sync");
11420 let graphql_client = self.graphql_client.clone();
11421 async move { query.execute(graphql_client).await }
11422 }
11423}
11424#[derive(Clone)]
11425pub struct LlmTokenUsage {
11426 pub proc: Option<Arc<DaggerSessionProc>>,
11427 pub selection: Selection,
11428 pub graphql_client: DynGraphQLClient,
11429}
11430impl IntoID<Id> for LlmTokenUsage {
11431 fn into_id(
11432 self,
11433 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11434 Box::pin(async move { self.id().await })
11435 }
11436}
11437impl Loadable for LlmTokenUsage {
11438 fn graphql_type() -> &'static str {
11439 "LLMTokenUsage"
11440 }
11441 fn from_query(
11442 proc: Option<Arc<DaggerSessionProc>>,
11443 selection: Selection,
11444 graphql_client: DynGraphQLClient,
11445 ) -> Self {
11446 Self {
11447 proc,
11448 selection,
11449 graphql_client,
11450 }
11451 }
11452}
11453impl LlmTokenUsage {
11454 pub async fn cached_token_reads(&self) -> Result<isize, DaggerError> {
11455 let query = self.selection.select("cachedTokenReads");
11456 query.execute(self.graphql_client.clone()).await
11457 }
11458 pub async fn cached_token_writes(&self) -> Result<isize, DaggerError> {
11459 let query = self.selection.select("cachedTokenWrites");
11460 query.execute(self.graphql_client.clone()).await
11461 }
11462 pub async fn id(&self) -> Result<Id, DaggerError> {
11464 let query = self.selection.select("id");
11465 query.execute(self.graphql_client.clone()).await
11466 }
11467 pub async fn input_tokens(&self) -> Result<isize, DaggerError> {
11468 let query = self.selection.select("inputTokens");
11469 query.execute(self.graphql_client.clone()).await
11470 }
11471 pub async fn output_tokens(&self) -> Result<isize, DaggerError> {
11472 let query = self.selection.select("outputTokens");
11473 query.execute(self.graphql_client.clone()).await
11474 }
11475 pub async fn total_tokens(&self) -> Result<isize, DaggerError> {
11476 let query = self.selection.select("totalTokens");
11477 query.execute(self.graphql_client.clone()).await
11478 }
11479}
11480impl Node for LlmTokenUsage {
11481 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11482 let query = self.selection.select("id");
11483 let graphql_client = self.graphql_client.clone();
11484 async move { query.execute(graphql_client).await }
11485 }
11486}
11487#[derive(Clone)]
11488pub struct Label {
11489 pub proc: Option<Arc<DaggerSessionProc>>,
11490 pub selection: Selection,
11491 pub graphql_client: DynGraphQLClient,
11492}
11493impl IntoID<Id> for Label {
11494 fn into_id(
11495 self,
11496 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11497 Box::pin(async move { self.id().await })
11498 }
11499}
11500impl Loadable for Label {
11501 fn graphql_type() -> &'static str {
11502 "Label"
11503 }
11504 fn from_query(
11505 proc: Option<Arc<DaggerSessionProc>>,
11506 selection: Selection,
11507 graphql_client: DynGraphQLClient,
11508 ) -> Self {
11509 Self {
11510 proc,
11511 selection,
11512 graphql_client,
11513 }
11514 }
11515}
11516impl Label {
11517 pub async fn id(&self) -> Result<Id, DaggerError> {
11519 let query = self.selection.select("id");
11520 query.execute(self.graphql_client.clone()).await
11521 }
11522 pub async fn name(&self) -> Result<String, DaggerError> {
11524 let query = self.selection.select("name");
11525 query.execute(self.graphql_client.clone()).await
11526 }
11527 pub async fn value(&self) -> Result<String, DaggerError> {
11529 let query = self.selection.select("value");
11530 query.execute(self.graphql_client.clone()).await
11531 }
11532}
11533impl Node for Label {
11534 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11535 let query = self.selection.select("id");
11536 let graphql_client = self.graphql_client.clone();
11537 async move { query.execute(graphql_client).await }
11538 }
11539}
11540#[derive(Clone)]
11541pub struct ListTypeDef {
11542 pub proc: Option<Arc<DaggerSessionProc>>,
11543 pub selection: Selection,
11544 pub graphql_client: DynGraphQLClient,
11545}
11546impl IntoID<Id> for ListTypeDef {
11547 fn into_id(
11548 self,
11549 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11550 Box::pin(async move { self.id().await })
11551 }
11552}
11553impl Loadable for ListTypeDef {
11554 fn graphql_type() -> &'static str {
11555 "ListTypeDef"
11556 }
11557 fn from_query(
11558 proc: Option<Arc<DaggerSessionProc>>,
11559 selection: Selection,
11560 graphql_client: DynGraphQLClient,
11561 ) -> Self {
11562 Self {
11563 proc,
11564 selection,
11565 graphql_client,
11566 }
11567 }
11568}
11569impl ListTypeDef {
11570 pub fn element_type_def(&self) -> TypeDef {
11572 let query = self.selection.select("elementTypeDef");
11573 TypeDef {
11574 proc: self.proc.clone(),
11575 selection: query,
11576 graphql_client: self.graphql_client.clone(),
11577 }
11578 }
11579 pub async fn id(&self) -> Result<Id, DaggerError> {
11581 let query = self.selection.select("id");
11582 query.execute(self.graphql_client.clone()).await
11583 }
11584}
11585impl Node for ListTypeDef {
11586 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
11587 let query = self.selection.select("id");
11588 let graphql_client = self.graphql_client.clone();
11589 async move { query.execute(graphql_client).await }
11590 }
11591}
11592#[derive(Clone)]
11593pub struct Module {
11594 pub proc: Option<Arc<DaggerSessionProc>>,
11595 pub selection: Selection,
11596 pub graphql_client: DynGraphQLClient,
11597}
11598#[derive(Builder, Debug, PartialEq)]
11599pub struct ModuleChecksOpts<'a> {
11600 #[builder(setter(into, strip_option), default)]
11602 pub include: Option<Vec<&'a str>>,
11603 #[builder(setter(into, strip_option), default)]
11605 pub no_generate: Option<bool>,
11606}
11607#[derive(Builder, Debug, PartialEq)]
11608pub struct ModuleGeneratorsOpts<'a> {
11609 #[builder(setter(into, strip_option), default)]
11611 pub include: Option<Vec<&'a str>>,
11612}
11613#[derive(Builder, Debug, PartialEq)]
11614pub struct ModuleServeOpts {
11615 #[builder(setter(into, strip_option), default)]
11617 pub entrypoint: Option<bool>,
11618 #[builder(setter(into, strip_option), default)]
11620 pub include_dependencies: Option<bool>,
11621}
11622#[derive(Builder, Debug, PartialEq)]
11623pub struct ModuleServicesOpts<'a> {
11624 #[builder(setter(into, strip_option), default)]
11626 pub include: Option<Vec<&'a str>>,
11627}
11628impl IntoID<Id> for Module {
11629 fn into_id(
11630 self,
11631 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
11632 Box::pin(async move { self.id().await })
11633 }
11634}
11635impl Loadable for Module {
11636 fn graphql_type() -> &'static str {
11637 "Module"
11638 }
11639 fn from_query(
11640 proc: Option<Arc<DaggerSessionProc>>,
11641 selection: Selection,
11642 graphql_client: DynGraphQLClient,
11643 ) -> Self {
11644 Self {
11645 proc,
11646 selection,
11647 graphql_client,
11648 }
11649 }
11650}
11651impl Module {
11652 pub fn check(&self, name: impl Into<String>) -> Check {
11658 let mut query = self.selection.select("check");
11659 query = query.arg("name", name.into());
11660 Check {
11661 proc: self.proc.clone(),
11662 selection: query,
11663 graphql_client: self.graphql_client.clone(),
11664 }
11665 }
11666 pub fn checks(&self) -> CheckGroup {
11672 let query = self.selection.select("checks");
11673 CheckGroup {
11674 proc: self.proc.clone(),
11675 selection: query,
11676 graphql_client: self.graphql_client.clone(),
11677 }
11678 }
11679 pub fn checks_opts<'a>(&self, opts: ModuleChecksOpts<'a>) -> CheckGroup {
11685 let mut query = self.selection.select("checks");
11686 if let Some(include) = opts.include {
11687 query = query.arg("include", include);
11688 }
11689 if let Some(no_generate) = opts.no_generate {
11690 query = query.arg("noGenerate", no_generate);
11691 }
11692 CheckGroup {
11693 proc: self.proc.clone(),
11694 selection: query,
11695 graphql_client: self.graphql_client.clone(),
11696 }
11697 }
11698 pub async fn dependencies(&self) -> Result<Vec<Module>, DaggerError> {
11700 let query = self.selection.select("dependencies");
11701 let query = query.select("id");
11702 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11703 Ok(ids
11704 .into_iter()
11705 .map(|id| Module {
11706 proc: self.proc.clone(),
11707 selection: crate::querybuilder::query()
11708 .select("node")
11709 .arg("id", &id.0)
11710 .inline_fragment("Module"),
11711 graphql_client: self.graphql_client.clone(),
11712 })
11713 .collect())
11714 }
11715 pub async fn description(&self) -> Result<String, DaggerError> {
11717 let query = self.selection.select("description");
11718 query.execute(self.graphql_client.clone()).await
11719 }
11720 pub async fn enums(&self) -> Result<Vec<TypeDef>, DaggerError> {
11722 let query = self.selection.select("enums");
11723 let query = query.select("id");
11724 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11725 Ok(ids
11726 .into_iter()
11727 .map(|id| TypeDef {
11728 proc: self.proc.clone(),
11729 selection: crate::querybuilder::query()
11730 .select("node")
11731 .arg("id", &id.0)
11732 .inline_fragment("TypeDef"),
11733 graphql_client: self.graphql_client.clone(),
11734 })
11735 .collect())
11736 }
11737 pub fn generated_context_directory(&self) -> Directory {
11739 let query = self.selection.select("generatedContextDirectory");
11740 Directory {
11741 proc: self.proc.clone(),
11742 selection: query,
11743 graphql_client: self.graphql_client.clone(),
11744 }
11745 }
11746 pub fn generator(&self, name: impl Into<String>) -> Generator {
11752 let mut query = self.selection.select("generator");
11753 query = query.arg("name", name.into());
11754 Generator {
11755 proc: self.proc.clone(),
11756 selection: query,
11757 graphql_client: self.graphql_client.clone(),
11758 }
11759 }
11760 pub fn generators(&self) -> GeneratorGroup {
11766 let query = self.selection.select("generators");
11767 GeneratorGroup {
11768 proc: self.proc.clone(),
11769 selection: query,
11770 graphql_client: self.graphql_client.clone(),
11771 }
11772 }
11773 pub fn generators_opts<'a>(&self, opts: ModuleGeneratorsOpts<'a>) -> GeneratorGroup {
11779 let mut query = self.selection.select("generators");
11780 if let Some(include) = opts.include {
11781 query = query.arg("include", include);
11782 }
11783 GeneratorGroup {
11784 proc: self.proc.clone(),
11785 selection: query,
11786 graphql_client: self.graphql_client.clone(),
11787 }
11788 }
11789 pub async fn id(&self) -> Result<Id, DaggerError> {
11791 let query = self.selection.select("id");
11792 query.execute(self.graphql_client.clone()).await
11793 }
11794 pub async fn interfaces(&self) -> Result<Vec<TypeDef>, DaggerError> {
11796 let query = self.selection.select("interfaces");
11797 let query = query.select("id");
11798 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11799 Ok(ids
11800 .into_iter()
11801 .map(|id| TypeDef {
11802 proc: self.proc.clone(),
11803 selection: crate::querybuilder::query()
11804 .select("node")
11805 .arg("id", &id.0)
11806 .inline_fragment("TypeDef"),
11807 graphql_client: self.graphql_client.clone(),
11808 })
11809 .collect())
11810 }
11811 pub fn introspection_schema_json(&self) -> File {
11815 let query = self.selection.select("introspectionSchemaJSON");
11816 File {
11817 proc: self.proc.clone(),
11818 selection: query,
11819 graphql_client: self.graphql_client.clone(),
11820 }
11821 }
11822 pub async fn name(&self) -> Result<String, DaggerError> {
11824 let query = self.selection.select("name");
11825 query.execute(self.graphql_client.clone()).await
11826 }
11827 pub async fn objects(&self) -> Result<Vec<TypeDef>, DaggerError> {
11829 let query = self.selection.select("objects");
11830 let query = query.select("id");
11831 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
11832 Ok(ids
11833 .into_iter()
11834 .map(|id| TypeDef {
11835 proc: self.proc.clone(),
11836 selection: crate::querybuilder::query()
11837 .select("node")
11838 .arg("id", &id.0)
11839 .inline_fragment("TypeDef"),
11840 graphql_client: self.graphql_client.clone(),
11841 })
11842 .collect())
11843 }
11844 pub fn runtime(&self) -> Container {
11846 let query = self.selection.select("runtime");
11847 Container {
11848 proc: self.proc.clone(),
11849 selection: query,
11850 graphql_client: self.graphql_client.clone(),
11851 }
11852 }
11853 pub fn sdk(&self) -> SdkConfig {
11855 let query = self.selection.select("sdk");
11856 SdkConfig {
11857 proc: self.proc.clone(),
11858 selection: query,
11859 graphql_client: self.graphql_client.clone(),
11860 }
11861 }
11862 pub async fn serve(&self) -> Result<Void, DaggerError> {
11869 let query = self.selection.select("serve");
11870 query.execute(self.graphql_client.clone()).await
11871 }
11872 pub async fn serve_opts(&self, opts: ModuleServeOpts) -> Result<Void, DaggerError> {
11879 let mut query = self.selection.select("serve");
11880 if let Some(include_dependencies) = opts.include_dependencies {
11881 query = query.arg("includeDependencies", include_dependencies);
11882 }
11883 if let Some(entrypoint) = opts.entrypoint {
11884 query = query.arg("entrypoint", entrypoint);
11885 }
11886 query.execute(self.graphql_client.clone()).await
11887 }
11888 pub fn services(&self) -> UpGroup {
11894 let query = self.selection.select("services");
11895 UpGroup {
11896 proc: self.proc.clone(),
11897 selection: query,
11898 graphql_client: self.graphql_client.clone(),
11899 }
11900 }
11901 pub fn services_opts<'a>(&self, opts: ModuleServicesOpts<'a>) -> UpGroup {
11907 let mut query = self.selection.select("services");
11908 if let Some(include) = opts.include {
11909 query = query.arg("include", include);
11910 }
11911 UpGroup {
11912 proc: self.proc.clone(),
11913 selection: query,
11914 graphql_client: self.graphql_client.clone(),
11915 }
11916 }
11917 pub fn source(&self) -> ModuleSource {
11919 let query = self.selection.select("source");
11920 ModuleSource {
11921 proc: self.proc.clone(),
11922 selection: query,
11923 graphql_client: self.graphql_client.clone(),
11924 }
11925 }
11926 pub async fn sync(&self) -> Result<Module, DaggerError> {
11928 let query = self.selection.select("sync");
11929 let id: Id = query.execute(self.graphql_client.clone()).await?;
11930 Ok(Module {
11931 proc: self.proc.clone(),
11932 selection: query
11933 .root()
11934 .select("node")
11935 .arg("id", &id.0)
11936 .inline_fragment("Module"),
11937 graphql_client: self.graphql_client.clone(),
11938 })
11939 }
11940 pub fn user_defaults(&self) -> EnvFile {
11942 let query = self.selection.select("userDefaults");
11943 EnvFile {
11944 proc: self.proc.clone(),
11945 selection: query,
11946 graphql_client: self.graphql_client.clone(),
11947 }
11948 }
11949 pub fn with_description(&self, description: impl Into<String>) -> Module {
11955 let mut query = self.selection.select("withDescription");
11956 query = query.arg("description", description.into());
11957 Module {
11958 proc: self.proc.clone(),
11959 selection: query,
11960 graphql_client: self.graphql_client.clone(),
11961 }
11962 }
11963 pub fn with_enum(&self, r#enum: impl IntoID<Id>) -> Module {
11965 let mut query = self.selection.select("withEnum");
11966 query = query.arg_lazy(
11967 "enum",
11968 Box::new(move || {
11969 let r#enum = r#enum.clone();
11970 Box::pin(async move { r#enum.into_id().await.unwrap().quote() })
11971 }),
11972 );
11973 Module {
11974 proc: self.proc.clone(),
11975 selection: query,
11976 graphql_client: self.graphql_client.clone(),
11977 }
11978 }
11979 pub fn with_interface(&self, iface: impl IntoID<Id>) -> Module {
11981 let mut query = self.selection.select("withInterface");
11982 query = query.arg_lazy(
11983 "iface",
11984 Box::new(move || {
11985 let iface = iface.clone();
11986 Box::pin(async move { iface.into_id().await.unwrap().quote() })
11987 }),
11988 );
11989 Module {
11990 proc: self.proc.clone(),
11991 selection: query,
11992 graphql_client: self.graphql_client.clone(),
11993 }
11994 }
11995 pub fn with_object(&self, object: impl IntoID<Id>) -> Module {
11997 let mut query = self.selection.select("withObject");
11998 query = query.arg_lazy(
11999 "object",
12000 Box::new(move || {
12001 let object = object.clone();
12002 Box::pin(async move { object.into_id().await.unwrap().quote() })
12003 }),
12004 );
12005 Module {
12006 proc: self.proc.clone(),
12007 selection: query,
12008 graphql_client: self.graphql_client.clone(),
12009 }
12010 }
12011}
12012impl Node for Module {
12013 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12014 let query = self.selection.select("id");
12015 let graphql_client = self.graphql_client.clone();
12016 async move { query.execute(graphql_client).await }
12017 }
12018}
12019impl Syncer for Module {
12020 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12021 let query = self.selection.select("id");
12022 let graphql_client = self.graphql_client.clone();
12023 async move { query.execute(graphql_client).await }
12024 }
12025 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12026 let query = self.selection.select("sync");
12027 let graphql_client = self.graphql_client.clone();
12028 async move { query.execute(graphql_client).await }
12029 }
12030}
12031#[derive(Clone)]
12032pub struct ModuleConfigClient {
12033 pub proc: Option<Arc<DaggerSessionProc>>,
12034 pub selection: Selection,
12035 pub graphql_client: DynGraphQLClient,
12036}
12037impl IntoID<Id> for ModuleConfigClient {
12038 fn into_id(
12039 self,
12040 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12041 Box::pin(async move { self.id().await })
12042 }
12043}
12044impl Loadable for ModuleConfigClient {
12045 fn graphql_type() -> &'static str {
12046 "ModuleConfigClient"
12047 }
12048 fn from_query(
12049 proc: Option<Arc<DaggerSessionProc>>,
12050 selection: Selection,
12051 graphql_client: DynGraphQLClient,
12052 ) -> Self {
12053 Self {
12054 proc,
12055 selection,
12056 graphql_client,
12057 }
12058 }
12059}
12060impl ModuleConfigClient {
12061 pub async fn directory(&self) -> Result<String, DaggerError> {
12063 let query = self.selection.select("directory");
12064 query.execute(self.graphql_client.clone()).await
12065 }
12066 pub async fn generator(&self) -> Result<String, DaggerError> {
12068 let query = self.selection.select("generator");
12069 query.execute(self.graphql_client.clone()).await
12070 }
12071 pub async fn id(&self) -> Result<Id, DaggerError> {
12073 let query = self.selection.select("id");
12074 query.execute(self.graphql_client.clone()).await
12075 }
12076}
12077impl Node for ModuleConfigClient {
12078 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12079 let query = self.selection.select("id");
12080 let graphql_client = self.graphql_client.clone();
12081 async move { query.execute(graphql_client).await }
12082 }
12083}
12084#[derive(Clone)]
12085pub struct ModuleSource {
12086 pub proc: Option<Arc<DaggerSessionProc>>,
12087 pub selection: Selection,
12088 pub graphql_client: DynGraphQLClient,
12089}
12090impl IntoID<Id> for ModuleSource {
12091 fn into_id(
12092 self,
12093 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12094 Box::pin(async move { self.id().await })
12095 }
12096}
12097impl Loadable for ModuleSource {
12098 fn graphql_type() -> &'static str {
12099 "ModuleSource"
12100 }
12101 fn from_query(
12102 proc: Option<Arc<DaggerSessionProc>>,
12103 selection: Selection,
12104 graphql_client: DynGraphQLClient,
12105 ) -> Self {
12106 Self {
12107 proc,
12108 selection,
12109 graphql_client,
12110 }
12111 }
12112}
12113impl ModuleSource {
12114 pub fn as_module(&self) -> Module {
12116 let query = self.selection.select("asModule");
12117 Module {
12118 proc: self.proc.clone(),
12119 selection: query,
12120 graphql_client: self.graphql_client.clone(),
12121 }
12122 }
12123 pub async fn as_string(&self) -> Result<String, DaggerError> {
12125 let query = self.selection.select("asString");
12126 query.execute(self.graphql_client.clone()).await
12127 }
12128 pub fn blueprint(&self) -> ModuleSource {
12130 let query = self.selection.select("blueprint");
12131 ModuleSource {
12132 proc: self.proc.clone(),
12133 selection: query,
12134 graphql_client: self.graphql_client.clone(),
12135 }
12136 }
12137 pub async fn clone_ref(&self) -> Result<String, DaggerError> {
12139 let query = self.selection.select("cloneRef");
12140 query.execute(self.graphql_client.clone()).await
12141 }
12142 pub async fn commit(&self) -> Result<String, DaggerError> {
12144 let query = self.selection.select("commit");
12145 query.execute(self.graphql_client.clone()).await
12146 }
12147 pub async fn config_clients(&self) -> Result<Vec<ModuleConfigClient>, DaggerError> {
12149 let query = self.selection.select("configClients");
12150 let query = query.select("id");
12151 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12152 Ok(ids
12153 .into_iter()
12154 .map(|id| ModuleConfigClient {
12155 proc: self.proc.clone(),
12156 selection: crate::querybuilder::query()
12157 .select("node")
12158 .arg("id", &id.0)
12159 .inline_fragment("ModuleConfigClient"),
12160 graphql_client: self.graphql_client.clone(),
12161 })
12162 .collect())
12163 }
12164 pub async fn config_exists(&self) -> Result<bool, DaggerError> {
12166 let query = self.selection.select("configExists");
12167 query.execute(self.graphql_client.clone()).await
12168 }
12169 pub fn context_directory(&self) -> Directory {
12171 let query = self.selection.select("contextDirectory");
12172 Directory {
12173 proc: self.proc.clone(),
12174 selection: query,
12175 graphql_client: self.graphql_client.clone(),
12176 }
12177 }
12178 pub async fn dependencies(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12180 let query = self.selection.select("dependencies");
12181 let query = query.select("id");
12182 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12183 Ok(ids
12184 .into_iter()
12185 .map(|id| ModuleSource {
12186 proc: self.proc.clone(),
12187 selection: crate::querybuilder::query()
12188 .select("node")
12189 .arg("id", &id.0)
12190 .inline_fragment("ModuleSource"),
12191 graphql_client: self.graphql_client.clone(),
12192 })
12193 .collect())
12194 }
12195 pub async fn digest(&self) -> Result<String, DaggerError> {
12197 let query = self.selection.select("digest");
12198 query.execute(self.graphql_client.clone()).await
12199 }
12200 pub fn directory(&self, path: impl Into<String>) -> Directory {
12206 let mut query = self.selection.select("directory");
12207 query = query.arg("path", path.into());
12208 Directory {
12209 proc: self.proc.clone(),
12210 selection: query,
12211 graphql_client: self.graphql_client.clone(),
12212 }
12213 }
12214 pub async fn engine_version(&self) -> Result<String, DaggerError> {
12216 let query = self.selection.select("engineVersion");
12217 query.execute(self.graphql_client.clone()).await
12218 }
12219 pub fn generated_context_changeset(&self) -> Changeset {
12221 let query = self.selection.select("generatedContextChangeset");
12222 Changeset {
12223 proc: self.proc.clone(),
12224 selection: query,
12225 graphql_client: self.graphql_client.clone(),
12226 }
12227 }
12228 pub fn generated_context_directory(&self) -> Directory {
12230 let query = self.selection.select("generatedContextDirectory");
12231 Directory {
12232 proc: self.proc.clone(),
12233 selection: query,
12234 graphql_client: self.graphql_client.clone(),
12235 }
12236 }
12237 pub async fn html_repo_url(&self) -> Result<String, DaggerError> {
12239 let query = self.selection.select("htmlRepoURL");
12240 query.execute(self.graphql_client.clone()).await
12241 }
12242 pub async fn html_url(&self) -> Result<String, DaggerError> {
12244 let query = self.selection.select("htmlURL");
12245 query.execute(self.graphql_client.clone()).await
12246 }
12247 pub async fn id(&self) -> Result<Id, DaggerError> {
12249 let query = self.selection.select("id");
12250 query.execute(self.graphql_client.clone()).await
12251 }
12252 pub fn introspection_schema_json(&self) -> File {
12256 let query = self.selection.select("introspectionSchemaJSON");
12257 File {
12258 proc: self.proc.clone(),
12259 selection: query,
12260 graphql_client: self.graphql_client.clone(),
12261 }
12262 }
12263 pub async fn kind(&self) -> Result<ModuleSourceKind, DaggerError> {
12265 let query = self.selection.select("kind");
12266 query.execute(self.graphql_client.clone()).await
12267 }
12268 pub async fn local_context_directory_path(&self) -> Result<String, DaggerError> {
12270 let query = self.selection.select("localContextDirectoryPath");
12271 query.execute(self.graphql_client.clone()).await
12272 }
12273 pub async fn module_name(&self) -> Result<String, DaggerError> {
12275 let query = self.selection.select("moduleName");
12276 query.execute(self.graphql_client.clone()).await
12277 }
12278 pub async fn module_original_name(&self) -> Result<String, DaggerError> {
12280 let query = self.selection.select("moduleOriginalName");
12281 query.execute(self.graphql_client.clone()).await
12282 }
12283 pub async fn original_subpath(&self) -> Result<String, DaggerError> {
12285 let query = self.selection.select("originalSubpath");
12286 query.execute(self.graphql_client.clone()).await
12287 }
12288 pub async fn pin(&self) -> Result<String, DaggerError> {
12290 let query = self.selection.select("pin");
12291 query.execute(self.graphql_client.clone()).await
12292 }
12293 pub async fn repo_root_path(&self) -> Result<String, DaggerError> {
12295 let query = self.selection.select("repoRootPath");
12296 query.execute(self.graphql_client.clone()).await
12297 }
12298 pub fn sdk(&self) -> SdkConfig {
12300 let query = self.selection.select("sdk");
12301 SdkConfig {
12302 proc: self.proc.clone(),
12303 selection: query,
12304 graphql_client: self.graphql_client.clone(),
12305 }
12306 }
12307 pub async fn source_root_subpath(&self) -> Result<String, DaggerError> {
12309 let query = self.selection.select("sourceRootSubpath");
12310 query.execute(self.graphql_client.clone()).await
12311 }
12312 pub async fn source_subpath(&self) -> Result<String, DaggerError> {
12314 let query = self.selection.select("sourceSubpath");
12315 query.execute(self.graphql_client.clone()).await
12316 }
12317 pub async fn sync(&self) -> Result<ModuleSource, DaggerError> {
12319 let query = self.selection.select("sync");
12320 let id: Id = query.execute(self.graphql_client.clone()).await?;
12321 Ok(ModuleSource {
12322 proc: self.proc.clone(),
12323 selection: query
12324 .root()
12325 .select("node")
12326 .arg("id", &id.0)
12327 .inline_fragment("ModuleSource"),
12328 graphql_client: self.graphql_client.clone(),
12329 })
12330 }
12331 pub async fn toolchains(&self) -> Result<Vec<ModuleSource>, DaggerError> {
12333 let query = self.selection.select("toolchains");
12334 let query = query.select("id");
12335 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12336 Ok(ids
12337 .into_iter()
12338 .map(|id| ModuleSource {
12339 proc: self.proc.clone(),
12340 selection: crate::querybuilder::query()
12341 .select("node")
12342 .arg("id", &id.0)
12343 .inline_fragment("ModuleSource"),
12344 graphql_client: self.graphql_client.clone(),
12345 })
12346 .collect())
12347 }
12348 pub fn user_defaults(&self) -> EnvFile {
12350 let query = self.selection.select("userDefaults");
12351 EnvFile {
12352 proc: self.proc.clone(),
12353 selection: query,
12354 graphql_client: self.graphql_client.clone(),
12355 }
12356 }
12357 pub async fn version(&self) -> Result<String, DaggerError> {
12359 let query = self.selection.select("version");
12360 query.execute(self.graphql_client.clone()).await
12361 }
12362 pub fn with_blueprint(&self, blueprint: impl IntoID<Id>) -> ModuleSource {
12368 let mut query = self.selection.select("withBlueprint");
12369 query = query.arg_lazy(
12370 "blueprint",
12371 Box::new(move || {
12372 let blueprint = blueprint.clone();
12373 Box::pin(async move { blueprint.into_id().await.unwrap().quote() })
12374 }),
12375 );
12376 ModuleSource {
12377 proc: self.proc.clone(),
12378 selection: query,
12379 graphql_client: self.graphql_client.clone(),
12380 }
12381 }
12382 pub fn with_client(
12389 &self,
12390 generator: impl Into<String>,
12391 output_dir: impl Into<String>,
12392 ) -> ModuleSource {
12393 let mut query = self.selection.select("withClient");
12394 query = query.arg("generator", generator.into());
12395 query = query.arg("outputDir", output_dir.into());
12396 ModuleSource {
12397 proc: self.proc.clone(),
12398 selection: query,
12399 graphql_client: self.graphql_client.clone(),
12400 }
12401 }
12402 pub fn with_dependencies(&self, dependencies: Vec<Id>) -> ModuleSource {
12408 let mut query = self.selection.select("withDependencies");
12409 query = query.arg("dependencies", dependencies);
12410 ModuleSource {
12411 proc: self.proc.clone(),
12412 selection: query,
12413 graphql_client: self.graphql_client.clone(),
12414 }
12415 }
12416 pub fn with_engine_version(&self, version: impl Into<String>) -> ModuleSource {
12422 let mut query = self.selection.select("withEngineVersion");
12423 query = query.arg("version", version.into());
12424 ModuleSource {
12425 proc: self.proc.clone(),
12426 selection: query,
12427 graphql_client: self.graphql_client.clone(),
12428 }
12429 }
12430 pub fn with_experimental_features(
12436 &self,
12437 features: Vec<ModuleSourceExperimentalFeature>,
12438 ) -> ModuleSource {
12439 let mut query = self.selection.select("withExperimentalFeatures");
12440 query = query.arg("features", features);
12441 ModuleSource {
12442 proc: self.proc.clone(),
12443 selection: query,
12444 graphql_client: self.graphql_client.clone(),
12445 }
12446 }
12447 pub fn with_includes(&self, patterns: Vec<impl Into<String>>) -> ModuleSource {
12453 let mut query = self.selection.select("withIncludes");
12454 query = query.arg(
12455 "patterns",
12456 patterns
12457 .into_iter()
12458 .map(|i| i.into())
12459 .collect::<Vec<String>>(),
12460 );
12461 ModuleSource {
12462 proc: self.proc.clone(),
12463 selection: query,
12464 graphql_client: self.graphql_client.clone(),
12465 }
12466 }
12467 pub fn with_name(&self, name: impl Into<String>) -> ModuleSource {
12473 let mut query = self.selection.select("withName");
12474 query = query.arg("name", name.into());
12475 ModuleSource {
12476 proc: self.proc.clone(),
12477 selection: query,
12478 graphql_client: self.graphql_client.clone(),
12479 }
12480 }
12481 pub fn with_sdk(&self, source: impl Into<String>) -> ModuleSource {
12487 let mut query = self.selection.select("withSDK");
12488 query = query.arg("source", source.into());
12489 ModuleSource {
12490 proc: self.proc.clone(),
12491 selection: query,
12492 graphql_client: self.graphql_client.clone(),
12493 }
12494 }
12495 pub fn with_source_subpath(&self, path: impl Into<String>) -> ModuleSource {
12501 let mut query = self.selection.select("withSourceSubpath");
12502 query = query.arg("path", path.into());
12503 ModuleSource {
12504 proc: self.proc.clone(),
12505 selection: query,
12506 graphql_client: self.graphql_client.clone(),
12507 }
12508 }
12509 pub fn with_toolchains(&self, toolchains: Vec<Id>) -> ModuleSource {
12515 let mut query = self.selection.select("withToolchains");
12516 query = query.arg("toolchains", toolchains);
12517 ModuleSource {
12518 proc: self.proc.clone(),
12519 selection: query,
12520 graphql_client: self.graphql_client.clone(),
12521 }
12522 }
12523 pub fn with_update_blueprint(&self) -> ModuleSource {
12525 let query = self.selection.select("withUpdateBlueprint");
12526 ModuleSource {
12527 proc: self.proc.clone(),
12528 selection: query,
12529 graphql_client: self.graphql_client.clone(),
12530 }
12531 }
12532 pub fn with_update_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12538 let mut query = self.selection.select("withUpdateDependencies");
12539 query = query.arg(
12540 "dependencies",
12541 dependencies
12542 .into_iter()
12543 .map(|i| i.into())
12544 .collect::<Vec<String>>(),
12545 );
12546 ModuleSource {
12547 proc: self.proc.clone(),
12548 selection: query,
12549 graphql_client: self.graphql_client.clone(),
12550 }
12551 }
12552 pub fn with_update_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12558 let mut query = self.selection.select("withUpdateToolchains");
12559 query = query.arg(
12560 "toolchains",
12561 toolchains
12562 .into_iter()
12563 .map(|i| i.into())
12564 .collect::<Vec<String>>(),
12565 );
12566 ModuleSource {
12567 proc: self.proc.clone(),
12568 selection: query,
12569 graphql_client: self.graphql_client.clone(),
12570 }
12571 }
12572 pub fn with_updated_clients(&self, clients: Vec<impl Into<String>>) -> ModuleSource {
12578 let mut query = self.selection.select("withUpdatedClients");
12579 query = query.arg(
12580 "clients",
12581 clients
12582 .into_iter()
12583 .map(|i| i.into())
12584 .collect::<Vec<String>>(),
12585 );
12586 ModuleSource {
12587 proc: self.proc.clone(),
12588 selection: query,
12589 graphql_client: self.graphql_client.clone(),
12590 }
12591 }
12592 pub fn without_blueprint(&self) -> ModuleSource {
12594 let query = self.selection.select("withoutBlueprint");
12595 ModuleSource {
12596 proc: self.proc.clone(),
12597 selection: query,
12598 graphql_client: self.graphql_client.clone(),
12599 }
12600 }
12601 pub fn without_client(&self, path: impl Into<String>) -> ModuleSource {
12607 let mut query = self.selection.select("withoutClient");
12608 query = query.arg("path", path.into());
12609 ModuleSource {
12610 proc: self.proc.clone(),
12611 selection: query,
12612 graphql_client: self.graphql_client.clone(),
12613 }
12614 }
12615 pub fn without_dependencies(&self, dependencies: Vec<impl Into<String>>) -> ModuleSource {
12621 let mut query = self.selection.select("withoutDependencies");
12622 query = query.arg(
12623 "dependencies",
12624 dependencies
12625 .into_iter()
12626 .map(|i| i.into())
12627 .collect::<Vec<String>>(),
12628 );
12629 ModuleSource {
12630 proc: self.proc.clone(),
12631 selection: query,
12632 graphql_client: self.graphql_client.clone(),
12633 }
12634 }
12635 pub fn without_experimental_features(
12641 &self,
12642 features: Vec<ModuleSourceExperimentalFeature>,
12643 ) -> ModuleSource {
12644 let mut query = self.selection.select("withoutExperimentalFeatures");
12645 query = query.arg("features", features);
12646 ModuleSource {
12647 proc: self.proc.clone(),
12648 selection: query,
12649 graphql_client: self.graphql_client.clone(),
12650 }
12651 }
12652 pub fn without_toolchains(&self, toolchains: Vec<impl Into<String>>) -> ModuleSource {
12658 let mut query = self.selection.select("withoutToolchains");
12659 query = query.arg(
12660 "toolchains",
12661 toolchains
12662 .into_iter()
12663 .map(|i| i.into())
12664 .collect::<Vec<String>>(),
12665 );
12666 ModuleSource {
12667 proc: self.proc.clone(),
12668 selection: query,
12669 graphql_client: self.graphql_client.clone(),
12670 }
12671 }
12672}
12673impl Node for ModuleSource {
12674 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12675 let query = self.selection.select("id");
12676 let graphql_client = self.graphql_client.clone();
12677 async move { query.execute(graphql_client).await }
12678 }
12679}
12680impl Syncer for ModuleSource {
12681 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12682 let query = self.selection.select("id");
12683 let graphql_client = self.graphql_client.clone();
12684 async move { query.execute(graphql_client).await }
12685 }
12686 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12687 let query = self.selection.select("sync");
12688 let graphql_client = self.graphql_client.clone();
12689 async move { query.execute(graphql_client).await }
12690 }
12691}
12692#[derive(Clone)]
12693pub struct ObjectTypeDef {
12694 pub proc: Option<Arc<DaggerSessionProc>>,
12695 pub selection: Selection,
12696 pub graphql_client: DynGraphQLClient,
12697}
12698impl IntoID<Id> for ObjectTypeDef {
12699 fn into_id(
12700 self,
12701 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12702 Box::pin(async move { self.id().await })
12703 }
12704}
12705impl Loadable for ObjectTypeDef {
12706 fn graphql_type() -> &'static str {
12707 "ObjectTypeDef"
12708 }
12709 fn from_query(
12710 proc: Option<Arc<DaggerSessionProc>>,
12711 selection: Selection,
12712 graphql_client: DynGraphQLClient,
12713 ) -> Self {
12714 Self {
12715 proc,
12716 selection,
12717 graphql_client,
12718 }
12719 }
12720}
12721impl ObjectTypeDef {
12722 pub fn constructor(&self) -> Function {
12724 let query = self.selection.select("constructor");
12725 Function {
12726 proc: self.proc.clone(),
12727 selection: query,
12728 graphql_client: self.graphql_client.clone(),
12729 }
12730 }
12731 pub async fn deprecated(&self) -> Result<String, DaggerError> {
12733 let query = self.selection.select("deprecated");
12734 query.execute(self.graphql_client.clone()).await
12735 }
12736 pub async fn description(&self) -> Result<String, DaggerError> {
12738 let query = self.selection.select("description");
12739 query.execute(self.graphql_client.clone()).await
12740 }
12741 pub async fn fields(&self) -> Result<Vec<FieldTypeDef>, DaggerError> {
12743 let query = self.selection.select("fields");
12744 let query = query.select("id");
12745 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12746 Ok(ids
12747 .into_iter()
12748 .map(|id| FieldTypeDef {
12749 proc: self.proc.clone(),
12750 selection: crate::querybuilder::query()
12751 .select("node")
12752 .arg("id", &id.0)
12753 .inline_fragment("FieldTypeDef"),
12754 graphql_client: self.graphql_client.clone(),
12755 })
12756 .collect())
12757 }
12758 pub async fn functions(&self) -> Result<Vec<Function>, DaggerError> {
12760 let query = self.selection.select("functions");
12761 let query = query.select("id");
12762 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
12763 Ok(ids
12764 .into_iter()
12765 .map(|id| Function {
12766 proc: self.proc.clone(),
12767 selection: crate::querybuilder::query()
12768 .select("node")
12769 .arg("id", &id.0)
12770 .inline_fragment("Function"),
12771 graphql_client: self.graphql_client.clone(),
12772 })
12773 .collect())
12774 }
12775 pub async fn id(&self) -> Result<Id, DaggerError> {
12777 let query = self.selection.select("id");
12778 query.execute(self.graphql_client.clone()).await
12779 }
12780 pub async fn name(&self) -> Result<String, DaggerError> {
12782 let query = self.selection.select("name");
12783 query.execute(self.graphql_client.clone()).await
12784 }
12785 pub fn source_map(&self) -> SourceMap {
12787 let query = self.selection.select("sourceMap");
12788 SourceMap {
12789 proc: self.proc.clone(),
12790 selection: query,
12791 graphql_client: self.graphql_client.clone(),
12792 }
12793 }
12794 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
12796 let query = self.selection.select("sourceModuleName");
12797 query.execute(self.graphql_client.clone()).await
12798 }
12799}
12800impl Node for ObjectTypeDef {
12801 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12802 let query = self.selection.select("id");
12803 let graphql_client = self.graphql_client.clone();
12804 async move { query.execute(graphql_client).await }
12805 }
12806}
12807#[derive(Clone)]
12808pub struct Port {
12809 pub proc: Option<Arc<DaggerSessionProc>>,
12810 pub selection: Selection,
12811 pub graphql_client: DynGraphQLClient,
12812}
12813impl IntoID<Id> for Port {
12814 fn into_id(
12815 self,
12816 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
12817 Box::pin(async move { self.id().await })
12818 }
12819}
12820impl Loadable for Port {
12821 fn graphql_type() -> &'static str {
12822 "Port"
12823 }
12824 fn from_query(
12825 proc: Option<Arc<DaggerSessionProc>>,
12826 selection: Selection,
12827 graphql_client: DynGraphQLClient,
12828 ) -> Self {
12829 Self {
12830 proc,
12831 selection,
12832 graphql_client,
12833 }
12834 }
12835}
12836impl Port {
12837 pub async fn description(&self) -> Result<String, DaggerError> {
12839 let query = self.selection.select("description");
12840 query.execute(self.graphql_client.clone()).await
12841 }
12842 pub async fn experimental_skip_healthcheck(&self) -> Result<bool, DaggerError> {
12844 let query = self.selection.select("experimentalSkipHealthcheck");
12845 query.execute(self.graphql_client.clone()).await
12846 }
12847 pub async fn id(&self) -> Result<Id, DaggerError> {
12849 let query = self.selection.select("id");
12850 query.execute(self.graphql_client.clone()).await
12851 }
12852 pub async fn port(&self) -> Result<isize, DaggerError> {
12854 let query = self.selection.select("port");
12855 query.execute(self.graphql_client.clone()).await
12856 }
12857 pub async fn protocol(&self) -> Result<NetworkProtocol, DaggerError> {
12859 let query = self.selection.select("protocol");
12860 query.execute(self.graphql_client.clone()).await
12861 }
12862}
12863impl Node for Port {
12864 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
12865 let query = self.selection.select("id");
12866 let graphql_client = self.graphql_client.clone();
12867 async move { query.execute(graphql_client).await }
12868 }
12869}
12870#[derive(Clone)]
12871pub struct Query {
12872 pub proc: Option<Arc<DaggerSessionProc>>,
12873 pub selection: Selection,
12874 pub graphql_client: DynGraphQLClient,
12875}
12876#[derive(Builder, Debug, PartialEq)]
12877pub struct QueryCacheVolumeOpts<'a> {
12878 #[builder(setter(into, strip_option), default)]
12882 pub owner: Option<&'a str>,
12883 #[builder(setter(into, strip_option), default)]
12885 pub sharing: Option<CacheSharingMode>,
12886 #[builder(setter(into, strip_option), default)]
12888 pub source: Option<Id>,
12889}
12890#[derive(Builder, Debug, PartialEq)]
12891pub struct QueryContainerOpts {
12892 #[builder(setter(into, strip_option), default)]
12894 pub platform: Option<Platform>,
12895}
12896#[derive(Builder, Debug, PartialEq)]
12897pub struct QueryCurrentTypeDefsOpts {
12898 #[builder(setter(into, strip_option), default)]
12901 pub hide_core: Option<bool>,
12902 #[builder(setter(into, strip_option), default)]
12904 pub return_all_types: Option<bool>,
12905}
12906#[derive(Builder, Debug, PartialEq)]
12907pub struct QueryEnvOpts {
12908 #[builder(setter(into, strip_option), default)]
12910 pub privileged: Option<bool>,
12911 #[builder(setter(into, strip_option), default)]
12913 pub writable: Option<bool>,
12914}
12915#[derive(Builder, Debug, PartialEq)]
12916pub struct QueryEnvFileOpts {
12917 #[builder(setter(into, strip_option), default)]
12919 pub expand: Option<bool>,
12920}
12921#[derive(Builder, Debug, PartialEq)]
12922pub struct QueryFileOpts {
12923 #[builder(setter(into, strip_option), default)]
12925 pub permissions: Option<isize>,
12926}
12927#[derive(Builder, Debug, PartialEq)]
12928pub struct QueryGitOpts<'a> {
12929 #[builder(setter(into, strip_option), default)]
12931 pub experimental_service_host: Option<Id>,
12932 #[builder(setter(into, strip_option), default)]
12934 pub http_auth_header: Option<Id>,
12935 #[builder(setter(into, strip_option), default)]
12937 pub http_auth_token: Option<Id>,
12938 #[builder(setter(into, strip_option), default)]
12940 pub http_auth_username: Option<&'a str>,
12941 #[builder(setter(into, strip_option), default)]
12943 pub keep_git_dir: Option<bool>,
12944 #[builder(setter(into, strip_option), default)]
12946 pub ssh_auth_socket: Option<Id>,
12947 #[builder(setter(into, strip_option), default)]
12949 pub ssh_known_hosts: Option<&'a str>,
12950}
12951#[derive(Builder, Debug, PartialEq)]
12952pub struct QueryHttpOpts<'a> {
12953 #[builder(setter(into, strip_option), default)]
12955 pub auth_header: Option<Id>,
12956 #[builder(setter(into, strip_option), default)]
12958 pub checksum: Option<&'a str>,
12959 #[builder(setter(into, strip_option), default)]
12961 pub experimental_service_host: Option<Id>,
12962 #[builder(setter(into, strip_option), default)]
12964 pub name: Option<&'a str>,
12965 #[builder(setter(into, strip_option), default)]
12967 pub permissions: Option<isize>,
12968}
12969#[derive(Builder, Debug, PartialEq)]
12970pub struct QueryLlmOpts<'a> {
12971 #[builder(setter(into, strip_option), default)]
12973 pub max_api_calls: Option<isize>,
12974 #[builder(setter(into, strip_option), default)]
12976 pub model: Option<&'a str>,
12977}
12978#[derive(Builder, Debug, PartialEq)]
12979pub struct QueryModuleSourceOpts<'a> {
12980 #[builder(setter(into, strip_option), default)]
12982 pub allow_not_exists: Option<bool>,
12983 #[builder(setter(into, strip_option), default)]
12985 pub disable_find_up: Option<bool>,
12986 #[builder(setter(into, strip_option), default)]
12988 pub ref_pin: Option<&'a str>,
12989 #[builder(setter(into, strip_option), default)]
12991 pub require_kind: Option<ModuleSourceKind>,
12992}
12993#[derive(Builder, Debug, PartialEq)]
12994pub struct QuerySecretOpts<'a> {
12995 #[builder(setter(into, strip_option), default)]
12999 pub cache_key: Option<&'a str>,
13000}
13001#[derive(Builder, Debug, PartialEq)]
13002pub struct QuerySshfsVolumeOpts<'a> {
13003 #[builder(setter(into, strip_option), default)]
13005 pub cache_key: Option<&'a str>,
13006 #[builder(setter(into, strip_option), default)]
13008 pub experimental_service_host: Option<Id>,
13009 #[builder(setter(into, strip_option), default)]
13011 pub insecure_skip_host_key_check: Option<bool>,
13012 #[builder(setter(into, strip_option), default)]
13014 pub known_hosts: Option<Id>,
13015}
13016impl IntoID<Id> for Query {
13017 fn into_id(
13018 self,
13019 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
13020 Box::pin(async move { self.id().await })
13021 }
13022}
13023impl Loadable for Query {
13024 fn graphql_type() -> &'static str {
13025 "Query"
13026 }
13027 fn from_query(
13028 proc: Option<Arc<DaggerSessionProc>>,
13029 selection: Selection,
13030 graphql_client: DynGraphQLClient,
13031 ) -> Self {
13032 Self {
13033 proc,
13034 selection,
13035 graphql_client,
13036 }
13037 }
13038}
13039impl Query {
13040 pub fn address(&self, value: impl Into<String>) -> Address {
13042 let mut query = self.selection.select("address");
13043 query = query.arg("value", value.into());
13044 Address {
13045 proc: self.proc.clone(),
13046 selection: query,
13047 graphql_client: self.graphql_client.clone(),
13048 }
13049 }
13050 pub fn cache_volume(&self, key: impl Into<String>) -> CacheVolume {
13057 let mut query = self.selection.select("cacheVolume");
13058 query = query.arg("key", key.into());
13059 CacheVolume {
13060 proc: self.proc.clone(),
13061 selection: query,
13062 graphql_client: self.graphql_client.clone(),
13063 }
13064 }
13065 pub fn cache_volume_opts<'a>(
13072 &self,
13073 key: impl Into<String>,
13074 opts: QueryCacheVolumeOpts<'a>,
13075 ) -> CacheVolume {
13076 let mut query = self.selection.select("cacheVolume");
13077 query = query.arg("key", key.into());
13078 if let Some(source) = opts.source {
13079 query = query.arg("source", source);
13080 }
13081 if let Some(sharing) = opts.sharing {
13082 query = query.arg("sharing", sharing);
13083 }
13084 if let Some(owner) = opts.owner {
13085 query = query.arg("owner", owner);
13086 }
13087 CacheVolume {
13088 proc: self.proc.clone(),
13089 selection: query,
13090 graphql_client: self.graphql_client.clone(),
13091 }
13092 }
13093 pub fn changeset(&self) -> Changeset {
13095 let query = self.selection.select("changeset");
13096 Changeset {
13097 proc: self.proc.clone(),
13098 selection: query,
13099 graphql_client: self.graphql_client.clone(),
13100 }
13101 }
13102 pub fn cloud(&self) -> Cloud {
13104 let query = self.selection.select("cloud");
13105 Cloud {
13106 proc: self.proc.clone(),
13107 selection: query,
13108 graphql_client: self.graphql_client.clone(),
13109 }
13110 }
13111 pub fn container(&self) -> Container {
13118 let query = self.selection.select("container");
13119 Container {
13120 proc: self.proc.clone(),
13121 selection: query,
13122 graphql_client: self.graphql_client.clone(),
13123 }
13124 }
13125 pub fn container_opts(&self, opts: QueryContainerOpts) -> Container {
13132 let mut query = self.selection.select("container");
13133 if let Some(platform) = opts.platform {
13134 query = query.arg("platform", platform);
13135 }
13136 Container {
13137 proc: self.proc.clone(),
13138 selection: query,
13139 graphql_client: self.graphql_client.clone(),
13140 }
13141 }
13142 pub fn current_env(&self) -> Env {
13146 let query = self.selection.select("currentEnv");
13147 Env {
13148 proc: self.proc.clone(),
13149 selection: query,
13150 graphql_client: self.graphql_client.clone(),
13151 }
13152 }
13153 pub fn current_function_call(&self) -> FunctionCall {
13156 let query = self.selection.select("currentFunctionCall");
13157 FunctionCall {
13158 proc: self.proc.clone(),
13159 selection: query,
13160 graphql_client: self.graphql_client.clone(),
13161 }
13162 }
13163 pub fn current_module(&self) -> CurrentModule {
13165 let query = self.selection.select("currentModule");
13166 CurrentModule {
13167 proc: self.proc.clone(),
13168 selection: query,
13169 graphql_client: self.graphql_client.clone(),
13170 }
13171 }
13172 pub async fn current_type_defs(&self) -> Result<Vec<TypeDef>, DaggerError> {
13178 let query = self.selection.select("currentTypeDefs");
13179 let query = query.select("id");
13180 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13181 Ok(ids
13182 .into_iter()
13183 .map(|id| TypeDef {
13184 proc: self.proc.clone(),
13185 selection: crate::querybuilder::query()
13186 .select("node")
13187 .arg("id", &id.0)
13188 .inline_fragment("TypeDef"),
13189 graphql_client: self.graphql_client.clone(),
13190 })
13191 .collect())
13192 }
13193 pub async fn current_type_defs_opts(
13199 &self,
13200 opts: QueryCurrentTypeDefsOpts,
13201 ) -> Result<Vec<TypeDef>, DaggerError> {
13202 let mut query = self.selection.select("currentTypeDefs");
13203 if let Some(return_all_types) = opts.return_all_types {
13204 query = query.arg("returnAllTypes", return_all_types);
13205 }
13206 if let Some(hide_core) = opts.hide_core {
13207 query = query.arg("hideCore", hide_core);
13208 }
13209 let query = query.select("id");
13210 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
13211 Ok(ids
13212 .into_iter()
13213 .map(|id| TypeDef {
13214 proc: self.proc.clone(),
13215 selection: crate::querybuilder::query()
13216 .select("node")
13217 .arg("id", &id.0)
13218 .inline_fragment("TypeDef"),
13219 graphql_client: self.graphql_client.clone(),
13220 })
13221 .collect())
13222 }
13223 pub fn current_workspace(&self) -> Workspace {
13225 let query = self.selection.select("currentWorkspace");
13226 Workspace {
13227 proc: self.proc.clone(),
13228 selection: query,
13229 graphql_client: self.graphql_client.clone(),
13230 }
13231 }
13232 pub async fn default_platform(&self) -> Result<Platform, DaggerError> {
13234 let query = self.selection.select("defaultPlatform");
13235 query.execute(self.graphql_client.clone()).await
13236 }
13237 pub fn directory(&self) -> Directory {
13239 let query = self.selection.select("directory");
13240 Directory {
13241 proc: self.proc.clone(),
13242 selection: query,
13243 graphql_client: self.graphql_client.clone(),
13244 }
13245 }
13246 pub fn engine(&self) -> Engine {
13248 let query = self.selection.select("engine");
13249 Engine {
13250 proc: self.proc.clone(),
13251 selection: query,
13252 graphql_client: self.graphql_client.clone(),
13253 }
13254 }
13255 pub fn env(&self) -> Env {
13261 let query = self.selection.select("env");
13262 Env {
13263 proc: self.proc.clone(),
13264 selection: query,
13265 graphql_client: self.graphql_client.clone(),
13266 }
13267 }
13268 pub fn env_opts(&self, opts: QueryEnvOpts) -> Env {
13274 let mut query = self.selection.select("env");
13275 if let Some(privileged) = opts.privileged {
13276 query = query.arg("privileged", privileged);
13277 }
13278 if let Some(writable) = opts.writable {
13279 query = query.arg("writable", writable);
13280 }
13281 Env {
13282 proc: self.proc.clone(),
13283 selection: query,
13284 graphql_client: self.graphql_client.clone(),
13285 }
13286 }
13287 pub fn env_file(&self) -> EnvFile {
13293 let query = self.selection.select("envFile");
13294 EnvFile {
13295 proc: self.proc.clone(),
13296 selection: query,
13297 graphql_client: self.graphql_client.clone(),
13298 }
13299 }
13300 pub fn env_file_opts(&self, opts: QueryEnvFileOpts) -> EnvFile {
13306 let mut query = self.selection.select("envFile");
13307 if let Some(expand) = opts.expand {
13308 query = query.arg("expand", expand);
13309 }
13310 EnvFile {
13311 proc: self.proc.clone(),
13312 selection: query,
13313 graphql_client: self.graphql_client.clone(),
13314 }
13315 }
13316 pub fn error(&self, message: impl Into<String>) -> Error {
13322 let mut query = self.selection.select("error");
13323 query = query.arg("message", message.into());
13324 Error {
13325 proc: self.proc.clone(),
13326 selection: query,
13327 graphql_client: self.graphql_client.clone(),
13328 }
13329 }
13330 pub fn file(&self, name: impl Into<String>, contents: impl Into<String>) -> File {
13338 let mut query = self.selection.select("file");
13339 query = query.arg("name", name.into());
13340 query = query.arg("contents", contents.into());
13341 File {
13342 proc: self.proc.clone(),
13343 selection: query,
13344 graphql_client: self.graphql_client.clone(),
13345 }
13346 }
13347 pub fn file_opts(
13355 &self,
13356 name: impl Into<String>,
13357 contents: impl Into<String>,
13358 opts: QueryFileOpts,
13359 ) -> File {
13360 let mut query = self.selection.select("file");
13361 query = query.arg("name", name.into());
13362 query = query.arg("contents", contents.into());
13363 if let Some(permissions) = opts.permissions {
13364 query = query.arg("permissions", permissions);
13365 }
13366 File {
13367 proc: self.proc.clone(),
13368 selection: query,
13369 graphql_client: self.graphql_client.clone(),
13370 }
13371 }
13372 pub fn function(&self, name: impl Into<String>, return_type: impl IntoID<Id>) -> Function {
13379 let mut query = self.selection.select("function");
13380 query = query.arg("name", name.into());
13381 query = query.arg_lazy(
13382 "returnType",
13383 Box::new(move || {
13384 let return_type = return_type.clone();
13385 Box::pin(async move { return_type.into_id().await.unwrap().quote() })
13386 }),
13387 );
13388 Function {
13389 proc: self.proc.clone(),
13390 selection: query,
13391 graphql_client: self.graphql_client.clone(),
13392 }
13393 }
13394 pub fn generated_code(&self, code: impl IntoID<Id>) -> GeneratedCode {
13396 let mut query = self.selection.select("generatedCode");
13397 query = query.arg_lazy(
13398 "code",
13399 Box::new(move || {
13400 let code = code.clone();
13401 Box::pin(async move { code.into_id().await.unwrap().quote() })
13402 }),
13403 );
13404 GeneratedCode {
13405 proc: self.proc.clone(),
13406 selection: query,
13407 graphql_client: self.graphql_client.clone(),
13408 }
13409 }
13410 pub fn git(&self, url: impl Into<String>) -> GitRepository {
13421 let mut query = self.selection.select("git");
13422 query = query.arg("url", url.into());
13423 GitRepository {
13424 proc: self.proc.clone(),
13425 selection: query,
13426 graphql_client: self.graphql_client.clone(),
13427 }
13428 }
13429 pub fn git_opts<'a>(&self, url: impl Into<String>, opts: QueryGitOpts<'a>) -> GitRepository {
13440 let mut query = self.selection.select("git");
13441 query = query.arg("url", url.into());
13442 if let Some(keep_git_dir) = opts.keep_git_dir {
13443 query = query.arg("keepGitDir", keep_git_dir);
13444 }
13445 if let Some(ssh_known_hosts) = opts.ssh_known_hosts {
13446 query = query.arg("sshKnownHosts", ssh_known_hosts);
13447 }
13448 if let Some(ssh_auth_socket) = opts.ssh_auth_socket {
13449 query = query.arg("sshAuthSocket", ssh_auth_socket);
13450 }
13451 if let Some(http_auth_username) = opts.http_auth_username {
13452 query = query.arg("httpAuthUsername", http_auth_username);
13453 }
13454 if let Some(http_auth_token) = opts.http_auth_token {
13455 query = query.arg("httpAuthToken", http_auth_token);
13456 }
13457 if let Some(http_auth_header) = opts.http_auth_header {
13458 query = query.arg("httpAuthHeader", http_auth_header);
13459 }
13460 if let Some(experimental_service_host) = opts.experimental_service_host {
13461 query = query.arg("experimentalServiceHost", experimental_service_host);
13462 }
13463 GitRepository {
13464 proc: self.proc.clone(),
13465 selection: query,
13466 graphql_client: self.graphql_client.clone(),
13467 }
13468 }
13469 pub fn host(&self) -> Host {
13471 let query = self.selection.select("host");
13472 Host {
13473 proc: self.proc.clone(),
13474 selection: query,
13475 graphql_client: self.graphql_client.clone(),
13476 }
13477 }
13478 pub fn http(&self, url: impl Into<String>) -> File {
13485 let mut query = self.selection.select("http");
13486 query = query.arg("url", url.into());
13487 File {
13488 proc: self.proc.clone(),
13489 selection: query,
13490 graphql_client: self.graphql_client.clone(),
13491 }
13492 }
13493 pub fn http_opts<'a>(&self, url: impl Into<String>, opts: QueryHttpOpts<'a>) -> File {
13500 let mut query = self.selection.select("http");
13501 query = query.arg("url", url.into());
13502 if let Some(name) = opts.name {
13503 query = query.arg("name", name);
13504 }
13505 if let Some(permissions) = opts.permissions {
13506 query = query.arg("permissions", permissions);
13507 }
13508 if let Some(checksum) = opts.checksum {
13509 query = query.arg("checksum", checksum);
13510 }
13511 if let Some(auth_header) = opts.auth_header {
13512 query = query.arg("authHeader", auth_header);
13513 }
13514 if let Some(experimental_service_host) = opts.experimental_service_host {
13515 query = query.arg("experimentalServiceHost", experimental_service_host);
13516 }
13517 File {
13518 proc: self.proc.clone(),
13519 selection: query,
13520 graphql_client: self.graphql_client.clone(),
13521 }
13522 }
13523 pub async fn id(&self) -> Result<Id, DaggerError> {
13525 let query = self.selection.select("id");
13526 query.execute(self.graphql_client.clone()).await
13527 }
13528 pub fn json(&self) -> JsonValue {
13530 let query = self.selection.select("json");
13531 JsonValue {
13532 proc: self.proc.clone(),
13533 selection: query,
13534 graphql_client: self.graphql_client.clone(),
13535 }
13536 }
13537 pub fn llm(&self) -> Llm {
13543 let query = self.selection.select("llm");
13544 Llm {
13545 proc: self.proc.clone(),
13546 selection: query,
13547 graphql_client: self.graphql_client.clone(),
13548 }
13549 }
13550 pub fn llm_opts<'a>(&self, opts: QueryLlmOpts<'a>) -> Llm {
13556 let mut query = self.selection.select("llm");
13557 if let Some(model) = opts.model {
13558 query = query.arg("model", model);
13559 }
13560 if let Some(max_api_calls) = opts.max_api_calls {
13561 query = query.arg("maxAPICalls", max_api_calls);
13562 }
13563 Llm {
13564 proc: self.proc.clone(),
13565 selection: query,
13566 graphql_client: self.graphql_client.clone(),
13567 }
13568 }
13569 pub fn load_address_from_id(&self, id: impl IntoID<AddressId>) -> Address {
13571 let mut query = self.selection.select("loadAddressFromID");
13572 query = query.arg_lazy(
13573 "id",
13574 Box::new(move || {
13575 let id = id.clone();
13576 Box::pin(async move { id.into_id().await.unwrap().quote() })
13577 }),
13578 );
13579 Address {
13580 proc: self.proc.clone(),
13581 selection: query,
13582 graphql_client: self.graphql_client.clone(),
13583 }
13584 }
13585 pub fn load_binding_from_id(&self, id: impl IntoID<BindingId>) -> Binding {
13587 let mut query = self.selection.select("loadBindingFromID");
13588 query = query.arg_lazy(
13589 "id",
13590 Box::new(move || {
13591 let id = id.clone();
13592 Box::pin(async move { id.into_id().await.unwrap().quote() })
13593 }),
13594 );
13595 Binding {
13596 proc: self.proc.clone(),
13597 selection: query,
13598 graphql_client: self.graphql_client.clone(),
13599 }
13600 }
13601 pub fn load_cache_volume_from_id(&self, id: impl IntoID<CacheVolumeId>) -> CacheVolume {
13603 let mut query = self.selection.select("loadCacheVolumeFromID");
13604 query = query.arg_lazy(
13605 "id",
13606 Box::new(move || {
13607 let id = id.clone();
13608 Box::pin(async move { id.into_id().await.unwrap().quote() })
13609 }),
13610 );
13611 CacheVolume {
13612 proc: self.proc.clone(),
13613 selection: query,
13614 graphql_client: self.graphql_client.clone(),
13615 }
13616 }
13617 pub fn load_changeset_from_id(&self, id: impl IntoID<ChangesetId>) -> Changeset {
13619 let mut query = self.selection.select("loadChangesetFromID");
13620 query = query.arg_lazy(
13621 "id",
13622 Box::new(move || {
13623 let id = id.clone();
13624 Box::pin(async move { id.into_id().await.unwrap().quote() })
13625 }),
13626 );
13627 Changeset {
13628 proc: self.proc.clone(),
13629 selection: query,
13630 graphql_client: self.graphql_client.clone(),
13631 }
13632 }
13633 pub fn load_check_from_id(&self, id: impl IntoID<CheckId>) -> Check {
13635 let mut query = self.selection.select("loadCheckFromID");
13636 query = query.arg_lazy(
13637 "id",
13638 Box::new(move || {
13639 let id = id.clone();
13640 Box::pin(async move { id.into_id().await.unwrap().quote() })
13641 }),
13642 );
13643 Check {
13644 proc: self.proc.clone(),
13645 selection: query,
13646 graphql_client: self.graphql_client.clone(),
13647 }
13648 }
13649 pub fn load_check_group_from_id(&self, id: impl IntoID<CheckGroupId>) -> CheckGroup {
13651 let mut query = self.selection.select("loadCheckGroupFromID");
13652 query = query.arg_lazy(
13653 "id",
13654 Box::new(move || {
13655 let id = id.clone();
13656 Box::pin(async move { id.into_id().await.unwrap().quote() })
13657 }),
13658 );
13659 CheckGroup {
13660 proc: self.proc.clone(),
13661 selection: query,
13662 graphql_client: self.graphql_client.clone(),
13663 }
13664 }
13665 pub fn load_client_filesync_mirror_from_id(
13667 &self,
13668 id: impl IntoID<ClientFilesyncMirrorId>,
13669 ) -> ClientFilesyncMirror {
13670 let mut query = self.selection.select("loadClientFilesyncMirrorFromID");
13671 query = query.arg_lazy(
13672 "id",
13673 Box::new(move || {
13674 let id = id.clone();
13675 Box::pin(async move { id.into_id().await.unwrap().quote() })
13676 }),
13677 );
13678 ClientFilesyncMirror {
13679 proc: self.proc.clone(),
13680 selection: query,
13681 graphql_client: self.graphql_client.clone(),
13682 }
13683 }
13684 pub fn load_cloud_from_id(&self, id: impl IntoID<CloudId>) -> Cloud {
13686 let mut query = self.selection.select("loadCloudFromID");
13687 query = query.arg_lazy(
13688 "id",
13689 Box::new(move || {
13690 let id = id.clone();
13691 Box::pin(async move { id.into_id().await.unwrap().quote() })
13692 }),
13693 );
13694 Cloud {
13695 proc: self.proc.clone(),
13696 selection: query,
13697 graphql_client: self.graphql_client.clone(),
13698 }
13699 }
13700 pub fn load_container_from_id(&self, id: impl IntoID<ContainerId>) -> Container {
13702 let mut query = self.selection.select("loadContainerFromID");
13703 query = query.arg_lazy(
13704 "id",
13705 Box::new(move || {
13706 let id = id.clone();
13707 Box::pin(async move { id.into_id().await.unwrap().quote() })
13708 }),
13709 );
13710 Container {
13711 proc: self.proc.clone(),
13712 selection: query,
13713 graphql_client: self.graphql_client.clone(),
13714 }
13715 }
13716 pub fn load_current_module_from_id(&self, id: impl IntoID<CurrentModuleId>) -> CurrentModule {
13718 let mut query = self.selection.select("loadCurrentModuleFromID");
13719 query = query.arg_lazy(
13720 "id",
13721 Box::new(move || {
13722 let id = id.clone();
13723 Box::pin(async move { id.into_id().await.unwrap().quote() })
13724 }),
13725 );
13726 CurrentModule {
13727 proc: self.proc.clone(),
13728 selection: query,
13729 graphql_client: self.graphql_client.clone(),
13730 }
13731 }
13732 pub fn load_diff_stat_from_id(&self, id: impl IntoID<DiffStatId>) -> DiffStat {
13734 let mut query = self.selection.select("loadDiffStatFromID");
13735 query = query.arg_lazy(
13736 "id",
13737 Box::new(move || {
13738 let id = id.clone();
13739 Box::pin(async move { id.into_id().await.unwrap().quote() })
13740 }),
13741 );
13742 DiffStat {
13743 proc: self.proc.clone(),
13744 selection: query,
13745 graphql_client: self.graphql_client.clone(),
13746 }
13747 }
13748 pub fn load_directory_from_id(&self, id: impl IntoID<DirectoryId>) -> Directory {
13750 let mut query = self.selection.select("loadDirectoryFromID");
13751 query = query.arg_lazy(
13752 "id",
13753 Box::new(move || {
13754 let id = id.clone();
13755 Box::pin(async move { id.into_id().await.unwrap().quote() })
13756 }),
13757 );
13758 Directory {
13759 proc: self.proc.clone(),
13760 selection: query,
13761 graphql_client: self.graphql_client.clone(),
13762 }
13763 }
13764 pub fn load_engine_cache_entry_from_id(
13766 &self,
13767 id: impl IntoID<EngineCacheEntryId>,
13768 ) -> EngineCacheEntry {
13769 let mut query = self.selection.select("loadEngineCacheEntryFromID");
13770 query = query.arg_lazy(
13771 "id",
13772 Box::new(move || {
13773 let id = id.clone();
13774 Box::pin(async move { id.into_id().await.unwrap().quote() })
13775 }),
13776 );
13777 EngineCacheEntry {
13778 proc: self.proc.clone(),
13779 selection: query,
13780 graphql_client: self.graphql_client.clone(),
13781 }
13782 }
13783 pub fn load_engine_cache_entry_set_from_id(
13785 &self,
13786 id: impl IntoID<EngineCacheEntrySetId>,
13787 ) -> EngineCacheEntrySet {
13788 let mut query = self.selection.select("loadEngineCacheEntrySetFromID");
13789 query = query.arg_lazy(
13790 "id",
13791 Box::new(move || {
13792 let id = id.clone();
13793 Box::pin(async move { id.into_id().await.unwrap().quote() })
13794 }),
13795 );
13796 EngineCacheEntrySet {
13797 proc: self.proc.clone(),
13798 selection: query,
13799 graphql_client: self.graphql_client.clone(),
13800 }
13801 }
13802 pub fn load_engine_cache_from_id(&self, id: impl IntoID<EngineCacheId>) -> EngineCache {
13804 let mut query = self.selection.select("loadEngineCacheFromID");
13805 query = query.arg_lazy(
13806 "id",
13807 Box::new(move || {
13808 let id = id.clone();
13809 Box::pin(async move { id.into_id().await.unwrap().quote() })
13810 }),
13811 );
13812 EngineCache {
13813 proc: self.proc.clone(),
13814 selection: query,
13815 graphql_client: self.graphql_client.clone(),
13816 }
13817 }
13818 pub fn load_engine_from_id(&self, id: impl IntoID<EngineId>) -> Engine {
13820 let mut query = self.selection.select("loadEngineFromID");
13821 query = query.arg_lazy(
13822 "id",
13823 Box::new(move || {
13824 let id = id.clone();
13825 Box::pin(async move { id.into_id().await.unwrap().quote() })
13826 }),
13827 );
13828 Engine {
13829 proc: self.proc.clone(),
13830 selection: query,
13831 graphql_client: self.graphql_client.clone(),
13832 }
13833 }
13834 pub fn load_enum_type_def_from_id(&self, id: impl IntoID<EnumTypeDefId>) -> EnumTypeDef {
13836 let mut query = self.selection.select("loadEnumTypeDefFromID");
13837 query = query.arg_lazy(
13838 "id",
13839 Box::new(move || {
13840 let id = id.clone();
13841 Box::pin(async move { id.into_id().await.unwrap().quote() })
13842 }),
13843 );
13844 EnumTypeDef {
13845 proc: self.proc.clone(),
13846 selection: query,
13847 graphql_client: self.graphql_client.clone(),
13848 }
13849 }
13850 pub fn load_enum_value_type_def_from_id(
13852 &self,
13853 id: impl IntoID<EnumValueTypeDefId>,
13854 ) -> EnumValueTypeDef {
13855 let mut query = self.selection.select("loadEnumValueTypeDefFromID");
13856 query = query.arg_lazy(
13857 "id",
13858 Box::new(move || {
13859 let id = id.clone();
13860 Box::pin(async move { id.into_id().await.unwrap().quote() })
13861 }),
13862 );
13863 EnumValueTypeDef {
13864 proc: self.proc.clone(),
13865 selection: query,
13866 graphql_client: self.graphql_client.clone(),
13867 }
13868 }
13869 pub fn load_env_file_from_id(&self, id: impl IntoID<EnvFileId>) -> EnvFile {
13871 let mut query = self.selection.select("loadEnvFileFromID");
13872 query = query.arg_lazy(
13873 "id",
13874 Box::new(move || {
13875 let id = id.clone();
13876 Box::pin(async move { id.into_id().await.unwrap().quote() })
13877 }),
13878 );
13879 EnvFile {
13880 proc: self.proc.clone(),
13881 selection: query,
13882 graphql_client: self.graphql_client.clone(),
13883 }
13884 }
13885 pub fn load_env_from_id(&self, id: impl IntoID<EnvId>) -> Env {
13887 let mut query = self.selection.select("loadEnvFromID");
13888 query = query.arg_lazy(
13889 "id",
13890 Box::new(move || {
13891 let id = id.clone();
13892 Box::pin(async move { id.into_id().await.unwrap().quote() })
13893 }),
13894 );
13895 Env {
13896 proc: self.proc.clone(),
13897 selection: query,
13898 graphql_client: self.graphql_client.clone(),
13899 }
13900 }
13901 pub fn load_env_variable_from_id(&self, id: impl IntoID<EnvVariableId>) -> EnvVariable {
13903 let mut query = self.selection.select("loadEnvVariableFromID");
13904 query = query.arg_lazy(
13905 "id",
13906 Box::new(move || {
13907 let id = id.clone();
13908 Box::pin(async move { id.into_id().await.unwrap().quote() })
13909 }),
13910 );
13911 EnvVariable {
13912 proc: self.proc.clone(),
13913 selection: query,
13914 graphql_client: self.graphql_client.clone(),
13915 }
13916 }
13917 pub fn load_error_from_id(&self, id: impl IntoID<ErrorId>) -> Error {
13919 let mut query = self.selection.select("loadErrorFromID");
13920 query = query.arg_lazy(
13921 "id",
13922 Box::new(move || {
13923 let id = id.clone();
13924 Box::pin(async move { id.into_id().await.unwrap().quote() })
13925 }),
13926 );
13927 Error {
13928 proc: self.proc.clone(),
13929 selection: query,
13930 graphql_client: self.graphql_client.clone(),
13931 }
13932 }
13933 pub fn load_error_value_from_id(&self, id: impl IntoID<ErrorValueId>) -> ErrorValue {
13935 let mut query = self.selection.select("loadErrorValueFromID");
13936 query = query.arg_lazy(
13937 "id",
13938 Box::new(move || {
13939 let id = id.clone();
13940 Box::pin(async move { id.into_id().await.unwrap().quote() })
13941 }),
13942 );
13943 ErrorValue {
13944 proc: self.proc.clone(),
13945 selection: query,
13946 graphql_client: self.graphql_client.clone(),
13947 }
13948 }
13949 pub fn load_exportable_from_id(&self, id: impl IntoID<ExportableId>) -> ExportableClient {
13951 let mut query = self.selection.select("loadExportableFromID");
13952 query = query.arg_lazy(
13953 "id",
13954 Box::new(move || {
13955 let id = id.clone();
13956 Box::pin(async move { id.into_id().await.unwrap().quote() })
13957 }),
13958 );
13959 ExportableClient {
13960 proc: self.proc.clone(),
13961 selection: query,
13962 graphql_client: self.graphql_client.clone(),
13963 }
13964 }
13965 pub fn load_field_type_def_from_id(&self, id: impl IntoID<FieldTypeDefId>) -> FieldTypeDef {
13967 let mut query = self.selection.select("loadFieldTypeDefFromID");
13968 query = query.arg_lazy(
13969 "id",
13970 Box::new(move || {
13971 let id = id.clone();
13972 Box::pin(async move { id.into_id().await.unwrap().quote() })
13973 }),
13974 );
13975 FieldTypeDef {
13976 proc: self.proc.clone(),
13977 selection: query,
13978 graphql_client: self.graphql_client.clone(),
13979 }
13980 }
13981 pub fn load_file_from_id(&self, id: impl IntoID<FileId>) -> File {
13983 let mut query = self.selection.select("loadFileFromID");
13984 query = query.arg_lazy(
13985 "id",
13986 Box::new(move || {
13987 let id = id.clone();
13988 Box::pin(async move { id.into_id().await.unwrap().quote() })
13989 }),
13990 );
13991 File {
13992 proc: self.proc.clone(),
13993 selection: query,
13994 graphql_client: self.graphql_client.clone(),
13995 }
13996 }
13997 pub fn load_function_arg_from_id(&self, id: impl IntoID<FunctionArgId>) -> FunctionArg {
13999 let mut query = self.selection.select("loadFunctionArgFromID");
14000 query = query.arg_lazy(
14001 "id",
14002 Box::new(move || {
14003 let id = id.clone();
14004 Box::pin(async move { id.into_id().await.unwrap().quote() })
14005 }),
14006 );
14007 FunctionArg {
14008 proc: self.proc.clone(),
14009 selection: query,
14010 graphql_client: self.graphql_client.clone(),
14011 }
14012 }
14013 pub fn load_function_call_arg_value_from_id(
14015 &self,
14016 id: impl IntoID<FunctionCallArgValueId>,
14017 ) -> FunctionCallArgValue {
14018 let mut query = self.selection.select("loadFunctionCallArgValueFromID");
14019 query = query.arg_lazy(
14020 "id",
14021 Box::new(move || {
14022 let id = id.clone();
14023 Box::pin(async move { id.into_id().await.unwrap().quote() })
14024 }),
14025 );
14026 FunctionCallArgValue {
14027 proc: self.proc.clone(),
14028 selection: query,
14029 graphql_client: self.graphql_client.clone(),
14030 }
14031 }
14032 pub fn load_function_call_from_id(&self, id: impl IntoID<FunctionCallId>) -> FunctionCall {
14034 let mut query = self.selection.select("loadFunctionCallFromID");
14035 query = query.arg_lazy(
14036 "id",
14037 Box::new(move || {
14038 let id = id.clone();
14039 Box::pin(async move { id.into_id().await.unwrap().quote() })
14040 }),
14041 );
14042 FunctionCall {
14043 proc: self.proc.clone(),
14044 selection: query,
14045 graphql_client: self.graphql_client.clone(),
14046 }
14047 }
14048 pub fn load_function_from_id(&self, id: impl IntoID<FunctionId>) -> Function {
14050 let mut query = self.selection.select("loadFunctionFromID");
14051 query = query.arg_lazy(
14052 "id",
14053 Box::new(move || {
14054 let id = id.clone();
14055 Box::pin(async move { id.into_id().await.unwrap().quote() })
14056 }),
14057 );
14058 Function {
14059 proc: self.proc.clone(),
14060 selection: query,
14061 graphql_client: self.graphql_client.clone(),
14062 }
14063 }
14064 pub fn load_generated_code_from_id(&self, id: impl IntoID<GeneratedCodeId>) -> GeneratedCode {
14066 let mut query = self.selection.select("loadGeneratedCodeFromID");
14067 query = query.arg_lazy(
14068 "id",
14069 Box::new(move || {
14070 let id = id.clone();
14071 Box::pin(async move { id.into_id().await.unwrap().quote() })
14072 }),
14073 );
14074 GeneratedCode {
14075 proc: self.proc.clone(),
14076 selection: query,
14077 graphql_client: self.graphql_client.clone(),
14078 }
14079 }
14080 pub fn load_generator_from_id(&self, id: impl IntoID<GeneratorId>) -> Generator {
14082 let mut query = self.selection.select("loadGeneratorFromID");
14083 query = query.arg_lazy(
14084 "id",
14085 Box::new(move || {
14086 let id = id.clone();
14087 Box::pin(async move { id.into_id().await.unwrap().quote() })
14088 }),
14089 );
14090 Generator {
14091 proc: self.proc.clone(),
14092 selection: query,
14093 graphql_client: self.graphql_client.clone(),
14094 }
14095 }
14096 pub fn load_generator_group_from_id(
14098 &self,
14099 id: impl IntoID<GeneratorGroupId>,
14100 ) -> GeneratorGroup {
14101 let mut query = self.selection.select("loadGeneratorGroupFromID");
14102 query = query.arg_lazy(
14103 "id",
14104 Box::new(move || {
14105 let id = id.clone();
14106 Box::pin(async move { id.into_id().await.unwrap().quote() })
14107 }),
14108 );
14109 GeneratorGroup {
14110 proc: self.proc.clone(),
14111 selection: query,
14112 graphql_client: self.graphql_client.clone(),
14113 }
14114 }
14115 pub fn load_git_ref_from_id(&self, id: impl IntoID<GitRefId>) -> GitRef {
14117 let mut query = self.selection.select("loadGitRefFromID");
14118 query = query.arg_lazy(
14119 "id",
14120 Box::new(move || {
14121 let id = id.clone();
14122 Box::pin(async move { id.into_id().await.unwrap().quote() })
14123 }),
14124 );
14125 GitRef {
14126 proc: self.proc.clone(),
14127 selection: query,
14128 graphql_client: self.graphql_client.clone(),
14129 }
14130 }
14131 pub fn load_git_repository_from_id(&self, id: impl IntoID<GitRepositoryId>) -> GitRepository {
14133 let mut query = self.selection.select("loadGitRepositoryFromID");
14134 query = query.arg_lazy(
14135 "id",
14136 Box::new(move || {
14137 let id = id.clone();
14138 Box::pin(async move { id.into_id().await.unwrap().quote() })
14139 }),
14140 );
14141 GitRepository {
14142 proc: self.proc.clone(),
14143 selection: query,
14144 graphql_client: self.graphql_client.clone(),
14145 }
14146 }
14147 pub fn load_http_state_from_id(&self, id: impl IntoID<HttpStateId>) -> HttpState {
14149 let mut query = self.selection.select("loadHTTPStateFromID");
14150 query = query.arg_lazy(
14151 "id",
14152 Box::new(move || {
14153 let id = id.clone();
14154 Box::pin(async move { id.into_id().await.unwrap().quote() })
14155 }),
14156 );
14157 HttpState {
14158 proc: self.proc.clone(),
14159 selection: query,
14160 graphql_client: self.graphql_client.clone(),
14161 }
14162 }
14163 pub fn load_healthcheck_config_from_id(
14165 &self,
14166 id: impl IntoID<HealthcheckConfigId>,
14167 ) -> HealthcheckConfig {
14168 let mut query = self.selection.select("loadHealthcheckConfigFromID");
14169 query = query.arg_lazy(
14170 "id",
14171 Box::new(move || {
14172 let id = id.clone();
14173 Box::pin(async move { id.into_id().await.unwrap().quote() })
14174 }),
14175 );
14176 HealthcheckConfig {
14177 proc: self.proc.clone(),
14178 selection: query,
14179 graphql_client: self.graphql_client.clone(),
14180 }
14181 }
14182 pub fn load_host_from_id(&self, id: impl IntoID<HostId>) -> Host {
14184 let mut query = self.selection.select("loadHostFromID");
14185 query = query.arg_lazy(
14186 "id",
14187 Box::new(move || {
14188 let id = id.clone();
14189 Box::pin(async move { id.into_id().await.unwrap().quote() })
14190 }),
14191 );
14192 Host {
14193 proc: self.proc.clone(),
14194 selection: query,
14195 graphql_client: self.graphql_client.clone(),
14196 }
14197 }
14198 pub fn load_input_type_def_from_id(&self, id: impl IntoID<InputTypeDefId>) -> InputTypeDef {
14200 let mut query = self.selection.select("loadInputTypeDefFromID");
14201 query = query.arg_lazy(
14202 "id",
14203 Box::new(move || {
14204 let id = id.clone();
14205 Box::pin(async move { id.into_id().await.unwrap().quote() })
14206 }),
14207 );
14208 InputTypeDef {
14209 proc: self.proc.clone(),
14210 selection: query,
14211 graphql_client: self.graphql_client.clone(),
14212 }
14213 }
14214 pub fn load_interface_type_def_from_id(
14216 &self,
14217 id: impl IntoID<InterfaceTypeDefId>,
14218 ) -> InterfaceTypeDef {
14219 let mut query = self.selection.select("loadInterfaceTypeDefFromID");
14220 query = query.arg_lazy(
14221 "id",
14222 Box::new(move || {
14223 let id = id.clone();
14224 Box::pin(async move { id.into_id().await.unwrap().quote() })
14225 }),
14226 );
14227 InterfaceTypeDef {
14228 proc: self.proc.clone(),
14229 selection: query,
14230 graphql_client: self.graphql_client.clone(),
14231 }
14232 }
14233 pub fn load_json_value_from_id(&self, id: impl IntoID<JsonValueId>) -> JsonValue {
14235 let mut query = self.selection.select("loadJSONValueFromID");
14236 query = query.arg_lazy(
14237 "id",
14238 Box::new(move || {
14239 let id = id.clone();
14240 Box::pin(async move { id.into_id().await.unwrap().quote() })
14241 }),
14242 );
14243 JsonValue {
14244 proc: self.proc.clone(),
14245 selection: query,
14246 graphql_client: self.graphql_client.clone(),
14247 }
14248 }
14249 pub fn load_llm_from_id(&self, id: impl IntoID<Llmid>) -> Llm {
14251 let mut query = self.selection.select("loadLLMFromID");
14252 query = query.arg_lazy(
14253 "id",
14254 Box::new(move || {
14255 let id = id.clone();
14256 Box::pin(async move { id.into_id().await.unwrap().quote() })
14257 }),
14258 );
14259 Llm {
14260 proc: self.proc.clone(),
14261 selection: query,
14262 graphql_client: self.graphql_client.clone(),
14263 }
14264 }
14265 pub fn load_llm_token_usage_from_id(&self, id: impl IntoID<LlmTokenUsageId>) -> LlmTokenUsage {
14267 let mut query = self.selection.select("loadLLMTokenUsageFromID");
14268 query = query.arg_lazy(
14269 "id",
14270 Box::new(move || {
14271 let id = id.clone();
14272 Box::pin(async move { id.into_id().await.unwrap().quote() })
14273 }),
14274 );
14275 LlmTokenUsage {
14276 proc: self.proc.clone(),
14277 selection: query,
14278 graphql_client: self.graphql_client.clone(),
14279 }
14280 }
14281 pub fn load_label_from_id(&self, id: impl IntoID<LabelId>) -> Label {
14283 let mut query = self.selection.select("loadLabelFromID");
14284 query = query.arg_lazy(
14285 "id",
14286 Box::new(move || {
14287 let id = id.clone();
14288 Box::pin(async move { id.into_id().await.unwrap().quote() })
14289 }),
14290 );
14291 Label {
14292 proc: self.proc.clone(),
14293 selection: query,
14294 graphql_client: self.graphql_client.clone(),
14295 }
14296 }
14297 pub fn load_list_type_def_from_id(&self, id: impl IntoID<ListTypeDefId>) -> ListTypeDef {
14299 let mut query = self.selection.select("loadListTypeDefFromID");
14300 query = query.arg_lazy(
14301 "id",
14302 Box::new(move || {
14303 let id = id.clone();
14304 Box::pin(async move { id.into_id().await.unwrap().quote() })
14305 }),
14306 );
14307 ListTypeDef {
14308 proc: self.proc.clone(),
14309 selection: query,
14310 graphql_client: self.graphql_client.clone(),
14311 }
14312 }
14313 pub fn load_module_config_client_from_id(
14315 &self,
14316 id: impl IntoID<ModuleConfigClientId>,
14317 ) -> ModuleConfigClient {
14318 let mut query = self.selection.select("loadModuleConfigClientFromID");
14319 query = query.arg_lazy(
14320 "id",
14321 Box::new(move || {
14322 let id = id.clone();
14323 Box::pin(async move { id.into_id().await.unwrap().quote() })
14324 }),
14325 );
14326 ModuleConfigClient {
14327 proc: self.proc.clone(),
14328 selection: query,
14329 graphql_client: self.graphql_client.clone(),
14330 }
14331 }
14332 pub fn load_module_from_id(&self, id: impl IntoID<ModuleId>) -> Module {
14334 let mut query = self.selection.select("loadModuleFromID");
14335 query = query.arg_lazy(
14336 "id",
14337 Box::new(move || {
14338 let id = id.clone();
14339 Box::pin(async move { id.into_id().await.unwrap().quote() })
14340 }),
14341 );
14342 Module {
14343 proc: self.proc.clone(),
14344 selection: query,
14345 graphql_client: self.graphql_client.clone(),
14346 }
14347 }
14348 pub fn load_module_source_from_id(&self, id: impl IntoID<ModuleSourceId>) -> ModuleSource {
14350 let mut query = self.selection.select("loadModuleSourceFromID");
14351 query = query.arg_lazy(
14352 "id",
14353 Box::new(move || {
14354 let id = id.clone();
14355 Box::pin(async move { id.into_id().await.unwrap().quote() })
14356 }),
14357 );
14358 ModuleSource {
14359 proc: self.proc.clone(),
14360 selection: query,
14361 graphql_client: self.graphql_client.clone(),
14362 }
14363 }
14364 pub fn load_object_type_def_from_id(&self, id: impl IntoID<ObjectTypeDefId>) -> ObjectTypeDef {
14366 let mut query = self.selection.select("loadObjectTypeDefFromID");
14367 query = query.arg_lazy(
14368 "id",
14369 Box::new(move || {
14370 let id = id.clone();
14371 Box::pin(async move { id.into_id().await.unwrap().quote() })
14372 }),
14373 );
14374 ObjectTypeDef {
14375 proc: self.proc.clone(),
14376 selection: query,
14377 graphql_client: self.graphql_client.clone(),
14378 }
14379 }
14380 pub fn load_port_from_id(&self, id: impl IntoID<PortId>) -> Port {
14382 let mut query = self.selection.select("loadPortFromID");
14383 query = query.arg_lazy(
14384 "id",
14385 Box::new(move || {
14386 let id = id.clone();
14387 Box::pin(async move { id.into_id().await.unwrap().quote() })
14388 }),
14389 );
14390 Port {
14391 proc: self.proc.clone(),
14392 selection: query,
14393 graphql_client: self.graphql_client.clone(),
14394 }
14395 }
14396 pub fn load_remote_git_mirror_from_id(
14398 &self,
14399 id: impl IntoID<RemoteGitMirrorId>,
14400 ) -> RemoteGitMirror {
14401 let mut query = self.selection.select("loadRemoteGitMirrorFromID");
14402 query = query.arg_lazy(
14403 "id",
14404 Box::new(move || {
14405 let id = id.clone();
14406 Box::pin(async move { id.into_id().await.unwrap().quote() })
14407 }),
14408 );
14409 RemoteGitMirror {
14410 proc: self.proc.clone(),
14411 selection: query,
14412 graphql_client: self.graphql_client.clone(),
14413 }
14414 }
14415 pub fn load_sdk_config_from_id(&self, id: impl IntoID<SdkConfigId>) -> SdkConfig {
14417 let mut query = self.selection.select("loadSDKConfigFromID");
14418 query = query.arg_lazy(
14419 "id",
14420 Box::new(move || {
14421 let id = id.clone();
14422 Box::pin(async move { id.into_id().await.unwrap().quote() })
14423 }),
14424 );
14425 SdkConfig {
14426 proc: self.proc.clone(),
14427 selection: query,
14428 graphql_client: self.graphql_client.clone(),
14429 }
14430 }
14431 pub fn load_scalar_type_def_from_id(&self, id: impl IntoID<ScalarTypeDefId>) -> ScalarTypeDef {
14433 let mut query = self.selection.select("loadScalarTypeDefFromID");
14434 query = query.arg_lazy(
14435 "id",
14436 Box::new(move || {
14437 let id = id.clone();
14438 Box::pin(async move { id.into_id().await.unwrap().quote() })
14439 }),
14440 );
14441 ScalarTypeDef {
14442 proc: self.proc.clone(),
14443 selection: query,
14444 graphql_client: self.graphql_client.clone(),
14445 }
14446 }
14447 pub fn load_search_result_from_id(&self, id: impl IntoID<SearchResultId>) -> SearchResult {
14449 let mut query = self.selection.select("loadSearchResultFromID");
14450 query = query.arg_lazy(
14451 "id",
14452 Box::new(move || {
14453 let id = id.clone();
14454 Box::pin(async move { id.into_id().await.unwrap().quote() })
14455 }),
14456 );
14457 SearchResult {
14458 proc: self.proc.clone(),
14459 selection: query,
14460 graphql_client: self.graphql_client.clone(),
14461 }
14462 }
14463 pub fn load_search_submatch_from_id(
14465 &self,
14466 id: impl IntoID<SearchSubmatchId>,
14467 ) -> SearchSubmatch {
14468 let mut query = self.selection.select("loadSearchSubmatchFromID");
14469 query = query.arg_lazy(
14470 "id",
14471 Box::new(move || {
14472 let id = id.clone();
14473 Box::pin(async move { id.into_id().await.unwrap().quote() })
14474 }),
14475 );
14476 SearchSubmatch {
14477 proc: self.proc.clone(),
14478 selection: query,
14479 graphql_client: self.graphql_client.clone(),
14480 }
14481 }
14482 pub fn load_secret_from_id(&self, id: impl IntoID<SecretId>) -> Secret {
14484 let mut query = self.selection.select("loadSecretFromID");
14485 query = query.arg_lazy(
14486 "id",
14487 Box::new(move || {
14488 let id = id.clone();
14489 Box::pin(async move { id.into_id().await.unwrap().quote() })
14490 }),
14491 );
14492 Secret {
14493 proc: self.proc.clone(),
14494 selection: query,
14495 graphql_client: self.graphql_client.clone(),
14496 }
14497 }
14498 pub fn load_service_from_id(&self, id: impl IntoID<ServiceId>) -> Service {
14500 let mut query = self.selection.select("loadServiceFromID");
14501 query = query.arg_lazy(
14502 "id",
14503 Box::new(move || {
14504 let id = id.clone();
14505 Box::pin(async move { id.into_id().await.unwrap().quote() })
14506 }),
14507 );
14508 Service {
14509 proc: self.proc.clone(),
14510 selection: query,
14511 graphql_client: self.graphql_client.clone(),
14512 }
14513 }
14514 pub fn load_socket_from_id(&self, id: impl IntoID<SocketId>) -> Socket {
14516 let mut query = self.selection.select("loadSocketFromID");
14517 query = query.arg_lazy(
14518 "id",
14519 Box::new(move || {
14520 let id = id.clone();
14521 Box::pin(async move { id.into_id().await.unwrap().quote() })
14522 }),
14523 );
14524 Socket {
14525 proc: self.proc.clone(),
14526 selection: query,
14527 graphql_client: self.graphql_client.clone(),
14528 }
14529 }
14530 pub fn load_source_map_from_id(&self, id: impl IntoID<SourceMapId>) -> SourceMap {
14532 let mut query = self.selection.select("loadSourceMapFromID");
14533 query = query.arg_lazy(
14534 "id",
14535 Box::new(move || {
14536 let id = id.clone();
14537 Box::pin(async move { id.into_id().await.unwrap().quote() })
14538 }),
14539 );
14540 SourceMap {
14541 proc: self.proc.clone(),
14542 selection: query,
14543 graphql_client: self.graphql_client.clone(),
14544 }
14545 }
14546 pub fn load_stat_from_id(&self, id: impl IntoID<StatId>) -> Stat {
14548 let mut query = self.selection.select("loadStatFromID");
14549 query = query.arg_lazy(
14550 "id",
14551 Box::new(move || {
14552 let id = id.clone();
14553 Box::pin(async move { id.into_id().await.unwrap().quote() })
14554 }),
14555 );
14556 Stat {
14557 proc: self.proc.clone(),
14558 selection: query,
14559 graphql_client: self.graphql_client.clone(),
14560 }
14561 }
14562 pub fn load_syncer_from_id(&self, id: impl IntoID<SyncerId>) -> SyncerClient {
14564 let mut query = self.selection.select("loadSyncerFromID");
14565 query = query.arg_lazy(
14566 "id",
14567 Box::new(move || {
14568 let id = id.clone();
14569 Box::pin(async move { id.into_id().await.unwrap().quote() })
14570 }),
14571 );
14572 SyncerClient {
14573 proc: self.proc.clone(),
14574 selection: query,
14575 graphql_client: self.graphql_client.clone(),
14576 }
14577 }
14578 pub fn load_terminal_from_id(&self, id: impl IntoID<TerminalId>) -> Terminal {
14580 let mut query = self.selection.select("loadTerminalFromID");
14581 query = query.arg_lazy(
14582 "id",
14583 Box::new(move || {
14584 let id = id.clone();
14585 Box::pin(async move { id.into_id().await.unwrap().quote() })
14586 }),
14587 );
14588 Terminal {
14589 proc: self.proc.clone(),
14590 selection: query,
14591 graphql_client: self.graphql_client.clone(),
14592 }
14593 }
14594 pub fn load_type_def_from_id(&self, id: impl IntoID<TypeDefId>) -> TypeDef {
14596 let mut query = self.selection.select("loadTypeDefFromID");
14597 query = query.arg_lazy(
14598 "id",
14599 Box::new(move || {
14600 let id = id.clone();
14601 Box::pin(async move { id.into_id().await.unwrap().quote() })
14602 }),
14603 );
14604 TypeDef {
14605 proc: self.proc.clone(),
14606 selection: query,
14607 graphql_client: self.graphql_client.clone(),
14608 }
14609 }
14610 pub fn load_up_from_id(&self, id: impl IntoID<UpId>) -> Up {
14612 let mut query = self.selection.select("loadUpFromID");
14613 query = query.arg_lazy(
14614 "id",
14615 Box::new(move || {
14616 let id = id.clone();
14617 Box::pin(async move { id.into_id().await.unwrap().quote() })
14618 }),
14619 );
14620 Up {
14621 proc: self.proc.clone(),
14622 selection: query,
14623 graphql_client: self.graphql_client.clone(),
14624 }
14625 }
14626 pub fn load_up_group_from_id(&self, id: impl IntoID<UpGroupId>) -> UpGroup {
14628 let mut query = self.selection.select("loadUpGroupFromID");
14629 query = query.arg_lazy(
14630 "id",
14631 Box::new(move || {
14632 let id = id.clone();
14633 Box::pin(async move { id.into_id().await.unwrap().quote() })
14634 }),
14635 );
14636 UpGroup {
14637 proc: self.proc.clone(),
14638 selection: query,
14639 graphql_client: self.graphql_client.clone(),
14640 }
14641 }
14642 pub fn load_volume_from_id(&self, id: impl IntoID<VolumeId>) -> Volume {
14644 let mut query = self.selection.select("loadVolumeFromID");
14645 query = query.arg_lazy(
14646 "id",
14647 Box::new(move || {
14648 let id = id.clone();
14649 Box::pin(async move { id.into_id().await.unwrap().quote() })
14650 }),
14651 );
14652 Volume {
14653 proc: self.proc.clone(),
14654 selection: query,
14655 graphql_client: self.graphql_client.clone(),
14656 }
14657 }
14658 pub fn load_workspace_from_id(&self, id: impl IntoID<WorkspaceId>) -> Workspace {
14660 let mut query = self.selection.select("loadWorkspaceFromID");
14661 query = query.arg_lazy(
14662 "id",
14663 Box::new(move || {
14664 let id = id.clone();
14665 Box::pin(async move { id.into_id().await.unwrap().quote() })
14666 }),
14667 );
14668 Workspace {
14669 proc: self.proc.clone(),
14670 selection: query,
14671 graphql_client: self.graphql_client.clone(),
14672 }
14673 }
14674 pub fn module(&self) -> Module {
14676 let query = self.selection.select("module");
14677 Module {
14678 proc: self.proc.clone(),
14679 selection: query,
14680 graphql_client: self.graphql_client.clone(),
14681 }
14682 }
14683 pub fn module_source(&self, ref_string: impl Into<String>) -> ModuleSource {
14690 let mut query = self.selection.select("moduleSource");
14691 query = query.arg("refString", ref_string.into());
14692 ModuleSource {
14693 proc: self.proc.clone(),
14694 selection: query,
14695 graphql_client: self.graphql_client.clone(),
14696 }
14697 }
14698 pub fn module_source_opts<'a>(
14705 &self,
14706 ref_string: impl Into<String>,
14707 opts: QueryModuleSourceOpts<'a>,
14708 ) -> ModuleSource {
14709 let mut query = self.selection.select("moduleSource");
14710 query = query.arg("refString", ref_string.into());
14711 if let Some(ref_pin) = opts.ref_pin {
14712 query = query.arg("refPin", ref_pin);
14713 }
14714 if let Some(disable_find_up) = opts.disable_find_up {
14715 query = query.arg("disableFindUp", disable_find_up);
14716 }
14717 if let Some(allow_not_exists) = opts.allow_not_exists {
14718 query = query.arg("allowNotExists", allow_not_exists);
14719 }
14720 if let Some(require_kind) = opts.require_kind {
14721 query = query.arg("requireKind", require_kind);
14722 }
14723 ModuleSource {
14724 proc: self.proc.clone(),
14725 selection: query,
14726 graphql_client: self.graphql_client.clone(),
14727 }
14728 }
14729 pub fn node(&self, id: impl IntoID<Id>) -> NodeClient {
14731 let mut query = self.selection.select("node");
14732 query = query.arg_lazy(
14733 "id",
14734 Box::new(move || {
14735 let id = id.clone();
14736 Box::pin(async move { id.into_id().await.unwrap().quote() })
14737 }),
14738 );
14739 NodeClient {
14740 proc: self.proc.clone(),
14741 selection: query,
14742 graphql_client: self.graphql_client.clone(),
14743 }
14744 }
14745 pub fn secret(&self, uri: impl Into<String>) -> Secret {
14752 let mut query = self.selection.select("secret");
14753 query = query.arg("uri", uri.into());
14754 Secret {
14755 proc: self.proc.clone(),
14756 selection: query,
14757 graphql_client: self.graphql_client.clone(),
14758 }
14759 }
14760 pub fn secret_opts<'a>(&self, uri: impl Into<String>, opts: QuerySecretOpts<'a>) -> Secret {
14767 let mut query = self.selection.select("secret");
14768 query = query.arg("uri", uri.into());
14769 if let Some(cache_key) = opts.cache_key {
14770 query = query.arg("cacheKey", cache_key);
14771 }
14772 Secret {
14773 proc: self.proc.clone(),
14774 selection: query,
14775 graphql_client: self.graphql_client.clone(),
14776 }
14777 }
14778 pub fn set_secret(&self, name: impl Into<String>, plaintext: impl Into<String>) -> Secret {
14786 let mut query = self.selection.select("setSecret");
14787 query = query.arg("name", name.into());
14788 query = query.arg("plaintext", plaintext.into());
14789 Secret {
14790 proc: self.proc.clone(),
14791 selection: query,
14792 graphql_client: self.graphql_client.clone(),
14793 }
14794 }
14795 pub fn source_map(&self, filename: impl Into<String>, line: isize, column: isize) -> SourceMap {
14803 let mut query = self.selection.select("sourceMap");
14804 query = query.arg("filename", filename.into());
14805 query = query.arg("line", line);
14806 query = query.arg("column", column);
14807 SourceMap {
14808 proc: self.proc.clone(),
14809 selection: query,
14810 graphql_client: self.graphql_client.clone(),
14811 }
14812 }
14813 pub fn sshfs_volume(
14821 &self,
14822 endpoint: impl Into<String>,
14823 private_key: impl IntoID<Id>,
14824 ) -> Volume {
14825 let mut query = self.selection.select("sshfsVolume");
14826 query = query.arg("endpoint", endpoint.into());
14827 query = query.arg_lazy(
14828 "privateKey",
14829 Box::new(move || {
14830 let private_key = private_key.clone();
14831 Box::pin(async move { private_key.into_id().await.unwrap().quote() })
14832 }),
14833 );
14834 Volume {
14835 proc: self.proc.clone(),
14836 selection: query,
14837 graphql_client: self.graphql_client.clone(),
14838 }
14839 }
14840 pub fn sshfs_volume_opts<'a>(
14848 &self,
14849 endpoint: impl Into<String>,
14850 private_key: impl IntoID<Id>,
14851 opts: QuerySshfsVolumeOpts<'a>,
14852 ) -> Volume {
14853 let mut query = self.selection.select("sshfsVolume");
14854 query = query.arg("endpoint", endpoint.into());
14855 query = query.arg_lazy(
14856 "privateKey",
14857 Box::new(move || {
14858 let private_key = private_key.clone();
14859 Box::pin(async move { private_key.into_id().await.unwrap().quote() })
14860 }),
14861 );
14862 if let Some(known_hosts) = opts.known_hosts {
14863 query = query.arg("knownHosts", known_hosts);
14864 }
14865 if let Some(cache_key) = opts.cache_key {
14866 query = query.arg("cacheKey", cache_key);
14867 }
14868 if let Some(insecure_skip_host_key_check) = opts.insecure_skip_host_key_check {
14869 query = query.arg("insecureSkipHostKeyCheck", insecure_skip_host_key_check);
14870 }
14871 if let Some(experimental_service_host) = opts.experimental_service_host {
14872 query = query.arg("experimentalServiceHost", experimental_service_host);
14873 }
14874 Volume {
14875 proc: self.proc.clone(),
14876 selection: query,
14877 graphql_client: self.graphql_client.clone(),
14878 }
14879 }
14880 pub fn type_def(&self) -> TypeDef {
14882 let query = self.selection.select("typeDef");
14883 TypeDef {
14884 proc: self.proc.clone(),
14885 selection: query,
14886 graphql_client: self.graphql_client.clone(),
14887 }
14888 }
14889 pub async fn version(&self) -> Result<String, DaggerError> {
14891 let query = self.selection.select("version");
14892 query.execute(self.graphql_client.clone()).await
14893 }
14894}
14895impl Node for Query {
14896 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14897 let query = self.selection.select("id");
14898 let graphql_client = self.graphql_client.clone();
14899 async move { query.execute(graphql_client).await }
14900 }
14901}
14902#[derive(Clone)]
14903pub struct RemoteGitMirror {
14904 pub proc: Option<Arc<DaggerSessionProc>>,
14905 pub selection: Selection,
14906 pub graphql_client: DynGraphQLClient,
14907}
14908impl IntoID<Id> for RemoteGitMirror {
14909 fn into_id(
14910 self,
14911 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14912 Box::pin(async move { self.id().await })
14913 }
14914}
14915impl Loadable for RemoteGitMirror {
14916 fn graphql_type() -> &'static str {
14917 "RemoteGitMirror"
14918 }
14919 fn from_query(
14920 proc: Option<Arc<DaggerSessionProc>>,
14921 selection: Selection,
14922 graphql_client: DynGraphQLClient,
14923 ) -> Self {
14924 Self {
14925 proc,
14926 selection,
14927 graphql_client,
14928 }
14929 }
14930}
14931impl RemoteGitMirror {
14932 pub async fn id(&self) -> Result<Id, DaggerError> {
14934 let query = self.selection.select("id");
14935 query.execute(self.graphql_client.clone()).await
14936 }
14937}
14938impl Node for RemoteGitMirror {
14939 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14940 let query = self.selection.select("id");
14941 let graphql_client = self.graphql_client.clone();
14942 async move { query.execute(graphql_client).await }
14943 }
14944}
14945#[derive(Clone)]
14946pub struct SdkConfig {
14947 pub proc: Option<Arc<DaggerSessionProc>>,
14948 pub selection: Selection,
14949 pub graphql_client: DynGraphQLClient,
14950}
14951impl IntoID<Id> for SdkConfig {
14952 fn into_id(
14953 self,
14954 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
14955 Box::pin(async move { self.id().await })
14956 }
14957}
14958impl Loadable for SdkConfig {
14959 fn graphql_type() -> &'static str {
14960 "SDKConfig"
14961 }
14962 fn from_query(
14963 proc: Option<Arc<DaggerSessionProc>>,
14964 selection: Selection,
14965 graphql_client: DynGraphQLClient,
14966 ) -> Self {
14967 Self {
14968 proc,
14969 selection,
14970 graphql_client,
14971 }
14972 }
14973}
14974impl SdkConfig {
14975 pub async fn debug(&self) -> Result<bool, DaggerError> {
14977 let query = self.selection.select("debug");
14978 query.execute(self.graphql_client.clone()).await
14979 }
14980 pub async fn id(&self) -> Result<Id, DaggerError> {
14982 let query = self.selection.select("id");
14983 query.execute(self.graphql_client.clone()).await
14984 }
14985 pub async fn source(&self) -> Result<String, DaggerError> {
14987 let query = self.selection.select("source");
14988 query.execute(self.graphql_client.clone()).await
14989 }
14990}
14991impl Node for SdkConfig {
14992 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
14993 let query = self.selection.select("id");
14994 let graphql_client = self.graphql_client.clone();
14995 async move { query.execute(graphql_client).await }
14996 }
14997}
14998#[derive(Clone)]
14999pub struct ScalarTypeDef {
15000 pub proc: Option<Arc<DaggerSessionProc>>,
15001 pub selection: Selection,
15002 pub graphql_client: DynGraphQLClient,
15003}
15004impl IntoID<Id> for ScalarTypeDef {
15005 fn into_id(
15006 self,
15007 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15008 Box::pin(async move { self.id().await })
15009 }
15010}
15011impl Loadable for ScalarTypeDef {
15012 fn graphql_type() -> &'static str {
15013 "ScalarTypeDef"
15014 }
15015 fn from_query(
15016 proc: Option<Arc<DaggerSessionProc>>,
15017 selection: Selection,
15018 graphql_client: DynGraphQLClient,
15019 ) -> Self {
15020 Self {
15021 proc,
15022 selection,
15023 graphql_client,
15024 }
15025 }
15026}
15027impl ScalarTypeDef {
15028 pub async fn description(&self) -> Result<String, DaggerError> {
15030 let query = self.selection.select("description");
15031 query.execute(self.graphql_client.clone()).await
15032 }
15033 pub async fn id(&self) -> Result<Id, DaggerError> {
15035 let query = self.selection.select("id");
15036 query.execute(self.graphql_client.clone()).await
15037 }
15038 pub async fn name(&self) -> Result<String, DaggerError> {
15040 let query = self.selection.select("name");
15041 query.execute(self.graphql_client.clone()).await
15042 }
15043 pub async fn source_module_name(&self) -> Result<String, DaggerError> {
15045 let query = self.selection.select("sourceModuleName");
15046 query.execute(self.graphql_client.clone()).await
15047 }
15048}
15049impl Node for ScalarTypeDef {
15050 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15051 let query = self.selection.select("id");
15052 let graphql_client = self.graphql_client.clone();
15053 async move { query.execute(graphql_client).await }
15054 }
15055}
15056#[derive(Clone)]
15057pub struct SearchResult {
15058 pub proc: Option<Arc<DaggerSessionProc>>,
15059 pub selection: Selection,
15060 pub graphql_client: DynGraphQLClient,
15061}
15062impl IntoID<Id> for SearchResult {
15063 fn into_id(
15064 self,
15065 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15066 Box::pin(async move { self.id().await })
15067 }
15068}
15069impl Loadable for SearchResult {
15070 fn graphql_type() -> &'static str {
15071 "SearchResult"
15072 }
15073 fn from_query(
15074 proc: Option<Arc<DaggerSessionProc>>,
15075 selection: Selection,
15076 graphql_client: DynGraphQLClient,
15077 ) -> Self {
15078 Self {
15079 proc,
15080 selection,
15081 graphql_client,
15082 }
15083 }
15084}
15085impl SearchResult {
15086 pub async fn absolute_offset(&self) -> Result<isize, DaggerError> {
15088 let query = self.selection.select("absoluteOffset");
15089 query.execute(self.graphql_client.clone()).await
15090 }
15091 pub async fn file_path(&self) -> Result<String, DaggerError> {
15093 let query = self.selection.select("filePath");
15094 query.execute(self.graphql_client.clone()).await
15095 }
15096 pub async fn id(&self) -> Result<Id, DaggerError> {
15098 let query = self.selection.select("id");
15099 query.execute(self.graphql_client.clone()).await
15100 }
15101 pub async fn line_number(&self) -> Result<isize, DaggerError> {
15103 let query = self.selection.select("lineNumber");
15104 query.execute(self.graphql_client.clone()).await
15105 }
15106 pub async fn matched_lines(&self) -> Result<String, DaggerError> {
15108 let query = self.selection.select("matchedLines");
15109 query.execute(self.graphql_client.clone()).await
15110 }
15111 pub async fn submatches(&self) -> Result<Vec<SearchSubmatch>, DaggerError> {
15113 let query = self.selection.select("submatches");
15114 let query = query.select("id");
15115 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15116 Ok(ids
15117 .into_iter()
15118 .map(|id| SearchSubmatch {
15119 proc: self.proc.clone(),
15120 selection: crate::querybuilder::query()
15121 .select("node")
15122 .arg("id", &id.0)
15123 .inline_fragment("SearchSubmatch"),
15124 graphql_client: self.graphql_client.clone(),
15125 })
15126 .collect())
15127 }
15128}
15129impl Node for SearchResult {
15130 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15131 let query = self.selection.select("id");
15132 let graphql_client = self.graphql_client.clone();
15133 async move { query.execute(graphql_client).await }
15134 }
15135}
15136#[derive(Clone)]
15137pub struct SearchSubmatch {
15138 pub proc: Option<Arc<DaggerSessionProc>>,
15139 pub selection: Selection,
15140 pub graphql_client: DynGraphQLClient,
15141}
15142impl IntoID<Id> for SearchSubmatch {
15143 fn into_id(
15144 self,
15145 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15146 Box::pin(async move { self.id().await })
15147 }
15148}
15149impl Loadable for SearchSubmatch {
15150 fn graphql_type() -> &'static str {
15151 "SearchSubmatch"
15152 }
15153 fn from_query(
15154 proc: Option<Arc<DaggerSessionProc>>,
15155 selection: Selection,
15156 graphql_client: DynGraphQLClient,
15157 ) -> Self {
15158 Self {
15159 proc,
15160 selection,
15161 graphql_client,
15162 }
15163 }
15164}
15165impl SearchSubmatch {
15166 pub async fn end(&self) -> Result<isize, DaggerError> {
15168 let query = self.selection.select("end");
15169 query.execute(self.graphql_client.clone()).await
15170 }
15171 pub async fn id(&self) -> Result<Id, DaggerError> {
15173 let query = self.selection.select("id");
15174 query.execute(self.graphql_client.clone()).await
15175 }
15176 pub async fn start(&self) -> Result<isize, DaggerError> {
15178 let query = self.selection.select("start");
15179 query.execute(self.graphql_client.clone()).await
15180 }
15181 pub async fn text(&self) -> Result<String, DaggerError> {
15183 let query = self.selection.select("text");
15184 query.execute(self.graphql_client.clone()).await
15185 }
15186}
15187impl Node for SearchSubmatch {
15188 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15189 let query = self.selection.select("id");
15190 let graphql_client = self.graphql_client.clone();
15191 async move { query.execute(graphql_client).await }
15192 }
15193}
15194#[derive(Clone)]
15195pub struct Secret {
15196 pub proc: Option<Arc<DaggerSessionProc>>,
15197 pub selection: Selection,
15198 pub graphql_client: DynGraphQLClient,
15199}
15200impl IntoID<Id> for Secret {
15201 fn into_id(
15202 self,
15203 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15204 Box::pin(async move { self.id().await })
15205 }
15206}
15207impl Loadable for Secret {
15208 fn graphql_type() -> &'static str {
15209 "Secret"
15210 }
15211 fn from_query(
15212 proc: Option<Arc<DaggerSessionProc>>,
15213 selection: Selection,
15214 graphql_client: DynGraphQLClient,
15215 ) -> Self {
15216 Self {
15217 proc,
15218 selection,
15219 graphql_client,
15220 }
15221 }
15222}
15223impl Secret {
15224 pub async fn id(&self) -> Result<Id, DaggerError> {
15226 let query = self.selection.select("id");
15227 query.execute(self.graphql_client.clone()).await
15228 }
15229 pub async fn name(&self) -> Result<String, DaggerError> {
15231 let query = self.selection.select("name");
15232 query.execute(self.graphql_client.clone()).await
15233 }
15234 pub async fn plaintext(&self) -> Result<String, DaggerError> {
15236 let query = self.selection.select("plaintext");
15237 query.execute(self.graphql_client.clone()).await
15238 }
15239 pub async fn uri(&self) -> Result<String, DaggerError> {
15241 let query = self.selection.select("uri");
15242 query.execute(self.graphql_client.clone()).await
15243 }
15244}
15245impl Node for Secret {
15246 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15247 let query = self.selection.select("id");
15248 let graphql_client = self.graphql_client.clone();
15249 async move { query.execute(graphql_client).await }
15250 }
15251}
15252#[derive(Clone)]
15253pub struct Service {
15254 pub proc: Option<Arc<DaggerSessionProc>>,
15255 pub selection: Selection,
15256 pub graphql_client: DynGraphQLClient,
15257}
15258#[derive(Builder, Debug, PartialEq)]
15259pub struct ServiceEndpointOpts<'a> {
15260 #[builder(setter(into, strip_option), default)]
15262 pub port: Option<isize>,
15263 #[builder(setter(into, strip_option), default)]
15265 pub scheme: Option<&'a str>,
15266}
15267#[derive(Builder, Debug, PartialEq)]
15268pub struct ServiceStopOpts {
15269 #[builder(setter(into, strip_option), default)]
15271 pub kill: Option<bool>,
15272}
15273#[derive(Builder, Debug, PartialEq)]
15274pub struct ServiceTerminalOpts<'a> {
15275 #[builder(setter(into, strip_option), default)]
15276 pub cmd: Option<Vec<&'a str>>,
15277}
15278#[derive(Builder, Debug, PartialEq)]
15279pub struct ServiceUpOpts {
15280 #[builder(setter(into, strip_option), default)]
15283 pub ports: Option<Vec<PortForward>>,
15284 #[builder(setter(into, strip_option), default)]
15286 pub random: Option<bool>,
15287}
15288impl IntoID<Id> for Service {
15289 fn into_id(
15290 self,
15291 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15292 Box::pin(async move { self.id().await })
15293 }
15294}
15295impl Loadable for Service {
15296 fn graphql_type() -> &'static str {
15297 "Service"
15298 }
15299 fn from_query(
15300 proc: Option<Arc<DaggerSessionProc>>,
15301 selection: Selection,
15302 graphql_client: DynGraphQLClient,
15303 ) -> Self {
15304 Self {
15305 proc,
15306 selection,
15307 graphql_client,
15308 }
15309 }
15310}
15311impl Service {
15312 pub async fn endpoint(&self) -> Result<String, DaggerError> {
15320 let query = self.selection.select("endpoint");
15321 query.execute(self.graphql_client.clone()).await
15322 }
15323 pub async fn endpoint_opts<'a>(
15331 &self,
15332 opts: ServiceEndpointOpts<'a>,
15333 ) -> Result<String, DaggerError> {
15334 let mut query = self.selection.select("endpoint");
15335 if let Some(port) = opts.port {
15336 query = query.arg("port", port);
15337 }
15338 if let Some(scheme) = opts.scheme {
15339 query = query.arg("scheme", scheme);
15340 }
15341 query.execute(self.graphql_client.clone()).await
15342 }
15343 pub async fn hostname(&self) -> Result<String, DaggerError> {
15345 let query = self.selection.select("hostname");
15346 query.execute(self.graphql_client.clone()).await
15347 }
15348 pub async fn id(&self) -> Result<Id, DaggerError> {
15350 let query = self.selection.select("id");
15351 query.execute(self.graphql_client.clone()).await
15352 }
15353 pub async fn ports(&self) -> Result<Vec<Port>, DaggerError> {
15355 let query = self.selection.select("ports");
15356 let query = query.select("id");
15357 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
15358 Ok(ids
15359 .into_iter()
15360 .map(|id| Port {
15361 proc: self.proc.clone(),
15362 selection: crate::querybuilder::query()
15363 .select("node")
15364 .arg("id", &id.0)
15365 .inline_fragment("Port"),
15366 graphql_client: self.graphql_client.clone(),
15367 })
15368 .collect())
15369 }
15370 pub async fn start(&self) -> Result<Service, DaggerError> {
15373 let query = self.selection.select("start");
15374 let id: Id = query.execute(self.graphql_client.clone()).await?;
15375 Ok(Service {
15376 proc: self.proc.clone(),
15377 selection: query
15378 .root()
15379 .select("node")
15380 .arg("id", &id.0)
15381 .inline_fragment("Service"),
15382 graphql_client: self.graphql_client.clone(),
15383 })
15384 }
15385 pub async fn stop(&self) -> Result<Service, DaggerError> {
15391 let query = self.selection.select("stop");
15392 let id: Id = query.execute(self.graphql_client.clone()).await?;
15393 Ok(Service {
15394 proc: self.proc.clone(),
15395 selection: query
15396 .root()
15397 .select("node")
15398 .arg("id", &id.0)
15399 .inline_fragment("Service"),
15400 graphql_client: self.graphql_client.clone(),
15401 })
15402 }
15403 pub async fn stop_opts(&self, opts: ServiceStopOpts) -> Result<Service, DaggerError> {
15409 let mut query = self.selection.select("stop");
15410 if let Some(kill) = opts.kill {
15411 query = query.arg("kill", kill);
15412 }
15413 let id: Id = query.execute(self.graphql_client.clone()).await?;
15414 Ok(Service {
15415 proc: self.proc.clone(),
15416 selection: query
15417 .root()
15418 .select("node")
15419 .arg("id", &id.0)
15420 .inline_fragment("Service"),
15421 graphql_client: self.graphql_client.clone(),
15422 })
15423 }
15424 pub async fn sync(&self) -> Result<Service, DaggerError> {
15426 let query = self.selection.select("sync");
15427 let id: Id = query.execute(self.graphql_client.clone()).await?;
15428 Ok(Service {
15429 proc: self.proc.clone(),
15430 selection: query
15431 .root()
15432 .select("node")
15433 .arg("id", &id.0)
15434 .inline_fragment("Service"),
15435 graphql_client: self.graphql_client.clone(),
15436 })
15437 }
15438 pub fn terminal(&self) -> Service {
15443 let query = self.selection.select("terminal");
15444 Service {
15445 proc: self.proc.clone(),
15446 selection: query,
15447 graphql_client: self.graphql_client.clone(),
15448 }
15449 }
15450 pub fn terminal_opts<'a>(&self, opts: ServiceTerminalOpts<'a>) -> Service {
15455 let mut query = self.selection.select("terminal");
15456 if let Some(cmd) = opts.cmd {
15457 query = query.arg("cmd", cmd);
15458 }
15459 Service {
15460 proc: self.proc.clone(),
15461 selection: query,
15462 graphql_client: self.graphql_client.clone(),
15463 }
15464 }
15465 pub async fn up(&self) -> Result<Void, DaggerError> {
15471 let query = self.selection.select("up");
15472 query.execute(self.graphql_client.clone()).await
15473 }
15474 pub async fn up_opts(&self, opts: ServiceUpOpts) -> Result<Void, DaggerError> {
15480 let mut query = self.selection.select("up");
15481 if let Some(ports) = opts.ports {
15482 query = query.arg("ports", ports);
15483 }
15484 if let Some(random) = opts.random {
15485 query = query.arg("random", random);
15486 }
15487 query.execute(self.graphql_client.clone()).await
15488 }
15489 pub fn with_hostname(&self, hostname: impl Into<String>) -> Service {
15495 let mut query = self.selection.select("withHostname");
15496 query = query.arg("hostname", hostname.into());
15497 Service {
15498 proc: self.proc.clone(),
15499 selection: query,
15500 graphql_client: self.graphql_client.clone(),
15501 }
15502 }
15503}
15504impl Node for Service {
15505 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15506 let query = self.selection.select("id");
15507 let graphql_client = self.graphql_client.clone();
15508 async move { query.execute(graphql_client).await }
15509 }
15510}
15511impl Syncer for Service {
15512 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15513 let query = self.selection.select("id");
15514 let graphql_client = self.graphql_client.clone();
15515 async move { query.execute(graphql_client).await }
15516 }
15517 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15518 let query = self.selection.select("sync");
15519 let graphql_client = self.graphql_client.clone();
15520 async move { query.execute(graphql_client).await }
15521 }
15522}
15523#[derive(Clone)]
15524pub struct Socket {
15525 pub proc: Option<Arc<DaggerSessionProc>>,
15526 pub selection: Selection,
15527 pub graphql_client: DynGraphQLClient,
15528}
15529impl IntoID<Id> for Socket {
15530 fn into_id(
15531 self,
15532 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15533 Box::pin(async move { self.id().await })
15534 }
15535}
15536impl Loadable for Socket {
15537 fn graphql_type() -> &'static str {
15538 "Socket"
15539 }
15540 fn from_query(
15541 proc: Option<Arc<DaggerSessionProc>>,
15542 selection: Selection,
15543 graphql_client: DynGraphQLClient,
15544 ) -> Self {
15545 Self {
15546 proc,
15547 selection,
15548 graphql_client,
15549 }
15550 }
15551}
15552impl Socket {
15553 pub async fn id(&self) -> Result<Id, DaggerError> {
15555 let query = self.selection.select("id");
15556 query.execute(self.graphql_client.clone()).await
15557 }
15558}
15559impl Node for Socket {
15560 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15561 let query = self.selection.select("id");
15562 let graphql_client = self.graphql_client.clone();
15563 async move { query.execute(graphql_client).await }
15564 }
15565}
15566#[derive(Clone)]
15567pub struct SourceMap {
15568 pub proc: Option<Arc<DaggerSessionProc>>,
15569 pub selection: Selection,
15570 pub graphql_client: DynGraphQLClient,
15571}
15572impl IntoID<Id> for SourceMap {
15573 fn into_id(
15574 self,
15575 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15576 Box::pin(async move { self.id().await })
15577 }
15578}
15579impl Loadable for SourceMap {
15580 fn graphql_type() -> &'static str {
15581 "SourceMap"
15582 }
15583 fn from_query(
15584 proc: Option<Arc<DaggerSessionProc>>,
15585 selection: Selection,
15586 graphql_client: DynGraphQLClient,
15587 ) -> Self {
15588 Self {
15589 proc,
15590 selection,
15591 graphql_client,
15592 }
15593 }
15594}
15595impl SourceMap {
15596 pub async fn column(&self) -> Result<isize, DaggerError> {
15598 let query = self.selection.select("column");
15599 query.execute(self.graphql_client.clone()).await
15600 }
15601 pub async fn filename(&self) -> Result<String, DaggerError> {
15603 let query = self.selection.select("filename");
15604 query.execute(self.graphql_client.clone()).await
15605 }
15606 pub async fn id(&self) -> Result<Id, DaggerError> {
15608 let query = self.selection.select("id");
15609 query.execute(self.graphql_client.clone()).await
15610 }
15611 pub async fn line(&self) -> Result<isize, DaggerError> {
15613 let query = self.selection.select("line");
15614 query.execute(self.graphql_client.clone()).await
15615 }
15616 pub async fn module(&self) -> Result<String, DaggerError> {
15618 let query = self.selection.select("module");
15619 query.execute(self.graphql_client.clone()).await
15620 }
15621 pub async fn url(&self) -> Result<String, DaggerError> {
15623 let query = self.selection.select("url");
15624 query.execute(self.graphql_client.clone()).await
15625 }
15626}
15627impl Node for SourceMap {
15628 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15629 let query = self.selection.select("id");
15630 let graphql_client = self.graphql_client.clone();
15631 async move { query.execute(graphql_client).await }
15632 }
15633}
15634#[derive(Clone)]
15635pub struct Stat {
15636 pub proc: Option<Arc<DaggerSessionProc>>,
15637 pub selection: Selection,
15638 pub graphql_client: DynGraphQLClient,
15639}
15640impl IntoID<Id> for Stat {
15641 fn into_id(
15642 self,
15643 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15644 Box::pin(async move { self.id().await })
15645 }
15646}
15647impl Loadable for Stat {
15648 fn graphql_type() -> &'static str {
15649 "Stat"
15650 }
15651 fn from_query(
15652 proc: Option<Arc<DaggerSessionProc>>,
15653 selection: Selection,
15654 graphql_client: DynGraphQLClient,
15655 ) -> Self {
15656 Self {
15657 proc,
15658 selection,
15659 graphql_client,
15660 }
15661 }
15662}
15663impl Stat {
15664 pub async fn file_type(&self) -> Result<FileType, DaggerError> {
15666 let query = self.selection.select("fileType");
15667 query.execute(self.graphql_client.clone()).await
15668 }
15669 pub async fn id(&self) -> Result<Id, DaggerError> {
15671 let query = self.selection.select("id");
15672 query.execute(self.graphql_client.clone()).await
15673 }
15674 pub async fn name(&self) -> Result<String, DaggerError> {
15676 let query = self.selection.select("name");
15677 query.execute(self.graphql_client.clone()).await
15678 }
15679 pub async fn permissions(&self) -> Result<isize, DaggerError> {
15681 let query = self.selection.select("permissions");
15682 query.execute(self.graphql_client.clone()).await
15683 }
15684 pub async fn size(&self) -> Result<isize, DaggerError> {
15686 let query = self.selection.select("size");
15687 query.execute(self.graphql_client.clone()).await
15688 }
15689}
15690impl Node for Stat {
15691 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15692 let query = self.selection.select("id");
15693 let graphql_client = self.graphql_client.clone();
15694 async move { query.execute(graphql_client).await }
15695 }
15696}
15697#[derive(Clone)]
15698pub struct Terminal {
15699 pub proc: Option<Arc<DaggerSessionProc>>,
15700 pub selection: Selection,
15701 pub graphql_client: DynGraphQLClient,
15702}
15703impl IntoID<Id> for Terminal {
15704 fn into_id(
15705 self,
15706 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15707 Box::pin(async move { self.id().await })
15708 }
15709}
15710impl Loadable for Terminal {
15711 fn graphql_type() -> &'static str {
15712 "Terminal"
15713 }
15714 fn from_query(
15715 proc: Option<Arc<DaggerSessionProc>>,
15716 selection: Selection,
15717 graphql_client: DynGraphQLClient,
15718 ) -> Self {
15719 Self {
15720 proc,
15721 selection,
15722 graphql_client,
15723 }
15724 }
15725}
15726impl Terminal {
15727 pub async fn id(&self) -> Result<Id, DaggerError> {
15729 let query = self.selection.select("id");
15730 query.execute(self.graphql_client.clone()).await
15731 }
15732 pub async fn sync(&self) -> Result<Terminal, DaggerError> {
15735 let query = self.selection.select("sync");
15736 let id: Id = query.execute(self.graphql_client.clone()).await?;
15737 Ok(Terminal {
15738 proc: self.proc.clone(),
15739 selection: query
15740 .root()
15741 .select("node")
15742 .arg("id", &id.0)
15743 .inline_fragment("Terminal"),
15744 graphql_client: self.graphql_client.clone(),
15745 })
15746 }
15747}
15748impl Node for Terminal {
15749 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15750 let query = self.selection.select("id");
15751 let graphql_client = self.graphql_client.clone();
15752 async move { query.execute(graphql_client).await }
15753 }
15754}
15755impl Syncer for Terminal {
15756 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15757 let query = self.selection.select("id");
15758 let graphql_client = self.graphql_client.clone();
15759 async move { query.execute(graphql_client).await }
15760 }
15761 fn sync(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
15762 let query = self.selection.select("sync");
15763 let graphql_client = self.graphql_client.clone();
15764 async move { query.execute(graphql_client).await }
15765 }
15766}
15767#[derive(Clone)]
15768pub struct TypeDef {
15769 pub proc: Option<Arc<DaggerSessionProc>>,
15770 pub selection: Selection,
15771 pub graphql_client: DynGraphQLClient,
15772}
15773#[derive(Builder, Debug, PartialEq)]
15774pub struct TypeDefWithEnumOpts<'a> {
15775 #[builder(setter(into, strip_option), default)]
15777 pub description: Option<&'a str>,
15778 #[builder(setter(into, strip_option), default)]
15780 pub source_map: Option<Id>,
15781}
15782#[derive(Builder, Debug, PartialEq)]
15783pub struct TypeDefWithEnumMemberOpts<'a> {
15784 #[builder(setter(into, strip_option), default)]
15786 pub deprecated: Option<&'a str>,
15787 #[builder(setter(into, strip_option), default)]
15789 pub description: Option<&'a str>,
15790 #[builder(setter(into, strip_option), default)]
15792 pub source_map: Option<Id>,
15793 #[builder(setter(into, strip_option), default)]
15795 pub value: Option<&'a str>,
15796}
15797#[derive(Builder, Debug, PartialEq)]
15798pub struct TypeDefWithEnumValueOpts<'a> {
15799 #[builder(setter(into, strip_option), default)]
15801 pub deprecated: Option<&'a str>,
15802 #[builder(setter(into, strip_option), default)]
15804 pub description: Option<&'a str>,
15805 #[builder(setter(into, strip_option), default)]
15807 pub source_map: Option<Id>,
15808}
15809#[derive(Builder, Debug, PartialEq)]
15810pub struct TypeDefWithFieldOpts<'a> {
15811 #[builder(setter(into, strip_option), default)]
15813 pub deprecated: Option<&'a str>,
15814 #[builder(setter(into, strip_option), default)]
15816 pub description: Option<&'a str>,
15817 #[builder(setter(into, strip_option), default)]
15819 pub source_map: Option<Id>,
15820}
15821#[derive(Builder, Debug, PartialEq)]
15822pub struct TypeDefWithInterfaceOpts<'a> {
15823 #[builder(setter(into, strip_option), default)]
15824 pub description: Option<&'a str>,
15825 #[builder(setter(into, strip_option), default)]
15826 pub source_map: Option<Id>,
15827}
15828#[derive(Builder, Debug, PartialEq)]
15829pub struct TypeDefWithObjectOpts<'a> {
15830 #[builder(setter(into, strip_option), default)]
15831 pub deprecated: Option<&'a str>,
15832 #[builder(setter(into, strip_option), default)]
15833 pub description: Option<&'a str>,
15834 #[builder(setter(into, strip_option), default)]
15835 pub source_map: Option<Id>,
15836}
15837#[derive(Builder, Debug, PartialEq)]
15838pub struct TypeDefWithScalarOpts<'a> {
15839 #[builder(setter(into, strip_option), default)]
15840 pub description: Option<&'a str>,
15841}
15842impl IntoID<Id> for TypeDef {
15843 fn into_id(
15844 self,
15845 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
15846 Box::pin(async move { self.id().await })
15847 }
15848}
15849impl Loadable for TypeDef {
15850 fn graphql_type() -> &'static str {
15851 "TypeDef"
15852 }
15853 fn from_query(
15854 proc: Option<Arc<DaggerSessionProc>>,
15855 selection: Selection,
15856 graphql_client: DynGraphQLClient,
15857 ) -> Self {
15858 Self {
15859 proc,
15860 selection,
15861 graphql_client,
15862 }
15863 }
15864}
15865impl TypeDef {
15866 pub fn as_enum(&self) -> EnumTypeDef {
15868 let query = self.selection.select("asEnum");
15869 EnumTypeDef {
15870 proc: self.proc.clone(),
15871 selection: query,
15872 graphql_client: self.graphql_client.clone(),
15873 }
15874 }
15875 pub fn as_input(&self) -> InputTypeDef {
15877 let query = self.selection.select("asInput");
15878 InputTypeDef {
15879 proc: self.proc.clone(),
15880 selection: query,
15881 graphql_client: self.graphql_client.clone(),
15882 }
15883 }
15884 pub fn as_interface(&self) -> InterfaceTypeDef {
15886 let query = self.selection.select("asInterface");
15887 InterfaceTypeDef {
15888 proc: self.proc.clone(),
15889 selection: query,
15890 graphql_client: self.graphql_client.clone(),
15891 }
15892 }
15893 pub fn as_list(&self) -> ListTypeDef {
15895 let query = self.selection.select("asList");
15896 ListTypeDef {
15897 proc: self.proc.clone(),
15898 selection: query,
15899 graphql_client: self.graphql_client.clone(),
15900 }
15901 }
15902 pub fn as_object(&self) -> ObjectTypeDef {
15904 let query = self.selection.select("asObject");
15905 ObjectTypeDef {
15906 proc: self.proc.clone(),
15907 selection: query,
15908 graphql_client: self.graphql_client.clone(),
15909 }
15910 }
15911 pub fn as_scalar(&self) -> ScalarTypeDef {
15913 let query = self.selection.select("asScalar");
15914 ScalarTypeDef {
15915 proc: self.proc.clone(),
15916 selection: query,
15917 graphql_client: self.graphql_client.clone(),
15918 }
15919 }
15920 pub async fn id(&self) -> Result<Id, DaggerError> {
15922 let query = self.selection.select("id");
15923 query.execute(self.graphql_client.clone()).await
15924 }
15925 pub async fn kind(&self) -> Result<TypeDefKind, DaggerError> {
15927 let query = self.selection.select("kind");
15928 query.execute(self.graphql_client.clone()).await
15929 }
15930 pub async fn name(&self) -> Result<String, DaggerError> {
15932 let query = self.selection.select("name");
15933 query.execute(self.graphql_client.clone()).await
15934 }
15935 pub async fn optional(&self) -> Result<bool, DaggerError> {
15937 let query = self.selection.select("optional");
15938 query.execute(self.graphql_client.clone()).await
15939 }
15940 pub fn with_constructor(&self, function: impl IntoID<Id>) -> TypeDef {
15942 let mut query = self.selection.select("withConstructor");
15943 query = query.arg_lazy(
15944 "function",
15945 Box::new(move || {
15946 let function = function.clone();
15947 Box::pin(async move { function.into_id().await.unwrap().quote() })
15948 }),
15949 );
15950 TypeDef {
15951 proc: self.proc.clone(),
15952 selection: query,
15953 graphql_client: self.graphql_client.clone(),
15954 }
15955 }
15956 pub fn with_enum(&self, name: impl Into<String>) -> TypeDef {
15964 let mut query = self.selection.select("withEnum");
15965 query = query.arg("name", name.into());
15966 TypeDef {
15967 proc: self.proc.clone(),
15968 selection: query,
15969 graphql_client: self.graphql_client.clone(),
15970 }
15971 }
15972 pub fn with_enum_opts<'a>(
15980 &self,
15981 name: impl Into<String>,
15982 opts: TypeDefWithEnumOpts<'a>,
15983 ) -> TypeDef {
15984 let mut query = self.selection.select("withEnum");
15985 query = query.arg("name", name.into());
15986 if let Some(description) = opts.description {
15987 query = query.arg("description", description);
15988 }
15989 if let Some(source_map) = opts.source_map {
15990 query = query.arg("sourceMap", source_map);
15991 }
15992 TypeDef {
15993 proc: self.proc.clone(),
15994 selection: query,
15995 graphql_client: self.graphql_client.clone(),
15996 }
15997 }
15998 pub fn with_enum_member(&self, name: impl Into<String>) -> TypeDef {
16005 let mut query = self.selection.select("withEnumMember");
16006 query = query.arg("name", name.into());
16007 TypeDef {
16008 proc: self.proc.clone(),
16009 selection: query,
16010 graphql_client: self.graphql_client.clone(),
16011 }
16012 }
16013 pub fn with_enum_member_opts<'a>(
16020 &self,
16021 name: impl Into<String>,
16022 opts: TypeDefWithEnumMemberOpts<'a>,
16023 ) -> TypeDef {
16024 let mut query = self.selection.select("withEnumMember");
16025 query = query.arg("name", name.into());
16026 if let Some(value) = opts.value {
16027 query = query.arg("value", value);
16028 }
16029 if let Some(description) = opts.description {
16030 query = query.arg("description", description);
16031 }
16032 if let Some(source_map) = opts.source_map {
16033 query = query.arg("sourceMap", source_map);
16034 }
16035 if let Some(deprecated) = opts.deprecated {
16036 query = query.arg("deprecated", deprecated);
16037 }
16038 TypeDef {
16039 proc: self.proc.clone(),
16040 selection: query,
16041 graphql_client: self.graphql_client.clone(),
16042 }
16043 }
16044 pub fn with_enum_value(&self, value: impl Into<String>) -> TypeDef {
16051 let mut query = self.selection.select("withEnumValue");
16052 query = query.arg("value", value.into());
16053 TypeDef {
16054 proc: self.proc.clone(),
16055 selection: query,
16056 graphql_client: self.graphql_client.clone(),
16057 }
16058 }
16059 pub fn with_enum_value_opts<'a>(
16066 &self,
16067 value: impl Into<String>,
16068 opts: TypeDefWithEnumValueOpts<'a>,
16069 ) -> TypeDef {
16070 let mut query = self.selection.select("withEnumValue");
16071 query = query.arg("value", value.into());
16072 if let Some(description) = opts.description {
16073 query = query.arg("description", description);
16074 }
16075 if let Some(source_map) = opts.source_map {
16076 query = query.arg("sourceMap", source_map);
16077 }
16078 if let Some(deprecated) = opts.deprecated {
16079 query = query.arg("deprecated", deprecated);
16080 }
16081 TypeDef {
16082 proc: self.proc.clone(),
16083 selection: query,
16084 graphql_client: self.graphql_client.clone(),
16085 }
16086 }
16087 pub fn with_field(&self, name: impl Into<String>, type_def: impl IntoID<Id>) -> TypeDef {
16095 let mut query = self.selection.select("withField");
16096 query = query.arg("name", name.into());
16097 query = query.arg_lazy(
16098 "typeDef",
16099 Box::new(move || {
16100 let type_def = type_def.clone();
16101 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
16102 }),
16103 );
16104 TypeDef {
16105 proc: self.proc.clone(),
16106 selection: query,
16107 graphql_client: self.graphql_client.clone(),
16108 }
16109 }
16110 pub fn with_field_opts<'a>(
16118 &self,
16119 name: impl Into<String>,
16120 type_def: impl IntoID<Id>,
16121 opts: TypeDefWithFieldOpts<'a>,
16122 ) -> TypeDef {
16123 let mut query = self.selection.select("withField");
16124 query = query.arg("name", name.into());
16125 query = query.arg_lazy(
16126 "typeDef",
16127 Box::new(move || {
16128 let type_def = type_def.clone();
16129 Box::pin(async move { type_def.into_id().await.unwrap().quote() })
16130 }),
16131 );
16132 if let Some(description) = opts.description {
16133 query = query.arg("description", description);
16134 }
16135 if let Some(source_map) = opts.source_map {
16136 query = query.arg("sourceMap", source_map);
16137 }
16138 if let Some(deprecated) = opts.deprecated {
16139 query = query.arg("deprecated", deprecated);
16140 }
16141 TypeDef {
16142 proc: self.proc.clone(),
16143 selection: query,
16144 graphql_client: self.graphql_client.clone(),
16145 }
16146 }
16147 pub fn with_function(&self, function: impl IntoID<Id>) -> TypeDef {
16149 let mut query = self.selection.select("withFunction");
16150 query = query.arg_lazy(
16151 "function",
16152 Box::new(move || {
16153 let function = function.clone();
16154 Box::pin(async move { function.into_id().await.unwrap().quote() })
16155 }),
16156 );
16157 TypeDef {
16158 proc: self.proc.clone(),
16159 selection: query,
16160 graphql_client: self.graphql_client.clone(),
16161 }
16162 }
16163 pub fn with_interface(&self, name: impl Into<String>) -> TypeDef {
16169 let mut query = self.selection.select("withInterface");
16170 query = query.arg("name", name.into());
16171 TypeDef {
16172 proc: self.proc.clone(),
16173 selection: query,
16174 graphql_client: self.graphql_client.clone(),
16175 }
16176 }
16177 pub fn with_interface_opts<'a>(
16183 &self,
16184 name: impl Into<String>,
16185 opts: TypeDefWithInterfaceOpts<'a>,
16186 ) -> TypeDef {
16187 let mut query = self.selection.select("withInterface");
16188 query = query.arg("name", name.into());
16189 if let Some(description) = opts.description {
16190 query = query.arg("description", description);
16191 }
16192 if let Some(source_map) = opts.source_map {
16193 query = query.arg("sourceMap", source_map);
16194 }
16195 TypeDef {
16196 proc: self.proc.clone(),
16197 selection: query,
16198 graphql_client: self.graphql_client.clone(),
16199 }
16200 }
16201 pub fn with_kind(&self, kind: TypeDefKind) -> TypeDef {
16203 let mut query = self.selection.select("withKind");
16204 query = query.arg("kind", kind);
16205 TypeDef {
16206 proc: self.proc.clone(),
16207 selection: query,
16208 graphql_client: self.graphql_client.clone(),
16209 }
16210 }
16211 pub fn with_list_of(&self, element_type: impl IntoID<Id>) -> TypeDef {
16213 let mut query = self.selection.select("withListOf");
16214 query = query.arg_lazy(
16215 "elementType",
16216 Box::new(move || {
16217 let element_type = element_type.clone();
16218 Box::pin(async move { element_type.into_id().await.unwrap().quote() })
16219 }),
16220 );
16221 TypeDef {
16222 proc: self.proc.clone(),
16223 selection: query,
16224 graphql_client: self.graphql_client.clone(),
16225 }
16226 }
16227 pub fn with_object(&self, name: impl Into<String>) -> TypeDef {
16234 let mut query = self.selection.select("withObject");
16235 query = query.arg("name", name.into());
16236 TypeDef {
16237 proc: self.proc.clone(),
16238 selection: query,
16239 graphql_client: self.graphql_client.clone(),
16240 }
16241 }
16242 pub fn with_object_opts<'a>(
16249 &self,
16250 name: impl Into<String>,
16251 opts: TypeDefWithObjectOpts<'a>,
16252 ) -> TypeDef {
16253 let mut query = self.selection.select("withObject");
16254 query = query.arg("name", name.into());
16255 if let Some(description) = opts.description {
16256 query = query.arg("description", description);
16257 }
16258 if let Some(source_map) = opts.source_map {
16259 query = query.arg("sourceMap", source_map);
16260 }
16261 if let Some(deprecated) = opts.deprecated {
16262 query = query.arg("deprecated", deprecated);
16263 }
16264 TypeDef {
16265 proc: self.proc.clone(),
16266 selection: query,
16267 graphql_client: self.graphql_client.clone(),
16268 }
16269 }
16270 pub fn with_optional(&self, optional: bool) -> TypeDef {
16272 let mut query = self.selection.select("withOptional");
16273 query = query.arg("optional", optional);
16274 TypeDef {
16275 proc: self.proc.clone(),
16276 selection: query,
16277 graphql_client: self.graphql_client.clone(),
16278 }
16279 }
16280 pub fn with_scalar(&self, name: impl Into<String>) -> TypeDef {
16286 let mut query = self.selection.select("withScalar");
16287 query = query.arg("name", name.into());
16288 TypeDef {
16289 proc: self.proc.clone(),
16290 selection: query,
16291 graphql_client: self.graphql_client.clone(),
16292 }
16293 }
16294 pub fn with_scalar_opts<'a>(
16300 &self,
16301 name: impl Into<String>,
16302 opts: TypeDefWithScalarOpts<'a>,
16303 ) -> TypeDef {
16304 let mut query = self.selection.select("withScalar");
16305 query = query.arg("name", name.into());
16306 if let Some(description) = opts.description {
16307 query = query.arg("description", description);
16308 }
16309 TypeDef {
16310 proc: self.proc.clone(),
16311 selection: query,
16312 graphql_client: self.graphql_client.clone(),
16313 }
16314 }
16315}
16316impl Node for TypeDef {
16317 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16318 let query = self.selection.select("id");
16319 let graphql_client = self.graphql_client.clone();
16320 async move { query.execute(graphql_client).await }
16321 }
16322}
16323#[derive(Clone)]
16324pub struct Up {
16325 pub proc: Option<Arc<DaggerSessionProc>>,
16326 pub selection: Selection,
16327 pub graphql_client: DynGraphQLClient,
16328}
16329impl IntoID<Id> for Up {
16330 fn into_id(
16331 self,
16332 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16333 Box::pin(async move { self.id().await })
16334 }
16335}
16336impl Loadable for Up {
16337 fn graphql_type() -> &'static str {
16338 "Up"
16339 }
16340 fn from_query(
16341 proc: Option<Arc<DaggerSessionProc>>,
16342 selection: Selection,
16343 graphql_client: DynGraphQLClient,
16344 ) -> Self {
16345 Self {
16346 proc,
16347 selection,
16348 graphql_client,
16349 }
16350 }
16351}
16352impl Up {
16353 pub async fn description(&self) -> Result<String, DaggerError> {
16355 let query = self.selection.select("description");
16356 query.execute(self.graphql_client.clone()).await
16357 }
16358 pub async fn id(&self) -> Result<Id, DaggerError> {
16360 let query = self.selection.select("id");
16361 query.execute(self.graphql_client.clone()).await
16362 }
16363 pub async fn name(&self) -> Result<String, DaggerError> {
16365 let query = self.selection.select("name");
16366 query.execute(self.graphql_client.clone()).await
16367 }
16368 pub fn original_module(&self) -> Module {
16370 let query = self.selection.select("originalModule");
16371 Module {
16372 proc: self.proc.clone(),
16373 selection: query,
16374 graphql_client: self.graphql_client.clone(),
16375 }
16376 }
16377 pub async fn path(&self) -> Result<Vec<String>, DaggerError> {
16379 let query = self.selection.select("path");
16380 query.execute(self.graphql_client.clone()).await
16381 }
16382 pub fn run(&self) -> Up {
16384 let query = self.selection.select("run");
16385 Up {
16386 proc: self.proc.clone(),
16387 selection: query,
16388 graphql_client: self.graphql_client.clone(),
16389 }
16390 }
16391}
16392impl Node for Up {
16393 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16394 let query = self.selection.select("id");
16395 let graphql_client = self.graphql_client.clone();
16396 async move { query.execute(graphql_client).await }
16397 }
16398}
16399#[derive(Clone)]
16400pub struct UpGroup {
16401 pub proc: Option<Arc<DaggerSessionProc>>,
16402 pub selection: Selection,
16403 pub graphql_client: DynGraphQLClient,
16404}
16405impl IntoID<Id> for UpGroup {
16406 fn into_id(
16407 self,
16408 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16409 Box::pin(async move { self.id().await })
16410 }
16411}
16412impl Loadable for UpGroup {
16413 fn graphql_type() -> &'static str {
16414 "UpGroup"
16415 }
16416 fn from_query(
16417 proc: Option<Arc<DaggerSessionProc>>,
16418 selection: Selection,
16419 graphql_client: DynGraphQLClient,
16420 ) -> Self {
16421 Self {
16422 proc,
16423 selection,
16424 graphql_client,
16425 }
16426 }
16427}
16428impl UpGroup {
16429 pub async fn id(&self) -> Result<Id, DaggerError> {
16431 let query = self.selection.select("id");
16432 query.execute(self.graphql_client.clone()).await
16433 }
16434 pub async fn list(&self) -> Result<Vec<Up>, DaggerError> {
16436 let query = self.selection.select("list");
16437 let query = query.select("id");
16438 let ids: Vec<Id> = query.execute(self.graphql_client.clone()).await?;
16439 Ok(ids
16440 .into_iter()
16441 .map(|id| Up {
16442 proc: self.proc.clone(),
16443 selection: crate::querybuilder::query()
16444 .select("node")
16445 .arg("id", &id.0)
16446 .inline_fragment("Up"),
16447 graphql_client: self.graphql_client.clone(),
16448 })
16449 .collect())
16450 }
16451 pub fn run(&self) -> UpGroup {
16453 let query = self.selection.select("run");
16454 UpGroup {
16455 proc: self.proc.clone(),
16456 selection: query,
16457 graphql_client: self.graphql_client.clone(),
16458 }
16459 }
16460}
16461impl Node for UpGroup {
16462 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16463 let query = self.selection.select("id");
16464 let graphql_client = self.graphql_client.clone();
16465 async move { query.execute(graphql_client).await }
16466 }
16467}
16468#[derive(Clone)]
16469pub struct Volume {
16470 pub proc: Option<Arc<DaggerSessionProc>>,
16471 pub selection: Selection,
16472 pub graphql_client: DynGraphQLClient,
16473}
16474impl IntoID<Id> for Volume {
16475 fn into_id(
16476 self,
16477 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16478 Box::pin(async move { self.id().await })
16479 }
16480}
16481impl Loadable for Volume {
16482 fn graphql_type() -> &'static str {
16483 "Volume"
16484 }
16485 fn from_query(
16486 proc: Option<Arc<DaggerSessionProc>>,
16487 selection: Selection,
16488 graphql_client: DynGraphQLClient,
16489 ) -> Self {
16490 Self {
16491 proc,
16492 selection,
16493 graphql_client,
16494 }
16495 }
16496}
16497impl Volume {
16498 pub async fn id(&self) -> Result<Id, DaggerError> {
16500 let query = self.selection.select("id");
16501 query.execute(self.graphql_client.clone()).await
16502 }
16503}
16504impl Node for Volume {
16505 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16506 let query = self.selection.select("id");
16507 let graphql_client = self.graphql_client.clone();
16508 async move { query.execute(graphql_client).await }
16509 }
16510}
16511#[derive(Clone)]
16512pub struct Workspace {
16513 pub proc: Option<Arc<DaggerSessionProc>>,
16514 pub selection: Selection,
16515 pub graphql_client: DynGraphQLClient,
16516}
16517#[derive(Builder, Debug, PartialEq)]
16518pub struct WorkspaceChecksOpts<'a> {
16519 #[builder(setter(into, strip_option), default)]
16521 pub include: Option<Vec<&'a str>>,
16522 #[builder(setter(into, strip_option), default)]
16524 pub no_generate: Option<bool>,
16525 #[builder(setter(into, strip_option), default)]
16527 pub only_generate: Option<bool>,
16528}
16529#[derive(Builder, Debug, PartialEq)]
16530pub struct WorkspaceDirectoryOpts<'a> {
16531 #[builder(setter(into, strip_option), default)]
16533 pub exclude: Option<Vec<&'a str>>,
16534 #[builder(setter(into, strip_option), default)]
16536 pub gitignore: Option<bool>,
16537 #[builder(setter(into, strip_option), default)]
16539 pub include: Option<Vec<&'a str>>,
16540}
16541#[derive(Builder, Debug, PartialEq)]
16542pub struct WorkspaceFindUpOpts<'a> {
16543 #[builder(setter(into, strip_option), default)]
16545 pub from: Option<&'a str>,
16546}
16547#[derive(Builder, Debug, PartialEq)]
16548pub struct WorkspaceGeneratorsOpts<'a> {
16549 #[builder(setter(into, strip_option), default)]
16551 pub include: Option<Vec<&'a str>>,
16552}
16553#[derive(Builder, Debug, PartialEq)]
16554pub struct WorkspaceServicesOpts<'a> {
16555 #[builder(setter(into, strip_option), default)]
16557 pub include: Option<Vec<&'a str>>,
16558}
16559impl IntoID<Id> for Workspace {
16560 fn into_id(
16561 self,
16562 ) -> std::pin::Pin<Box<dyn core::future::Future<Output = Result<Id, DaggerError>> + Send>> {
16563 Box::pin(async move { self.id().await })
16564 }
16565}
16566impl Loadable for Workspace {
16567 fn graphql_type() -> &'static str {
16568 "Workspace"
16569 }
16570 fn from_query(
16571 proc: Option<Arc<DaggerSessionProc>>,
16572 selection: Selection,
16573 graphql_client: DynGraphQLClient,
16574 ) -> Self {
16575 Self {
16576 proc,
16577 selection,
16578 graphql_client,
16579 }
16580 }
16581}
16582impl Workspace {
16583 pub async fn address(&self) -> Result<String, DaggerError> {
16585 let query = self.selection.select("address");
16586 query.execute(self.graphql_client.clone()).await
16587 }
16588 pub fn checks(&self) -> CheckGroup {
16594 let query = self.selection.select("checks");
16595 CheckGroup {
16596 proc: self.proc.clone(),
16597 selection: query,
16598 graphql_client: self.graphql_client.clone(),
16599 }
16600 }
16601 pub fn checks_opts<'a>(&self, opts: WorkspaceChecksOpts<'a>) -> CheckGroup {
16607 let mut query = self.selection.select("checks");
16608 if let Some(include) = opts.include {
16609 query = query.arg("include", include);
16610 }
16611 if let Some(no_generate) = opts.no_generate {
16612 query = query.arg("noGenerate", no_generate);
16613 }
16614 if let Some(only_generate) = opts.only_generate {
16615 query = query.arg("onlyGenerate", only_generate);
16616 }
16617 CheckGroup {
16618 proc: self.proc.clone(),
16619 selection: query,
16620 graphql_client: self.graphql_client.clone(),
16621 }
16622 }
16623 pub async fn client_id(&self) -> Result<String, DaggerError> {
16625 let query = self.selection.select("clientId");
16626 query.execute(self.graphql_client.clone()).await
16627 }
16628 pub async fn config_path(&self) -> Result<String, DaggerError> {
16630 let query = self.selection.select("configPath");
16631 query.execute(self.graphql_client.clone()).await
16632 }
16633 pub fn directory(&self, path: impl Into<String>) -> Directory {
16641 let mut query = self.selection.select("directory");
16642 query = query.arg("path", path.into());
16643 Directory {
16644 proc: self.proc.clone(),
16645 selection: query,
16646 graphql_client: self.graphql_client.clone(),
16647 }
16648 }
16649 pub fn directory_opts<'a>(
16657 &self,
16658 path: impl Into<String>,
16659 opts: WorkspaceDirectoryOpts<'a>,
16660 ) -> Directory {
16661 let mut query = self.selection.select("directory");
16662 query = query.arg("path", path.into());
16663 if let Some(exclude) = opts.exclude {
16664 query = query.arg("exclude", exclude);
16665 }
16666 if let Some(include) = opts.include {
16667 query = query.arg("include", include);
16668 }
16669 if let Some(gitignore) = opts.gitignore {
16670 query = query.arg("gitignore", gitignore);
16671 }
16672 Directory {
16673 proc: self.proc.clone(),
16674 selection: query,
16675 graphql_client: self.graphql_client.clone(),
16676 }
16677 }
16678 pub fn file(&self, path: impl Into<String>) -> File {
16685 let mut query = self.selection.select("file");
16686 query = query.arg("path", path.into());
16687 File {
16688 proc: self.proc.clone(),
16689 selection: query,
16690 graphql_client: self.graphql_client.clone(),
16691 }
16692 }
16693 pub async fn find_up(&self, name: impl Into<String>) -> Result<String, DaggerError> {
16703 let mut query = self.selection.select("findUp");
16704 query = query.arg("name", name.into());
16705 query.execute(self.graphql_client.clone()).await
16706 }
16707 pub async fn find_up_opts<'a>(
16717 &self,
16718 name: impl Into<String>,
16719 opts: WorkspaceFindUpOpts<'a>,
16720 ) -> Result<String, DaggerError> {
16721 let mut query = self.selection.select("findUp");
16722 query = query.arg("name", name.into());
16723 if let Some(from) = opts.from {
16724 query = query.arg("from", from);
16725 }
16726 query.execute(self.graphql_client.clone()).await
16727 }
16728 pub fn generators(&self) -> GeneratorGroup {
16734 let query = self.selection.select("generators");
16735 GeneratorGroup {
16736 proc: self.proc.clone(),
16737 selection: query,
16738 graphql_client: self.graphql_client.clone(),
16739 }
16740 }
16741 pub fn generators_opts<'a>(&self, opts: WorkspaceGeneratorsOpts<'a>) -> GeneratorGroup {
16747 let mut query = self.selection.select("generators");
16748 if let Some(include) = opts.include {
16749 query = query.arg("include", include);
16750 }
16751 GeneratorGroup {
16752 proc: self.proc.clone(),
16753 selection: query,
16754 graphql_client: self.graphql_client.clone(),
16755 }
16756 }
16757 pub async fn has_config(&self) -> Result<bool, DaggerError> {
16759 let query = self.selection.select("hasConfig");
16760 query.execute(self.graphql_client.clone()).await
16761 }
16762 pub async fn id(&self) -> Result<Id, DaggerError> {
16764 let query = self.selection.select("id");
16765 query.execute(self.graphql_client.clone()).await
16766 }
16767 pub async fn initialized(&self) -> Result<bool, DaggerError> {
16769 let query = self.selection.select("initialized");
16770 query.execute(self.graphql_client.clone()).await
16771 }
16772 pub async fn path(&self) -> Result<String, DaggerError> {
16774 let query = self.selection.select("path");
16775 query.execute(self.graphql_client.clone()).await
16776 }
16777 pub fn services(&self) -> UpGroup {
16783 let query = self.selection.select("services");
16784 UpGroup {
16785 proc: self.proc.clone(),
16786 selection: query,
16787 graphql_client: self.graphql_client.clone(),
16788 }
16789 }
16790 pub fn services_opts<'a>(&self, opts: WorkspaceServicesOpts<'a>) -> UpGroup {
16796 let mut query = self.selection.select("services");
16797 if let Some(include) = opts.include {
16798 query = query.arg("include", include);
16799 }
16800 UpGroup {
16801 proc: self.proc.clone(),
16802 selection: query,
16803 graphql_client: self.graphql_client.clone(),
16804 }
16805 }
16806 pub fn update(&self) -> Changeset {
16809 let query = self.selection.select("update");
16810 Changeset {
16811 proc: self.proc.clone(),
16812 selection: query,
16813 graphql_client: self.graphql_client.clone(),
16814 }
16815 }
16816}
16817impl Node for Workspace {
16818 fn id(&self) -> impl core::future::Future<Output = Result<Id, DaggerError>> + Send {
16819 let query = self.selection.select("id");
16820 let graphql_client = self.graphql_client.clone();
16821 async move { query.execute(graphql_client).await }
16822 }
16823}
16824#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16825pub enum CacheSharingMode {
16826 #[serde(rename = "LOCKED")]
16827 Locked,
16828 #[serde(rename = "PRIVATE")]
16829 Private,
16830 #[serde(rename = "SHARED")]
16831 Shared,
16832}
16833#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16834pub enum ChangesetMergeConflict {
16835 #[serde(rename = "FAIL")]
16836 Fail,
16837 #[serde(rename = "FAIL_EARLY")]
16838 FailEarly,
16839 #[serde(rename = "LEAVE_CONFLICT_MARKERS")]
16840 LeaveConflictMarkers,
16841 #[serde(rename = "PREFER_OURS")]
16842 PreferOurs,
16843 #[serde(rename = "PREFER_THEIRS")]
16844 PreferTheirs,
16845}
16846#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16847pub enum ChangesetsMergeConflict {
16848 #[serde(rename = "FAIL")]
16849 Fail,
16850 #[serde(rename = "FAIL_EARLY")]
16851 FailEarly,
16852}
16853#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16854pub enum DiffStatKind {
16855 #[serde(rename = "ADDED")]
16856 Added,
16857 #[serde(rename = "MODIFIED")]
16858 Modified,
16859 #[serde(rename = "REMOVED")]
16860 Removed,
16861 #[serde(rename = "RENAMED")]
16862 Renamed,
16863}
16864#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16865pub enum ExistsType {
16866 #[serde(rename = "DIRECTORY_TYPE")]
16867 DirectoryType,
16868 #[serde(rename = "REGULAR_TYPE")]
16869 RegularType,
16870 #[serde(rename = "SYMLINK_TYPE")]
16871 SymlinkType,
16872}
16873#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16874pub enum FileType {
16875 #[serde(rename = "DIRECTORY")]
16876 Directory,
16877 #[serde(rename = "DIRECTORY_TYPE")]
16878 DirectoryType,
16879 #[serde(rename = "REGULAR")]
16880 Regular,
16881 #[serde(rename = "REGULAR_TYPE")]
16882 RegularType,
16883 #[serde(rename = "SYMLINK")]
16884 Symlink,
16885 #[serde(rename = "SYMLINK_TYPE")]
16886 SymlinkType,
16887 #[serde(rename = "UNKNOWN")]
16888 Unknown,
16889}
16890#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16891pub enum FunctionCachePolicy {
16892 #[serde(rename = "Default")]
16893 Default,
16894 #[serde(rename = "Never")]
16895 Never,
16896 #[serde(rename = "PerSession")]
16897 PerSession,
16898}
16899#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16900pub enum ImageLayerCompression {
16901 #[serde(rename = "EStarGZ")]
16902 EStarGz,
16903 #[serde(rename = "ESTARGZ")]
16904 Estargz,
16905 #[serde(rename = "Gzip")]
16906 Gzip,
16907 #[serde(rename = "Uncompressed")]
16908 Uncompressed,
16909 #[serde(rename = "Zstd")]
16910 Zstd,
16911}
16912#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16913pub enum ImageMediaTypes {
16914 #[serde(rename = "DOCKER")]
16915 Docker,
16916 #[serde(rename = "DockerMediaTypes")]
16917 DockerMediaTypes,
16918 #[serde(rename = "OCI")]
16919 Oci,
16920 #[serde(rename = "OCIMediaTypes")]
16921 OciMediaTypes,
16922}
16923#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16924pub enum ModuleSourceExperimentalFeature {
16925 #[serde(rename = "SELF_CALLS")]
16926 SelfCalls,
16927}
16928#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16929pub enum ModuleSourceKind {
16930 #[serde(rename = "DIR")]
16931 Dir,
16932 #[serde(rename = "DIR_SOURCE")]
16933 DirSource,
16934 #[serde(rename = "GIT")]
16935 Git,
16936 #[serde(rename = "GIT_SOURCE")]
16937 GitSource,
16938 #[serde(rename = "LOCAL")]
16939 Local,
16940 #[serde(rename = "LOCAL_SOURCE")]
16941 LocalSource,
16942}
16943#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16944pub enum NetworkProtocol {
16945 #[serde(rename = "TCP")]
16946 Tcp,
16947 #[serde(rename = "UDP")]
16948 Udp,
16949}
16950#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16951pub enum ReturnType {
16952 #[serde(rename = "ANY")]
16953 Any,
16954 #[serde(rename = "FAILURE")]
16955 Failure,
16956 #[serde(rename = "SUCCESS")]
16957 Success,
16958}
16959#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16960pub enum TypeDefKind {
16961 #[serde(rename = "BOOLEAN")]
16962 Boolean,
16963 #[serde(rename = "BOOLEAN_KIND")]
16964 BooleanKind,
16965 #[serde(rename = "ENUM")]
16966 Enum,
16967 #[serde(rename = "ENUM_KIND")]
16968 EnumKind,
16969 #[serde(rename = "FLOAT")]
16970 Float,
16971 #[serde(rename = "FLOAT_KIND")]
16972 FloatKind,
16973 #[serde(rename = "INPUT")]
16974 Input,
16975 #[serde(rename = "INPUT_KIND")]
16976 InputKind,
16977 #[serde(rename = "INTEGER")]
16978 Integer,
16979 #[serde(rename = "INTEGER_KIND")]
16980 IntegerKind,
16981 #[serde(rename = "INTERFACE")]
16982 Interface,
16983 #[serde(rename = "INTERFACE_KIND")]
16984 InterfaceKind,
16985 #[serde(rename = "LIST")]
16986 List,
16987 #[serde(rename = "LIST_KIND")]
16988 ListKind,
16989 #[serde(rename = "OBJECT")]
16990 Object,
16991 #[serde(rename = "OBJECT_KIND")]
16992 ObjectKind,
16993 #[serde(rename = "SCALAR")]
16994 Scalar,
16995 #[serde(rename = "SCALAR_KIND")]
16996 ScalarKind,
16997 #[serde(rename = "STRING")]
16998 String,
16999 #[serde(rename = "STRING_KIND")]
17000 StringKind,
17001 #[serde(rename = "VOID")]
17002 Void,
17003 #[serde(rename = "VOID_KIND")]
17004 VoidKind,
17005}