wasmer_backend_api/
types.rs

1pub use queries::*;
2
3pub use cynic::Id;
4
5#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)]
6pub struct Paginated<T> {
7    pub items: Vec<T>,
8    pub next_cursor: Option<String>,
9}
10
11#[cynic::schema_for_derives(file = r#"schema.graphql"#, module = "schema")]
12mod queries {
13    use serde::Serialize;
14    use time::OffsetDateTime;
15
16    use super::schema;
17
18    #[derive(cynic::Scalar, Debug, Clone, PartialEq, Eq)]
19    pub struct DateTime(pub String);
20
21    impl TryFrom<OffsetDateTime> for DateTime {
22        type Error = time::error::Format;
23
24        fn try_from(value: OffsetDateTime) -> Result<Self, Self::Error> {
25            value
26                .format(&time::format_description::well_known::Rfc3339)
27                .map(Self)
28        }
29    }
30
31    impl TryFrom<DateTime> for OffsetDateTime {
32        type Error = time::error::Parse;
33
34        fn try_from(value: DateTime) -> Result<Self, Self::Error> {
35            OffsetDateTime::parse(&value.0, &time::format_description::well_known::Rfc3339)
36        }
37    }
38
39    #[derive(cynic::Scalar, Debug, Clone)]
40    pub struct JSONString(pub String);
41
42    #[derive(cynic::Enum, Clone, Copy, Debug)]
43    pub enum GrapheneRole {
44        Owner,
45        Admin,
46        Editor,
47        Viewer,
48    }
49
50    #[derive(cynic::QueryVariables, Debug)]
51    pub struct ViewerCanVariables<'a> {
52        pub action: OwnerAction,
53        pub owner_name: &'a str,
54    }
55
56    #[derive(cynic::QueryFragment, Debug)]
57    #[cynic(graphql_type = "Query", variables = "ViewerCanVariables")]
58    pub struct ViewerCan {
59        #[arguments(action: $action, ownerName: $owner_name)]
60        pub viewer_can: bool,
61    }
62
63    #[derive(cynic::Enum, Clone, Copy, Debug)]
64    pub enum OwnerAction {
65        DeployApp,
66        PublishPackage,
67    }
68
69    #[derive(cynic::QueryVariables, Debug)]
70    pub struct RevokeTokenVariables {
71        pub token: String,
72    }
73
74    #[derive(cynic::QueryFragment, Debug)]
75    #[cynic(graphql_type = "Mutation", variables = "RevokeTokenVariables")]
76    pub struct RevokeToken {
77        #[arguments(input: { token: $token })]
78        pub revoke_api_token: Option<RevokeAPITokenPayload>,
79    }
80
81    #[derive(cynic::QueryFragment, Debug)]
82    pub struct RevokeAPITokenPayload {
83        pub success: Option<bool>,
84    }
85
86    #[derive(cynic::QueryVariables, Debug)]
87    pub struct CreateNewNonceVariables {
88        pub callback_url: String,
89        pub name: String,
90    }
91
92    #[derive(cynic::QueryFragment, Debug)]
93    #[cynic(graphql_type = "Mutation", variables = "CreateNewNonceVariables")]
94    pub struct CreateNewNonce {
95        #[arguments(input: { callbackUrl: $callback_url, name: $name })]
96        pub new_nonce: Option<NewNoncePayload>,
97    }
98
99    #[derive(cynic::QueryFragment, Debug)]
100    pub struct NewNoncePayload {
101        pub client_mutation_id: Option<String>,
102        pub nonce: Nonce,
103    }
104
105    #[derive(cynic::QueryFragment, Debug)]
106    pub struct Nonce {
107        pub auth_url: String,
108        pub callback_url: String,
109        pub created_at: DateTime,
110        pub expired: bool,
111        pub id: cynic::Id,
112        pub is_validated: bool,
113        pub name: String,
114        pub secret: String,
115    }
116
117    #[derive(cynic::QueryFragment, Debug)]
118    #[cynic(graphql_type = "Query")]
119    pub struct GetCurrentUser {
120        pub viewer: Option<User>,
121    }
122
123    #[derive(cynic::QueryVariables, Debug)]
124    pub struct GetCurrentUserWithNamespacesVars {
125        pub namespace_role: Option<GrapheneRole>,
126    }
127
128    #[derive(cynic::QueryFragment, Debug)]
129    #[cynic(graphql_type = "Query", variables = "GetCurrentUserWithNamespacesVars")]
130    pub struct GetCurrentUserWithNamespaces {
131        pub viewer: Option<UserWithNamespaces>,
132    }
133
134    #[derive(cynic::QueryFragment, Debug, serde::Serialize)]
135    pub struct User {
136        pub id: cynic::Id,
137        pub username: String,
138    }
139
140    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
141    pub struct Package {
142        pub id: cynic::Id,
143        pub package_name: String,
144        pub namespace: Option<String>,
145        pub last_version: Option<PackageVersion>,
146        pub private: bool,
147    }
148
149    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
150    pub struct PackageDistribution {
151        pub pirita_sha256_hash: Option<String>,
152        pub pirita_download_url: Option<String>,
153        pub download_url: Option<String>,
154        pub size: Option<i32>,
155        pub pirita_size: Option<i32>,
156        pub webc_version: Option<WebcVersion>,
157        pub webc_manifest: Option<JSONString>,
158    }
159
160    #[derive(cynic::Enum, Clone, Copy, Debug)]
161    pub enum WebcVersion {
162        V2,
163        V3,
164    }
165
166    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
167    pub struct WebcImage {
168        pub created_at: DateTime,
169        pub updated_at: DateTime,
170        pub webc_url: String,
171        pub webc_sha256: String,
172        pub file_size: BigInt,
173        pub manifest: JSONString,
174        pub version: Option<WebcVersion>,
175    }
176
177    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
178    pub struct PackageWebc {
179        pub id: cynic::Id,
180        pub created_at: DateTime,
181        pub updated_at: DateTime,
182        pub tag: String,
183        pub is_archived: bool,
184        pub webc_url: String,
185        pub webc: Option<WebcImage>,
186        pub webc_v3: Option<WebcImage>,
187    }
188
189    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
190    pub struct PackageVersion {
191        pub id: cynic::Id,
192        pub version: String,
193        pub created_at: DateTime,
194        pub distribution: PackageDistribution,
195    }
196
197    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
198    #[cynic(graphql_type = "PackageVersion")]
199    pub struct PackageVersionWithPackage {
200        pub id: cynic::Id,
201        pub version: String,
202        pub created_at: DateTime,
203        pub pirita_manifest: Option<JSONString>,
204        pub package: Package,
205
206        #[arguments(version: "V3")]
207        #[cynic(rename = "distribution")]
208        pub distribution_v3: PackageDistribution,
209
210        #[arguments(version: "V2")]
211        #[cynic(rename = "distribution")]
212        pub distribution_v2: PackageDistribution,
213    }
214
215    #[derive(cynic::QueryVariables, Debug)]
216    pub struct GetAppTemplateFromSlugVariables {
217        pub slug: String,
218    }
219
220    #[derive(cynic::QueryFragment, Debug)]
221    #[cynic(graphql_type = "Query", variables = "GetAppTemplateFromSlugVariables")]
222    pub struct GetAppTemplateFromSlug {
223        #[arguments(slug: $slug)]
224        pub get_app_template: Option<AppTemplate>,
225    }
226
227    #[derive(cynic::Enum, Clone, Copy, Debug)]
228    pub enum AppTemplatesSortBy {
229        Newest,
230        Oldest,
231        Popular,
232    }
233
234    #[derive(cynic::QueryVariables, Debug, Clone)]
235    pub struct GetAppTemplatesFromFrameworkVars {
236        pub framework_slug: String,
237        pub first: i32,
238        pub after: Option<String>,
239        pub sort_by: Option<AppTemplatesSortBy>,
240    }
241
242    #[derive(cynic::QueryFragment, Debug)]
243    #[cynic(graphql_type = "Query", variables = "GetAppTemplatesFromFrameworkVars")]
244    pub struct GetAppTemplatesFromFramework {
245        #[arguments(
246            frameworkSlug: $framework_slug,
247            first: $first,
248            after: $after,
249            sortBy: $sort_by
250        )]
251        pub get_app_templates: Option<AppTemplateConnection>,
252    }
253
254    #[derive(cynic::QueryVariables, Debug, Clone)]
255    pub struct GetAppTemplatesFromLanguageVars {
256        pub language_slug: String,
257        pub first: i32,
258        pub after: Option<String>,
259        pub sort_by: Option<AppTemplatesSortBy>,
260    }
261
262    #[derive(cynic::QueryFragment, Debug)]
263    #[cynic(graphql_type = "Query", variables = "GetAppTemplatesFromLanguageVars")]
264    pub struct GetAppTemplatesFromLanguage {
265        #[arguments(
266            languageSlug: $language_slug,
267            first: $first,
268            after: $after,
269            sortBy: $sort_by
270        )]
271        pub get_app_templates: Option<AppTemplateConnection>,
272    }
273
274    #[derive(cynic::QueryVariables, Debug, Clone)]
275    pub struct GetAppTemplatesVars {
276        pub category_slug: String,
277        pub first: i32,
278        pub after: Option<String>,
279        pub sort_by: Option<AppTemplatesSortBy>,
280    }
281
282    #[derive(cynic::QueryFragment, Debug)]
283    #[cynic(graphql_type = "Query", variables = "GetAppTemplatesVars")]
284    pub struct GetAppTemplates {
285        #[arguments(
286            categorySlug: $category_slug,
287            first: $first,
288            after: $after,
289            sortBy: $sort_by
290        )]
291        pub get_app_templates: Option<AppTemplateConnection>,
292    }
293
294    #[derive(cynic::QueryFragment, Debug)]
295    pub struct AppTemplateConnection {
296        pub edges: Vec<Option<AppTemplateEdge>>,
297        pub page_info: PageInfo,
298    }
299
300    #[derive(cynic::QueryFragment, Debug)]
301    pub struct AppTemplateEdge {
302        pub node: Option<AppTemplate>,
303        pub cursor: String,
304    }
305
306    #[derive(serde::Serialize, cynic::QueryFragment, PartialEq, Eq, Debug)]
307    pub struct AppTemplate {
308        #[serde(rename = "demoUrl")]
309        pub demo_url: String,
310        pub language: String,
311        pub name: String,
312        pub framework: String,
313        #[serde(rename = "createdAt")]
314        pub created_at: DateTime,
315        pub description: String,
316        pub id: cynic::Id,
317        #[serde(rename = "isPublic")]
318        pub is_public: bool,
319        #[serde(rename = "repoLicense")]
320        pub repo_license: String,
321        pub readme: String,
322        #[serde(rename = "repoUrl")]
323        pub repo_url: String,
324        pub slug: String,
325        #[serde(rename = "updatedAt")]
326        pub updated_at: DateTime,
327        #[serde(rename = "useCases")]
328        pub use_cases: Jsonstring,
329    }
330
331    #[derive(cynic::QueryVariables, Debug, Clone)]
332    pub struct GetTemplateFrameworksVars {
333        pub after: Option<String>,
334        pub first: Option<i32>,
335    }
336
337    #[derive(cynic::QueryFragment, Debug)]
338    #[cynic(graphql_type = "Query", variables = "GetTemplateFrameworksVars")]
339    pub struct GetTemplateFrameworks {
340        #[arguments(after: $after, first: $first)]
341        pub get_template_frameworks: Option<TemplateFrameworkConnection>,
342    }
343
344    #[derive(cynic::QueryFragment, Debug)]
345    pub struct TemplateFrameworkConnection {
346        pub edges: Vec<Option<TemplateFrameworkEdge>>,
347        pub page_info: PageInfo,
348        pub total_count: Option<i32>,
349    }
350
351    #[derive(cynic::QueryFragment, Debug)]
352    pub struct TemplateFrameworkEdge {
353        pub cursor: String,
354        pub node: Option<TemplateFramework>,
355    }
356
357    #[derive(serde::Serialize, cynic::QueryFragment, PartialEq, Eq, Debug)]
358    pub struct TemplateFramework {
359        #[serde(rename = "createdAt")]
360        pub created_at: DateTime,
361        pub id: cynic::Id,
362        pub name: String,
363        pub slug: String,
364        #[serde(rename = "updatedAt")]
365        pub updated_at: DateTime,
366    }
367
368    #[derive(cynic::QueryVariables, Debug, Clone)]
369    pub struct GetTemplateLanguagesVars {
370        pub after: Option<String>,
371        pub first: Option<i32>,
372    }
373
374    #[derive(cynic::QueryFragment, Debug)]
375    #[cynic(graphql_type = "Query", variables = "GetTemplateLanguagesVars")]
376    pub struct GetTemplateLanguages {
377        #[arguments(after: $after, first: $first)]
378        pub get_template_languages: Option<TemplateLanguageConnection>,
379    }
380
381    #[derive(cynic::QueryFragment, Debug)]
382    pub struct TemplateLanguageConnection {
383        pub edges: Vec<Option<TemplateLanguageEdge>>,
384        pub page_info: PageInfo,
385        pub total_count: Option<i32>,
386    }
387
388    #[derive(cynic::QueryFragment, Debug)]
389    pub struct TemplateLanguageEdge {
390        pub cursor: String,
391        pub node: Option<TemplateLanguage>,
392    }
393
394    #[derive(serde::Serialize, cynic::QueryFragment, PartialEq, Eq, Debug)]
395    pub struct TemplateLanguage {
396        #[serde(rename = "createdAt")]
397        pub created_at: DateTime,
398        pub id: cynic::Id,
399        pub name: String,
400        pub slug: String,
401        #[serde(rename = "updatedAt")]
402        pub updated_at: DateTime,
403    }
404
405    #[derive(cynic::Scalar, Debug, Clone, PartialEq, Eq)]
406    #[cynic(graphql_type = "JSONString")]
407    pub struct Jsonstring(pub String);
408
409    #[derive(cynic::QueryVariables, Debug)]
410    pub struct GetPackageReleaseVars {
411        pub hash: String,
412    }
413
414    #[derive(cynic::QueryFragment, Debug)]
415    #[cynic(graphql_type = "Query", variables = "GetPackageReleaseVars")]
416    pub struct GetPackageRelease {
417        #[arguments(hash: $hash)]
418        pub get_package_release: Option<PackageWebc>,
419    }
420
421    #[derive(cynic::QueryVariables, Debug)]
422    pub struct GetPackageVars {
423        pub name: String,
424    }
425
426    #[derive(cynic::QueryFragment, Debug)]
427    #[cynic(graphql_type = "Query", variables = "GetPackageVars")]
428    pub struct GetPackage {
429        #[arguments(name: $name)]
430        pub get_package: Option<Package>,
431    }
432
433    #[derive(cynic::QueryVariables, Debug)]
434    pub struct GetPackageVersionVars {
435        pub name: String,
436        pub version: String,
437    }
438
439    #[derive(cynic::QueryFragment, Debug)]
440    #[cynic(graphql_type = "Query", variables = "GetPackageVersionVars")]
441    pub struct GetPackageVersion {
442        #[arguments(name: $name, version: $version)]
443        pub get_package_version: Option<PackageVersionWithPackage>,
444    }
445
446    #[derive(cynic::Enum, Clone, Copy, Debug)]
447    pub enum PackageVersionSortBy {
448        Newest,
449        Oldest,
450    }
451
452    #[derive(cynic::QueryVariables, Debug)]
453    pub struct PushPackageReleaseVariables<'a> {
454        pub name: Option<&'a str>,
455        pub namespace: &'a str,
456        pub private: Option<bool>,
457        pub signed_url: &'a str,
458    }
459
460    #[derive(cynic::QueryFragment, Debug)]
461    #[cynic(graphql_type = "Mutation", variables = "PushPackageReleaseVariables")]
462    pub struct PushPackageRelease {
463        #[arguments(input: { name: $name, namespace: $namespace, private: $private, signedUrl: $signed_url })]
464        pub push_package_release: Option<PushPackageReleasePayload>,
465    }
466
467    #[derive(cynic::QueryFragment, Debug)]
468    pub struct PushPackageReleasePayload {
469        pub package_webc: Option<PackageWebc>,
470        pub success: bool,
471    }
472
473    #[derive(cynic::QueryVariables, Debug)]
474    pub struct TagPackageReleaseVariables<'a> {
475        pub description: Option<&'a str>,
476        pub homepage: Option<&'a str>,
477        pub license: Option<&'a str>,
478        pub license_file: Option<&'a str>,
479        pub manifest: Option<&'a str>,
480        pub name: &'a str,
481        pub namespace: Option<&'a str>,
482        pub package_release_id: &'a cynic::Id,
483        pub private: Option<bool>,
484        pub readme: Option<&'a str>,
485        pub repository: Option<&'a str>,
486        pub version: &'a str,
487    }
488
489    #[derive(cynic::QueryFragment, Debug)]
490    #[cynic(graphql_type = "Mutation", variables = "TagPackageReleaseVariables")]
491    pub struct TagPackageRelease {
492        #[arguments(input: { description: $description, homepage: $homepage, license: $license, licenseFile: $license_file, manifest: $manifest, name: $name, namespace: $namespace, packageReleaseId: $package_release_id, private: $private, readme: $readme, repository: $repository, version: $version })]
493        pub tag_package_release: Option<TagPackageReleasePayload>,
494    }
495
496    #[derive(cynic::QueryFragment, Debug)]
497    pub struct TagPackageReleasePayload {
498        pub success: bool,
499        pub package_version: Option<PackageVersion>,
500    }
501
502    #[derive(cynic::InputObject, Debug)]
503    pub struct InputSignature<'a> {
504        pub public_key_key_id: &'a str,
505        pub data: &'a str,
506    }
507
508    #[derive(cynic::QueryVariables, Debug, Clone, Default)]
509    pub struct AllPackageVersionsVars {
510        pub offset: Option<i32>,
511        pub before: Option<String>,
512        pub after: Option<String>,
513        pub first: Option<i32>,
514        pub last: Option<i32>,
515
516        pub created_after: Option<DateTime>,
517        pub updated_after: Option<DateTime>,
518        pub sort_by: Option<PackageVersionSortBy>,
519    }
520
521    #[derive(cynic::QueryFragment, Debug)]
522    #[cynic(graphql_type = "Query", variables = "AllPackageVersionsVars")]
523    pub struct GetAllPackageVersions {
524        #[arguments(
525            first: $first,
526            last: $last,
527            after: $after,
528            before: $before,
529            offset: $offset,
530            updatedAfter: $updated_after,
531            createdAfter: $created_after,
532            sortBy: $sort_by,
533        )]
534        pub all_package_versions: PackageVersionConnection,
535    }
536
537    #[derive(cynic::QueryVariables, Debug, Clone, Default)]
538    pub struct AllPackageReleasesVars {
539        pub offset: Option<i32>,
540        pub before: Option<String>,
541        pub after: Option<String>,
542        pub first: Option<i32>,
543        pub last: Option<i32>,
544
545        pub created_after: Option<DateTime>,
546        pub updated_after: Option<DateTime>,
547        pub sort_by: Option<PackageVersionSortBy>,
548    }
549
550    #[derive(cynic::QueryFragment, Debug)]
551    #[cynic(graphql_type = "Query", variables = "AllPackageReleasesVars")]
552    pub struct GetAllPackageReleases {
553        #[arguments(
554            first: $first,
555            last: $last,
556            after: $after,
557            before: $before,
558            offset: $offset,
559            updatedAfter: $updated_after,
560            createdAfter: $created_after,
561            sortBy: $sort_by,
562        )]
563        pub all_package_releases: PackageWebcConnection,
564    }
565
566    impl GetAllPackageReleases {
567        pub fn into_packages(self) -> Vec<PackageWebc> {
568            self.all_package_releases
569                .edges
570                .into_iter()
571                .flatten()
572                .filter_map(|x| x.node)
573                .collect()
574        }
575    }
576
577    #[derive(cynic::QueryVariables, Debug)]
578    pub struct GetSignedUrlForPackageUploadVariables<'a> {
579        pub expires_after_seconds: Option<i32>,
580        pub filename: Option<&'a str>,
581        pub name: Option<&'a str>,
582        pub version: Option<&'a str>,
583    }
584
585    #[derive(cynic::QueryFragment, Debug)]
586    #[cynic(
587        graphql_type = "Query",
588        variables = "GetSignedUrlForPackageUploadVariables"
589    )]
590    pub struct GetSignedUrlForPackageUpload {
591        #[arguments(name: $name, version: $version, filename: $filename, expiresAfterSeconds: $expires_after_seconds)]
592        pub get_signed_url_for_package_upload: Option<SignedUrl>,
593    }
594
595    #[derive(cynic::QueryFragment, Debug)]
596    pub struct SignedUrl {
597        pub url: String,
598    }
599
600    #[derive(cynic::QueryVariables, Debug)]
601    pub struct GenerateUploadUrlVariables<'a> {
602        pub expires_after_seconds: Option<i32>,
603        pub filename: &'a str,
604        pub name: Option<&'a str>,
605        pub version: Option<&'a str>,
606    }
607
608    #[derive(cynic::QueryFragment, Debug)]
609    #[cynic(graphql_type = "Mutation", variables = "GenerateUploadUrlVariables")]
610    pub struct GenerateUploadUrl {
611        #[arguments(input: { expiresAfterSeconds: $expires_after_seconds, filename: $filename, name: $name, version: $version })]
612        pub generate_upload_url: Option<GenerateUploadUrlPayload>,
613    }
614
615    #[derive(cynic::QueryFragment, Debug)]
616    pub struct GenerateUploadUrlPayload {
617        #[cynic(rename = "signedUrl")]
618        pub signed_url: SignedUrl,
619    }
620
621    #[derive(cynic::QueryFragment, Debug)]
622    pub struct PackageWebcConnection {
623        pub page_info: PageInfo,
624        pub edges: Vec<Option<PackageWebcEdge>>,
625    }
626
627    #[derive(cynic::QueryFragment, Debug)]
628    pub struct PackageWebcEdge {
629        pub node: Option<PackageWebc>,
630    }
631
632    #[derive(cynic::QueryFragment, Debug)]
633    pub struct PackageVersionConnection {
634        pub page_info: PageInfo,
635        pub edges: Vec<Option<PackageVersionEdge>>,
636    }
637
638    #[derive(cynic::QueryFragment, Debug)]
639    pub struct PackageVersionEdge {
640        pub node: Option<PackageVersionWithPackage>,
641        pub cursor: String,
642    }
643
644    #[derive(cynic::QueryVariables, Debug)]
645    pub struct GetPackageAndAppVars {
646        pub package: String,
647        pub app_owner: String,
648        pub app_name: String,
649    }
650
651    #[derive(cynic::QueryFragment, Debug)]
652    #[cynic(graphql_type = "Query", variables = "GetPackageAndAppVars")]
653    pub struct GetPackageAndApp {
654        #[arguments(name: $package)]
655        pub get_package: Option<Package>,
656        #[arguments(owner: $app_owner, name: $app_name)]
657        pub get_deploy_app: Option<DeployApp>,
658    }
659
660    #[derive(cynic::QueryVariables, Debug)]
661    pub struct GetCurrentUserWithAppsVars {
662        pub first: Option<i32>,
663        pub after: Option<String>,
664        pub sort: Option<DeployAppsSortBy>,
665    }
666
667    #[derive(cynic::QueryFragment, Debug)]
668    #[cynic(graphql_type = "Query", variables = "GetCurrentUserWithAppsVars")]
669    pub struct GetCurrentUserWithApps {
670        pub viewer: Option<UserWithApps>,
671    }
672
673    #[derive(cynic::QueryFragment, Debug)]
674    #[cynic(graphql_type = "User")]
675    #[cynic(variables = "GetCurrentUserWithAppsVars")]
676    pub struct UserWithApps {
677        pub id: cynic::Id,
678        pub username: String,
679        #[arguments(after: $after, sortBy: $sort, first: $first)]
680        pub apps: DeployAppConnection,
681    }
682
683    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
684    pub struct Owner {
685        pub global_name: String,
686    }
687
688    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
689    #[cynic(graphql_type = "User", variables = "GetCurrentUserWithNamespacesVars")]
690    pub struct UserWithNamespaces {
691        pub id: cynic::Id,
692        pub username: String,
693        #[arguments(role: $namespace_role)]
694        pub namespaces: NamespaceConnection,
695    }
696
697    #[derive(cynic::QueryVariables, Debug)]
698    pub struct GetUserAppsVars {
699        pub username: String,
700    }
701
702    #[derive(cynic::QueryFragment, Debug)]
703    #[cynic(graphql_type = "Query", variables = "GetUserAppsVars")]
704    pub struct GetUserApps {
705        #[arguments(username: $username)]
706        pub get_user: Option<User>,
707    }
708
709    #[derive(cynic::QueryVariables, Debug)]
710    pub struct GetDeployAppVars {
711        pub name: String,
712        pub owner: String,
713    }
714
715    #[derive(cynic::QueryFragment, Debug)]
716    #[cynic(graphql_type = "Query", variables = "GetDeployAppVars")]
717    pub struct GetDeployApp {
718        #[arguments(owner: $owner, name: $name)]
719        pub get_deploy_app: Option<DeployApp>,
720    }
721
722    #[derive(cynic::QueryFragment, Debug)]
723    #[cynic(graphql_type = "Query", variables = "GetDeployAppVars")]
724    pub struct GetDeployAppS3Credentials {
725        #[arguments(owner: $owner, name: $name)]
726        pub get_deploy_app: Option<AppWithS3Credentials>,
727    }
728
729    #[derive(cynic::QueryFragment, Debug)]
730    #[cynic(graphql_type = "DeployApp", variables = "GetDeployAppVars")]
731    pub struct AppWithS3Credentials {
732        pub s3_credentials: Option<S3Credentials>,
733    }
734
735    #[derive(cynic::QueryFragment, Debug)]
736    pub struct S3Credentials {
737        pub access_key: String,
738        pub secret_key: String,
739        pub endpoint: String,
740    }
741
742    #[derive(cynic::QueryVariables, Debug)]
743    pub struct RotateS3SecretsForAppVariables {
744        pub id: cynic::Id,
745    }
746
747    #[derive(cynic::QueryFragment, Debug)]
748    #[cynic(
749        graphql_type = "Mutation",
750        variables = "RotateS3SecretsForAppVariables"
751    )]
752    pub struct RotateS3SecretsForApp {
753        #[arguments(input: { id: $id })]
754        pub rotate_s3_secrets_for_app: Option<RotateS3SecretsForAppPayload>,
755    }
756
757    #[derive(cynic::QueryFragment, Debug)]
758    pub struct RotateS3SecretsForAppPayload {
759        pub client_mutation_id: Option<String>,
760    }
761
762    #[derive(cynic::QueryVariables, Debug, Clone)]
763    pub struct PaginationVars {
764        pub offset: Option<i32>,
765        pub before: Option<String>,
766        pub after: Option<String>,
767        pub first: Option<i32>,
768        pub last: Option<i32>,
769    }
770
771    #[derive(cynic::Enum, Clone, Copy, Debug)]
772    pub enum DeployAppsSortBy {
773        Newest,
774        Oldest,
775        MostActive,
776    }
777
778    #[derive(cynic::QueryVariables, Debug, Clone, Default)]
779    pub struct GetDeployAppsVars {
780        pub offset: Option<i32>,
781        pub before: Option<String>,
782        pub after: Option<String>,
783        pub first: Option<i32>,
784        pub last: Option<i32>,
785
786        pub updated_after: Option<DateTime>,
787        pub sort_by: Option<DeployAppsSortBy>,
788    }
789
790    #[derive(cynic::QueryFragment, Debug)]
791    #[cynic(graphql_type = "Query", variables = "GetDeployAppsVars")]
792    pub struct GetDeployApps {
793        #[arguments(
794            first: $first,
795            last: $last,
796            after: $after,
797            before: $before,
798            offset: $offset,
799            updatedAfter: $updated_after,
800            sortBy: $sort_by,
801        )]
802        pub get_deploy_apps: Option<DeployAppConnection>,
803    }
804
805    #[derive(cynic::QueryVariables, Debug)]
806    pub struct GetDeployAppByAliasVars {
807        pub alias: String,
808    }
809
810    #[derive(cynic::QueryFragment, Debug)]
811    #[cynic(graphql_type = "Query", variables = "GetDeployAppByAliasVars")]
812    pub struct GetDeployAppByAlias {
813        #[arguments(alias: $alias)]
814        pub get_app_by_global_alias: Option<DeployApp>,
815    }
816
817    #[derive(cynic::QueryVariables, Debug)]
818    pub struct GetDeployAppAndVersionVars {
819        pub name: String,
820        pub owner: String,
821        pub version: String,
822    }
823
824    #[derive(cynic::QueryFragment, Debug)]
825    #[cynic(graphql_type = "Query", variables = "GetDeployAppAndVersionVars")]
826    pub struct GetDeployAppAndVersion {
827        #[arguments(owner: $owner, name: $name)]
828        pub get_deploy_app: Option<DeployApp>,
829        #[arguments(owner: $owner, name: $name, version: $version)]
830        pub get_deploy_app_version: Option<DeployAppVersion>,
831    }
832
833    #[derive(cynic::QueryVariables, Debug)]
834    pub struct GetDeployAppVersionVars {
835        pub name: String,
836        pub owner: String,
837        pub version: String,
838    }
839
840    #[derive(cynic::QueryFragment, Debug)]
841    #[cynic(graphql_type = "Query", variables = "GetDeployAppVersionVars")]
842    pub struct GetDeployAppVersion {
843        #[arguments(owner: $owner, name: $name, version: $version)]
844        pub get_deploy_app_version: Option<DeployAppVersion>,
845    }
846
847    #[derive(cynic::QueryVariables, Debug)]
848    pub(crate) struct GetAppVolumesVars {
849        pub name: String,
850        pub owner: String,
851    }
852
853    #[derive(cynic::QueryFragment, Debug)]
854    #[cynic(graphql_type = "Query", variables = "GetAppVolumesVars")]
855    pub(crate) struct GetAppVolumes {
856        #[arguments(owner: $owner, name: $name)]
857        pub get_deploy_app: Option<AppVolumes>,
858    }
859
860    #[derive(cynic::QueryFragment, Debug)]
861    #[cynic(graphql_type = "DeployApp")]
862    pub(crate) struct AppVolumes {
863        pub active_version: Option<AppVersionVolumes>,
864    }
865
866    #[derive(cynic::QueryFragment, Debug)]
867    #[cynic(graphql_type = "DeployAppVersion")]
868    pub(crate) struct AppVersionVolumes {
869        pub volumes: Option<Vec<Option<AppVersionVolume>>>,
870    }
871
872    #[derive(serde::Serialize, cynic::QueryFragment, Debug)]
873    pub struct AppVersionVolume {
874        pub name: String,
875        pub size: Option<BigInt>,
876        pub used_size: Option<BigInt>,
877    }
878
879    #[derive(cynic::QueryVariables, Debug)]
880    pub(crate) struct GetAppDatabasesVars {
881        pub name: String,
882        pub owner: String,
883        pub after: Option<String>,
884    }
885
886    #[derive(cynic::QueryFragment, Debug)]
887    #[cynic(graphql_type = "Query", variables = "GetAppDatabasesVars")]
888    pub(crate) struct GetAppDatabases {
889        #[arguments(owner: $owner, name: $name)]
890        pub get_deploy_app: Option<AppDatabases>,
891    }
892
893    #[derive(cynic::QueryFragment, Debug)]
894    pub(crate) struct AppDatabaseConnection {
895        pub page_info: PageInfo,
896        pub edges: Vec<Option<AppDatabaseEdge>>,
897    }
898
899    #[derive(cynic::QueryFragment, Debug)]
900    #[cynic(graphql_type = "DeployApp")]
901    pub(crate) struct AppDatabases {
902        pub databases: AppDatabaseConnection,
903    }
904
905    #[derive(cynic::QueryFragment, Debug)]
906    pub(crate) struct AppDatabaseEdge {
907        pub node: Option<AppDatabase>,
908    }
909
910    #[derive(serde::Serialize, cynic::QueryFragment, Debug)]
911    pub struct AppDatabase {
912        pub id: cynic::Id,
913        pub name: String,
914        pub created_at: DateTime,
915        pub updated_at: DateTime,
916        pub deleted_at: Option<DateTime>,
917        pub username: String,
918        pub db_explorer_url: Option<String>,
919        pub host: String,
920        pub port: String,
921        pub password: Option<String>,
922    }
923
924    #[derive(cynic::QueryFragment, Debug)]
925    pub struct RegisterDomainPayload {
926        pub success: bool,
927        pub domain: Option<DnsDomain>,
928    }
929
930    #[derive(cynic::QueryVariables, Debug)]
931    pub struct RegisterDomainVars {
932        pub name: String,
933        pub namespace: Option<String>,
934        pub import_records: Option<bool>,
935    }
936
937    #[derive(cynic::QueryFragment, Debug)]
938    #[cynic(graphql_type = "Mutation", variables = "RegisterDomainVars")]
939    pub struct RegisterDomain {
940        #[arguments(input: {name: $name, importRecords: $import_records, namespace: $namespace})]
941        pub register_domain: Option<RegisterDomainPayload>,
942    }
943
944    #[derive(cynic::QueryVariables, Debug)]
945    pub struct UpsertDomainFromZoneFileVars {
946        pub zone_file: String,
947        pub delete_missing_records: Option<bool>,
948    }
949
950    #[derive(cynic::QueryFragment, Debug)]
951    #[cynic(graphql_type = "Mutation", variables = "UpsertDomainFromZoneFileVars")]
952    pub struct UpsertDomainFromZoneFile {
953        #[arguments(input: {zoneFile: $zone_file, deleteMissingRecords: $delete_missing_records})]
954        pub upsert_domain_from_zone_file: Option<UpsertDomainFromZoneFilePayload>,
955    }
956
957    #[derive(cynic::QueryFragment, Debug)]
958    pub struct UpsertDomainFromZoneFilePayload {
959        pub success: bool,
960        pub domain: DnsDomain,
961    }
962
963    #[derive(cynic::QueryVariables, Debug)]
964    pub struct CreateNamespaceVars {
965        pub name: String,
966        pub description: Option<String>,
967    }
968
969    #[derive(cynic::QueryFragment, Debug)]
970    #[cynic(graphql_type = "Mutation", variables = "CreateNamespaceVars")]
971    pub struct CreateNamespace {
972        #[arguments(input: {name: $name, description: $description})]
973        pub create_namespace: Option<CreateNamespacePayload>,
974    }
975
976    #[derive(cynic::QueryFragment, Debug)]
977    pub struct CreateNamespacePayload {
978        pub namespace: Namespace,
979    }
980
981    #[derive(cynic::InputObject, Debug)]
982    pub struct CreateNamespaceInput {
983        pub name: String,
984        pub display_name: Option<String>,
985        pub description: Option<String>,
986        pub avatar: Option<String>,
987        pub client_mutation_id: Option<String>,
988    }
989
990    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
991    pub struct NamespaceEdge {
992        pub node: Option<Namespace>,
993    }
994
995    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
996    pub struct NamespaceConnection {
997        pub edges: Vec<Option<NamespaceEdge>>,
998    }
999
1000    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1001    pub struct Namespace {
1002        pub id: cynic::Id,
1003        pub name: String,
1004        pub global_name: String,
1005    }
1006
1007    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1008    pub struct DeployApp {
1009        pub id: cynic::Id,
1010        pub name: String,
1011        pub created_at: DateTime,
1012        pub updated_at: DateTime,
1013        pub description: Option<String>,
1014        pub active_version: Option<DeployAppVersion>,
1015        pub admin_url: String,
1016        pub owner: Owner,
1017        pub url: String,
1018        pub permalink: String,
1019        pub deleted: bool,
1020        pub aliases: AppAliasConnection,
1021        pub s3_url: Option<Url>,
1022    }
1023
1024    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1025    pub struct AppAliasConnection {
1026        pub page_info: PageInfo,
1027        pub edges: Vec<Option<AppAliasEdge>>,
1028    }
1029
1030    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1031    pub struct AppAliasEdge {
1032        pub node: Option<AppAlias>,
1033    }
1034
1035    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1036    pub struct AppAlias {
1037        pub name: String,
1038        pub hostname: String,
1039    }
1040
1041    #[derive(cynic::QueryVariables, Debug, Clone)]
1042    pub struct DeleteAppVars {
1043        pub app_id: cynic::Id,
1044    }
1045
1046    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1047    pub struct DeleteAppPayload {
1048        pub success: bool,
1049    }
1050
1051    #[derive(cynic::QueryFragment, Debug)]
1052    #[cynic(graphql_type = "Mutation", variables = "DeleteAppVars")]
1053    pub struct DeleteApp {
1054        #[arguments(input: { id: $app_id })]
1055        pub delete_app: Option<DeleteAppPayload>,
1056    }
1057
1058    #[derive(cynic::Enum, Clone, Copy, Debug)]
1059    pub enum DeployAppVersionsSortBy {
1060        Newest,
1061        Oldest,
1062    }
1063
1064    #[derive(cynic::QueryVariables, Debug, Clone)]
1065    pub struct GetDeployAppVersionsVars {
1066        pub owner: String,
1067        pub name: String,
1068
1069        pub offset: Option<i32>,
1070        pub before: Option<String>,
1071        pub after: Option<String>,
1072        pub first: Option<i32>,
1073        pub last: Option<i32>,
1074        pub sort_by: Option<DeployAppVersionsSortBy>,
1075    }
1076
1077    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1078    #[cynic(graphql_type = "Query", variables = "GetDeployAppVersionsVars")]
1079    pub struct GetDeployAppVersions {
1080        #[arguments(owner: $owner, name: $name)]
1081        pub get_deploy_app: Option<DeployAppVersions>,
1082    }
1083
1084    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1085    #[cynic(graphql_type = "DeployApp", variables = "GetDeployAppVersionsVars")]
1086    pub struct DeployAppVersions {
1087        #[arguments(
1088            first: $first,
1089            last: $last,
1090            before: $before,
1091            after: $after,
1092            offset: $offset,
1093            sortBy: $sort_by
1094        )]
1095        pub versions: DeployAppVersionConnection,
1096    }
1097
1098    #[derive(cynic::QueryVariables, Debug, Clone)]
1099    pub struct GetDeployAppVersionsByIdVars {
1100        pub id: cynic::Id,
1101
1102        pub offset: Option<i32>,
1103        pub before: Option<String>,
1104        pub after: Option<String>,
1105        pub first: Option<i32>,
1106        pub last: Option<i32>,
1107        pub sort_by: Option<DeployAppVersionsSortBy>,
1108    }
1109
1110    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1111    #[cynic(graphql_type = "DeployApp", variables = "GetDeployAppVersionsByIdVars")]
1112    pub struct DeployAppVersionsById {
1113        #[arguments(
1114            first: $first,
1115            last: $last,
1116            before: $before,
1117            after: $after,
1118            offset: $offset,
1119            sortBy: $sort_by
1120        )]
1121        pub versions: DeployAppVersionConnection,
1122    }
1123
1124    #[derive(cynic::QueryFragment, Debug, Clone)]
1125    #[cynic(graphql_type = "Query", variables = "GetDeployAppVersionsByIdVars")]
1126    pub struct GetDeployAppVersionsById {
1127        #[arguments(id: $id)]
1128        pub node: Option<NodeDeployAppVersions>,
1129    }
1130
1131    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1132    #[cynic(graphql_type = "DeployApp")]
1133    pub struct SparseDeployApp {
1134        pub id: cynic::Id,
1135    }
1136
1137    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1138    pub struct DeployAppVersion {
1139        pub id: cynic::Id,
1140        pub created_at: DateTime,
1141        pub updated_at: DateTime,
1142        pub version: String,
1143        pub description: Option<String>,
1144        pub yaml_config: String,
1145        pub user_yaml_config: String,
1146        pub config: String,
1147        pub json_config: String,
1148        pub url: String,
1149        pub disabled_at: Option<DateTime>,
1150        pub disabled_reason: Option<String>,
1151
1152        pub app: Option<SparseDeployApp>,
1153    }
1154
1155    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1156    pub struct DeployAppVersionConnection {
1157        pub page_info: PageInfo,
1158        pub edges: Vec<Option<DeployAppVersionEdge>>,
1159    }
1160
1161    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1162    pub struct DeployAppVersionEdge {
1163        pub node: Option<DeployAppVersion>,
1164        pub cursor: String,
1165    }
1166
1167    #[derive(cynic::QueryFragment, Debug)]
1168    pub struct DeployAppConnection {
1169        pub page_info: PageInfo,
1170        pub edges: Vec<Option<DeployAppEdge>>,
1171    }
1172
1173    #[derive(cynic::QueryFragment, Debug)]
1174    pub struct DeployAppEdge {
1175        pub node: Option<DeployApp>,
1176        pub cursor: String,
1177    }
1178
1179    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1180    pub struct PageInfo {
1181        pub has_next_page: bool,
1182        pub end_cursor: Option<String>,
1183    }
1184
1185    #[derive(cynic::QueryVariables, Debug)]
1186    pub struct GetNamespaceVars {
1187        pub name: String,
1188    }
1189
1190    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1191    pub struct MarkAppVersionAsActivePayload {
1192        pub app: DeployApp,
1193    }
1194
1195    #[derive(cynic::InputObject, Debug)]
1196    pub struct MarkAppVersionAsActiveInput {
1197        pub app_version: cynic::Id,
1198    }
1199
1200    #[derive(cynic::QueryVariables, Debug)]
1201    pub struct MarkAppVersionAsActiveVars {
1202        pub input: MarkAppVersionAsActiveInput,
1203    }
1204
1205    #[derive(cynic::QueryFragment, Debug)]
1206    #[cynic(graphql_type = "Mutation", variables = "MarkAppVersionAsActiveVars")]
1207    pub struct MarkAppVersionAsActive {
1208        #[arguments(input: $input)]
1209        pub mark_app_version_as_active: Option<MarkAppVersionAsActivePayload>,
1210    }
1211
1212    #[derive(cynic::QueryFragment, Debug)]
1213    #[cynic(graphql_type = "Query", variables = "GetNamespaceVars")]
1214    pub struct GetNamespace {
1215        #[arguments(name: $name)]
1216        pub get_namespace: Option<Namespace>,
1217    }
1218
1219    #[derive(cynic::QueryVariables, Debug)]
1220    pub struct GetNamespaceAppsVars {
1221        pub name: String,
1222        pub after: Option<String>,
1223        pub sort: Option<DeployAppsSortBy>,
1224    }
1225
1226    #[derive(cynic::QueryFragment, Debug)]
1227    #[cynic(graphql_type = "Query", variables = "GetNamespaceAppsVars")]
1228    pub struct GetNamespaceApps {
1229        #[arguments(name: $name)]
1230        pub get_namespace: Option<NamespaceWithApps>,
1231    }
1232
1233    #[derive(cynic::QueryFragment, Debug)]
1234    #[cynic(graphql_type = "Namespace")]
1235    #[cynic(variables = "GetNamespaceAppsVars")]
1236    pub struct NamespaceWithApps {
1237        pub id: cynic::Id,
1238        pub name: String,
1239        #[arguments(after: $after, sortBy: $sort)]
1240        pub apps: DeployAppConnection,
1241    }
1242
1243    #[derive(cynic::QueryVariables, Debug)]
1244    pub struct RedeployActiveAppVariables {
1245        pub id: cynic::Id,
1246    }
1247
1248    #[derive(cynic::QueryFragment, Debug)]
1249    #[cynic(graphql_type = "Mutation", variables = "RedeployActiveAppVariables")]
1250    pub struct RedeployActiveApp {
1251        #[arguments(input: { id: $id })]
1252        pub redeploy_active_version: Option<RedeployActiveVersionPayload>,
1253    }
1254
1255    #[derive(cynic::QueryFragment, Debug)]
1256    pub struct RedeployActiveVersionPayload {
1257        pub app: DeployApp,
1258    }
1259
1260    #[derive(cynic::QueryVariables, Debug)]
1261    pub struct GetAppDeploymentsVariables {
1262        pub after: Option<String>,
1263        pub first: Option<i32>,
1264        pub name: String,
1265        pub offset: Option<i32>,
1266        pub owner: String,
1267    }
1268
1269    #[derive(cynic::QueryFragment, Debug)]
1270    #[cynic(graphql_type = "Query", variables = "GetAppDeploymentsVariables")]
1271    pub struct GetAppDeployments {
1272        #[arguments(owner: $owner, name: $name)]
1273        pub get_deploy_app: Option<DeployAppDeployments>,
1274    }
1275
1276    #[derive(cynic::QueryFragment, Debug)]
1277    #[cynic(graphql_type = "DeployApp", variables = "GetAppDeploymentsVariables")]
1278    pub struct DeployAppDeployments {
1279        // FIXME: add $offset, $after, currently causes an error from the backend
1280        // #[arguments(first: $first, after: $after, offset: $offset)]
1281        pub deployments: Option<DeploymentConnection>,
1282    }
1283
1284    #[derive(cynic::QueryFragment, Debug)]
1285    pub struct DeploymentConnection {
1286        pub page_info: PageInfo,
1287        pub edges: Vec<Option<DeploymentEdge>>,
1288    }
1289
1290    #[derive(cynic::QueryFragment, Debug)]
1291    pub struct DeploymentEdge {
1292        pub node: Option<Deployment>,
1293    }
1294
1295    #[allow(clippy::large_enum_variant)]
1296    #[derive(cynic::InlineFragments, Debug, Clone, Serialize)]
1297    pub enum Deployment {
1298        AutobuildRepository(AutobuildRepository),
1299        NakedDeployment(NakedDeployment),
1300        #[cynic(fallback)]
1301        Other,
1302    }
1303
1304    #[derive(cynic::QueryFragment, serde::Serialize, Debug, Clone)]
1305    pub struct NakedDeployment {
1306        pub id: cynic::Id,
1307        pub created_at: DateTime,
1308        pub updated_at: DateTime,
1309        pub app_version: Option<DeployAppVersion>,
1310    }
1311
1312    #[derive(cynic::QueryFragment, serde::Serialize, Debug, Clone)]
1313    pub struct AutobuildRepository {
1314        pub id: cynic::Id,
1315        pub build_id: Uuid,
1316        pub created_at: DateTime,
1317        pub updated_at: DateTime,
1318        pub status: StatusEnum,
1319        pub log_url: Option<String>,
1320        pub repo_url: String,
1321    }
1322
1323    #[derive(cynic::Enum, Clone, Copy, Debug)]
1324    pub enum StatusEnum {
1325        Success,
1326        Working,
1327        Failure,
1328        Queued,
1329        Timeout,
1330        InternalError,
1331        Cancelled,
1332        Running,
1333    }
1334
1335    impl StatusEnum {
1336        pub fn as_str(&self) -> &'static str {
1337            match self {
1338                Self::Success => "success",
1339                Self::Working => "working",
1340                Self::Failure => "failure",
1341                Self::Queued => "queued",
1342                Self::Timeout => "timeout",
1343                Self::InternalError => "internal_error",
1344                Self::Cancelled => "cancelled",
1345                Self::Running => "running",
1346            }
1347        }
1348    }
1349
1350    #[derive(cynic::QueryVariables, Debug)]
1351    pub struct AutobuildConfigForZipUploadVariables<'a> {
1352        pub upload_url: &'a str,
1353    }
1354
1355    #[derive(cynic::QueryFragment, Debug)]
1356    #[cynic(
1357        graphql_type = "Mutation",
1358        variables = "AutobuildConfigForZipUploadVariables"
1359    )]
1360    pub struct AutobuildConfigForZipUpload {
1361        #[arguments(input: { uploadUrl: $upload_url })]
1362        pub autobuild_config_for_zip_upload: Option<AutobuildConfigForZipUploadPayload>,
1363    }
1364
1365    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1366    pub struct AutobuildConfigForZipUploadPayload {
1367        pub build_config: Option<BuildConfig>,
1368        pub deployed_apps: Option<Vec<Option<DeployApp>>>,
1369    }
1370
1371    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1372    pub struct BuildConfig {
1373        pub build_cmd: String,
1374        pub install_cmd: String,
1375        pub setup_db: bool,
1376        pub preset_name: String,
1377        pub app_name: String,
1378        pub can_deploy_without_repo: bool,
1379        pub completion_time_in_seconds: i32,
1380        pub branch: Option<String>,
1381    }
1382
1383    #[derive(cynic::InputObject, Debug, Clone)]
1384    pub struct WordpressDeploymentExtraData {
1385        pub site_name: String,
1386        pub admin_username: String,
1387        pub admin_password: String,
1388        pub admin_email: String,
1389        pub language: Option<String>,
1390    }
1391
1392    #[derive(cynic::InputObject, Debug, Clone)]
1393    pub struct AutobuildDeploymentExtraData {
1394        pub wordpress: Option<WordpressDeploymentExtraData>,
1395    }
1396
1397    #[derive(cynic::InputObject, Debug, Clone)]
1398    pub struct JobDefinitionInput {
1399        pub name: Option<String>,
1400        pub package: Option<String>,
1401        pub command: String,
1402        pub cli_args: Option<Vec<Option<String>>>,
1403        pub env: Option<Vec<Option<String>>>,
1404        pub timeout: Option<String>,
1405    }
1406
1407    #[derive(cynic::QueryVariables, Debug, Clone)]
1408    pub struct DeployViaAutobuildVars {
1409        pub repo_url: Option<String>,
1410        pub upload_url: Option<String>,
1411        pub app_name: Option<String>,
1412        pub app_id: Option<cynic::Id>,
1413        pub owner: Option<String>,
1414        pub build_cmd: Option<String>,
1415        pub install_cmd: Option<String>,
1416        pub enable_database: Option<bool>,
1417        pub secrets: Option<Vec<SecretInput>>,
1418        pub extra_data: Option<AutobuildDeploymentExtraData>,
1419        pub params: Option<AutobuildDeploymentExtraData>,
1420        pub managed: Option<bool>,
1421        pub kind: Option<String>,
1422        pub wait_for_screenshot_generation: Option<bool>,
1423        pub region: Option<String>,
1424        pub branch: Option<String>,
1425        pub allow_existing_app: Option<bool>,
1426        pub jobs: Option<Vec<JobDefinitionInput>>,
1427        pub domains: Option<Vec<Option<String>>>,
1428        pub client_mutation_id: Option<String>,
1429    }
1430
1431    #[derive(cynic::QueryFragment, Debug)]
1432    #[cynic(graphql_type = "Mutation", variables = "DeployViaAutobuildVars")]
1433    pub struct DeployViaAutobuild {
1434        #[arguments(input: { repoUrl: $repo_url, uploadUrl: $upload_url, appName: $app_name, appId: $app_id, owner: $owner, buildCmd: $build_cmd, installCmd: $install_cmd, enableDatabase: $enable_database, secrets: $secrets, extraData: $extra_data, params: $params, managed: $managed, kind: $kind, waitForScreenshotGeneration: $wait_for_screenshot_generation, region: $region, branch: $branch, allowExistingApp: $allow_existing_app, jobs: $jobs, domains: $domains, clientMutationId: $client_mutation_id })]
1435        pub deploy_via_autobuild: Option<DeployViaAutobuildPayload>,
1436    }
1437
1438    #[derive(cynic::QueryFragment, Debug)]
1439    pub struct DeployViaAutobuildPayload {
1440        pub success: bool,
1441        pub build_id: Uuid,
1442    }
1443
1444    #[derive(cynic::Scalar, Debug, Clone)]
1445    #[cynic(graphql_type = "UUID")]
1446    pub struct Uuid(pub String);
1447
1448    #[derive(cynic::QueryVariables, Debug)]
1449    pub struct PublishDeployAppVars {
1450        pub config: String,
1451        pub name: cynic::Id,
1452        pub owner: Option<cynic::Id>,
1453        pub make_default: Option<bool>,
1454    }
1455
1456    #[derive(cynic::QueryFragment, Debug)]
1457    #[cynic(graphql_type = "Mutation", variables = "PublishDeployAppVars")]
1458    pub struct PublishDeployApp {
1459        #[arguments(input: { config: { yamlConfig: $config }, name: $name, owner: $owner, makeDefault: $make_default })]
1460        pub publish_deploy_app: Option<PublishDeployAppPayload>,
1461    }
1462
1463    #[derive(cynic::QueryFragment, Debug)]
1464    pub struct PublishDeployAppPayload {
1465        pub deploy_app_version: DeployAppVersion,
1466    }
1467
1468    #[derive(cynic::QueryVariables, Debug)]
1469    pub struct GenerateDeployTokenVars {
1470        pub app_version_id: String,
1471    }
1472
1473    #[derive(cynic::QueryFragment, Debug)]
1474    #[cynic(graphql_type = "Mutation", variables = "GenerateDeployTokenVars")]
1475    pub struct GenerateDeployToken {
1476        #[arguments(input: { deployConfigVersionId: $app_version_id })]
1477        pub generate_deploy_token: Option<GenerateDeployTokenPayload>,
1478    }
1479
1480    #[derive(cynic::QueryFragment, Debug)]
1481    pub struct GenerateDeployTokenPayload {
1482        pub token: String,
1483    }
1484
1485    #[derive(cynic::Enum, Clone, Copy, Debug, PartialEq)]
1486    pub enum LogStream {
1487        Stdout,
1488        Stderr,
1489        Runtime,
1490    }
1491
1492    #[derive(cynic::QueryVariables, Debug, Clone)]
1493    pub struct GetDeployAppLogsVars {
1494        pub name: String,
1495        pub owner: String,
1496        /// The tag associated with a particular app version. Uses the active
1497        /// version if not provided.
1498        pub version: Option<String>,
1499        /// The lower bound for log messages, in nanoseconds since the Unix
1500        /// epoch.
1501        pub starting_from: f64,
1502        /// The upper bound for log messages, in nanoseconds since the Unix
1503        /// epoch.
1504        pub until: Option<f64>,
1505        pub first: Option<i32>,
1506
1507        pub request_id: Option<String>,
1508
1509        pub instance_ids: Option<Vec<String>>,
1510
1511        pub streams: Option<Vec<LogStream>>,
1512    }
1513
1514    #[derive(cynic::QueryFragment, Debug)]
1515    #[cynic(graphql_type = "Query", variables = "GetDeployAppLogsVars")]
1516    pub struct GetDeployAppLogs {
1517        #[arguments(name: $name, owner: $owner, version: $version)]
1518        pub get_deploy_app_version: Option<DeployAppVersionLogs>,
1519    }
1520
1521    #[derive(cynic::QueryFragment, Debug)]
1522    #[cynic(graphql_type = "DeployAppVersion", variables = "GetDeployAppLogsVars")]
1523    pub struct DeployAppVersionLogs {
1524        #[arguments(startingFrom: $starting_from, until: $until, first: $first, instanceIds: $instance_ids, requestId: $request_id, streams: $streams)]
1525        pub logs: LogConnection,
1526    }
1527
1528    #[derive(cynic::QueryFragment, Debug)]
1529    pub struct LogConnection {
1530        pub edges: Vec<Option<LogEdge>>,
1531    }
1532
1533    #[derive(cynic::QueryFragment, Debug)]
1534    pub struct LogEdge {
1535        pub node: Option<Log>,
1536    }
1537
1538    #[derive(cynic::QueryFragment, Debug, serde::Serialize, PartialEq)]
1539    pub struct Log {
1540        pub message: String,
1541        /// When the message was recorded, in nanoseconds since the Unix epoch.
1542        pub timestamp: f64,
1543        pub stream: Option<LogStream>,
1544        pub instance_id: String,
1545    }
1546
1547    #[derive(cynic::Enum, Clone, Copy, Debug, PartialEq, Eq)]
1548    pub enum AutoBuildDeployAppLogKind {
1549        Log,
1550        PreparingToDeployStatus,
1551        FetchingPlanStatus,
1552        BuildStatus,
1553        DeployStatus,
1554        Complete,
1555        Failed,
1556    }
1557
1558    #[derive(cynic::QueryVariables, Debug)]
1559    pub struct AutobuildDeploymentSubscriptionVariables {
1560        pub build_id: Uuid,
1561    }
1562
1563    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1564    #[cynic(
1565        graphql_type = "Subscription",
1566        variables = "AutobuildDeploymentSubscriptionVariables"
1567    )]
1568    pub struct AutobuildDeploymentSubscription {
1569        #[arguments(buildId: $build_id)]
1570        pub autobuild_deployment: Option<AutobuildLog>,
1571    }
1572
1573    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1574    pub struct AutobuildLog {
1575        pub kind: AutoBuildDeployAppLogKind,
1576        pub message: Option<String>,
1577        pub app_version: Option<DeployAppVersion>,
1578        pub timestamp: String,
1579        pub datetime: DateTime,
1580        pub stream: Option<LogStream>,
1581    }
1582
1583    #[derive(cynic::QueryVariables, Debug)]
1584    pub struct GenerateDeployConfigTokenVars {
1585        pub input: String,
1586    }
1587    #[derive(cynic::QueryFragment, Debug)]
1588    #[cynic(graphql_type = "Mutation", variables = "GenerateDeployConfigTokenVars")]
1589    pub struct GenerateDeployConfigToken {
1590        #[arguments(input: { config: $input })]
1591        pub generate_deploy_config_token: Option<GenerateDeployConfigTokenPayload>,
1592    }
1593
1594    #[derive(cynic::QueryFragment, Debug)]
1595    pub struct GenerateDeployConfigTokenPayload {
1596        pub token: String,
1597    }
1598
1599    #[derive(cynic::QueryVariables, Debug)]
1600    pub struct GenerateSshTokenVariables {
1601        pub app_id: Option<cynic::Id>,
1602    }
1603
1604    #[derive(cynic::QueryFragment, Debug)]
1605    #[cynic(graphql_type = "Mutation", variables = "GenerateSshTokenVariables")]
1606    pub struct GenerateSshToken {
1607        #[arguments(input: { appId: $app_id })]
1608        pub generate_ssh_token: Option<GenerateSshTokenPayload>,
1609    }
1610
1611    #[derive(cynic::QueryFragment, Debug)]
1612    pub struct GenerateSshTokenPayload {
1613        pub token: String,
1614    }
1615
1616    #[derive(cynic::QueryVariables, Debug)]
1617    pub struct GetNodeVars {
1618        pub id: cynic::Id,
1619    }
1620
1621    #[derive(cynic::QueryFragment, Debug)]
1622    #[cynic(graphql_type = "Query", variables = "GetNodeVars")]
1623    pub struct GetNode {
1624        #[arguments(id: $id)]
1625        pub node: Option<Node>,
1626    }
1627
1628    #[derive(cynic::QueryVariables, Debug)]
1629    pub struct GetDeployAppByIdVars {
1630        pub app_id: cynic::Id,
1631    }
1632
1633    #[derive(cynic::QueryFragment, Debug)]
1634    #[cynic(graphql_type = "Query", variables = "GetDeployAppByIdVars")]
1635    pub struct GetDeployAppById {
1636        #[arguments(id: $app_id)]
1637        #[cynic(rename = "node")]
1638        pub app: Option<Node>,
1639    }
1640
1641    #[derive(cynic::QueryVariables, Debug)]
1642    pub struct GetDeployAppAndVersionByIdVars {
1643        pub app_id: cynic::Id,
1644        pub version_id: cynic::Id,
1645    }
1646
1647    #[derive(cynic::QueryFragment, Debug)]
1648    #[cynic(graphql_type = "Query", variables = "GetDeployAppAndVersionByIdVars")]
1649    pub struct GetDeployAppAndVersionById {
1650        #[arguments(id: $app_id)]
1651        #[cynic(rename = "node")]
1652        pub app: Option<Node>,
1653        #[arguments(id: $version_id)]
1654        #[cynic(rename = "node")]
1655        pub version: Option<Node>,
1656    }
1657
1658    #[derive(cynic::QueryVariables, Debug)]
1659    pub struct GetDeployAppVersionByIdVars {
1660        pub version_id: cynic::Id,
1661    }
1662
1663    #[derive(cynic::QueryFragment, Debug)]
1664    #[cynic(graphql_type = "Query", variables = "GetDeployAppVersionByIdVars")]
1665    pub struct GetDeployAppVersionById {
1666        #[arguments(id: $version_id)]
1667        #[cynic(rename = "node")]
1668        pub version: Option<Node>,
1669    }
1670
1671    #[derive(cynic::QueryVariables, Debug)]
1672    pub struct DeleteAppSecretVariables {
1673        pub id: cynic::Id,
1674    }
1675
1676    #[derive(cynic::QueryFragment, Debug)]
1677    #[cynic(graphql_type = "Mutation", variables = "DeleteAppSecretVariables")]
1678    pub struct DeleteAppSecret {
1679        #[arguments(input: { id: $id })]
1680        pub delete_app_secret: Option<DeleteAppSecretPayload>,
1681    }
1682
1683    #[derive(cynic::QueryFragment, Debug)]
1684    pub struct DeleteAppSecretPayload {
1685        pub success: bool,
1686    }
1687    #[derive(cynic::QueryVariables, Debug, Clone)]
1688    pub struct GetAllAppSecretsVariables {
1689        pub after: Option<String>,
1690        pub app_id: cynic::Id,
1691        pub before: Option<String>,
1692        pub first: Option<i32>,
1693        pub last: Option<i32>,
1694        pub offset: Option<i32>,
1695        pub names: Option<Vec<String>>,
1696    }
1697
1698    #[derive(cynic::QueryFragment, Debug)]
1699    #[cynic(graphql_type = "Query", variables = "GetAllAppSecretsVariables")]
1700    pub struct GetAllAppSecrets {
1701        #[arguments(appId: $app_id, after: $after, before: $before, first: $first, last: $last, offset: $offset, names: $names)]
1702        pub get_app_secrets: Option<SecretConnection>,
1703    }
1704
1705    #[derive(cynic::QueryFragment, Debug)]
1706    pub struct SecretConnection {
1707        pub edges: Vec<Option<SecretEdge>>,
1708        pub page_info: PageInfo,
1709        pub total_count: Option<i32>,
1710    }
1711
1712    #[derive(cynic::QueryFragment, Debug)]
1713    pub struct SecretEdge {
1714        pub cursor: String,
1715        pub node: Option<Secret>,
1716    }
1717
1718    #[derive(cynic::QueryVariables, Debug)]
1719    pub struct GetAppSecretVariables {
1720        pub app_id: cynic::Id,
1721        pub secret_name: String,
1722    }
1723
1724    #[derive(cynic::QueryFragment, Debug)]
1725    #[cynic(graphql_type = "Query", variables = "GetAppSecretVariables")]
1726    pub struct GetAppSecret {
1727        #[arguments(appId: $app_id, secretName: $secret_name)]
1728        pub get_app_secret: Option<Secret>,
1729    }
1730
1731    #[derive(cynic::QueryVariables, Debug)]
1732    pub struct GetAppSecretValueVariables {
1733        pub id: cynic::Id,
1734    }
1735
1736    #[derive(cynic::QueryFragment, Debug)]
1737    #[cynic(graphql_type = "Query", variables = "GetAppSecretValueVariables")]
1738    pub struct GetAppSecretValue {
1739        #[arguments(id: $id)]
1740        pub get_secret_value: Option<String>,
1741    }
1742
1743    #[derive(cynic::QueryVariables, Debug)]
1744    pub struct UpsertAppSecretVariables<'a> {
1745        pub app_id: cynic::Id,
1746        pub name: &'a str,
1747        pub value: &'a str,
1748    }
1749
1750    #[derive(cynic::QueryFragment, Debug)]
1751    #[cynic(graphql_type = "Mutation", variables = "UpsertAppSecretVariables")]
1752    pub struct UpsertAppSecret {
1753        #[arguments(input: { appId: $app_id, name: $name, value: $value })]
1754        pub upsert_app_secret: Option<UpsertAppSecretPayload>,
1755    }
1756
1757    #[derive(cynic::QueryFragment, Debug)]
1758    pub struct UpsertAppSecretPayload {
1759        pub secret: Secret,
1760        pub success: bool,
1761    }
1762
1763    #[derive(cynic::QueryVariables, Debug)]
1764    pub struct UpsertAppSecretsVariables {
1765        pub app_id: cynic::Id,
1766        pub secrets: Option<Vec<SecretInput>>,
1767    }
1768
1769    #[derive(cynic::QueryFragment, Debug)]
1770    #[cynic(graphql_type = "Mutation", variables = "UpsertAppSecretsVariables")]
1771    pub struct UpsertAppSecrets {
1772        #[arguments(input: { appId: $app_id, secrets: $secrets })]
1773        pub upsert_app_secrets: Option<UpsertAppSecretsPayload>,
1774    }
1775
1776    #[derive(cynic::QueryFragment, Debug)]
1777    pub struct UpsertAppSecretsPayload {
1778        pub secrets: Vec<Option<Secret>>,
1779        pub success: bool,
1780    }
1781
1782    #[derive(cynic::InputObject, Debug, Clone)]
1783    pub struct SecretInput {
1784        pub name: String,
1785        pub value: String,
1786    }
1787    #[derive(cynic::QueryFragment, Debug, Serialize)]
1788    pub struct Secret {
1789        #[serde(skip_serializing)]
1790        pub id: cynic::Id,
1791        pub name: String,
1792        pub created_at: DateTime,
1793        pub updated_at: DateTime,
1794    }
1795
1796    #[derive(cynic::QueryVariables, Debug, Clone)]
1797    pub struct GetAllAppRegionsVariables {
1798        pub after: Option<String>,
1799        pub before: Option<String>,
1800        pub first: Option<i32>,
1801        pub last: Option<i32>,
1802        pub offset: Option<i32>,
1803    }
1804
1805    #[derive(cynic::QueryFragment, Debug)]
1806    #[cynic(graphql_type = "Query", variables = "GetAllAppRegionsVariables")]
1807    pub struct GetAllAppRegions {
1808        #[arguments(after: $after, offset: $offset, before: $before, first: $first, last: $last)]
1809        pub get_app_regions: AppRegionConnection,
1810    }
1811
1812    #[derive(cynic::QueryFragment, Debug)]
1813    pub struct AppRegionConnection {
1814        pub edges: Vec<Option<AppRegionEdge>>,
1815        pub page_info: PageInfo,
1816        pub total_count: Option<i32>,
1817    }
1818
1819    #[derive(cynic::QueryFragment, Debug)]
1820    pub struct AppRegionEdge {
1821        pub cursor: String,
1822        pub node: Option<AppRegion>,
1823    }
1824
1825    #[derive(cynic::QueryFragment, Debug, Serialize)]
1826    pub struct AppRegion {
1827        pub city: String,
1828        pub country: String,
1829        pub id: cynic::Id,
1830        pub name: String,
1831    }
1832
1833    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1834    #[cynic(graphql_type = "TXTRecord")]
1835    pub struct TxtRecord {
1836        pub id: cynic::Id,
1837        pub created_at: DateTime,
1838        pub updated_at: DateTime,
1839        pub deleted_at: Option<DateTime>,
1840        pub name: Option<String>,
1841        pub text: String,
1842        pub ttl: Option<i32>,
1843        pub data: String,
1844
1845        pub domain: DnsDomain,
1846    }
1847
1848    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1849    #[cynic(graphql_type = "SSHFPRecord")]
1850    pub struct SshfpRecord {
1851        pub id: cynic::Id,
1852        pub created_at: DateTime,
1853        pub updated_at: DateTime,
1854        pub deleted_at: Option<DateTime>,
1855        pub name: Option<String>,
1856        pub text: String,
1857        pub ttl: Option<i32>,
1858        #[cynic(rename = "type")]
1859        pub type_: DnsmanagerSshFingerprintRecordTypeChoices,
1860        pub algorithm: DnsmanagerSshFingerprintRecordAlgorithmChoices,
1861        pub fingerprint: String,
1862
1863        pub domain: DnsDomain,
1864    }
1865
1866    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1867    #[cynic(graphql_type = "SRVRecord")]
1868    pub struct SrvRecord {
1869        pub id: cynic::Id,
1870        pub created_at: DateTime,
1871        pub updated_at: DateTime,
1872        pub deleted_at: Option<DateTime>,
1873        pub name: Option<String>,
1874        pub text: String,
1875        pub ttl: Option<i32>,
1876        pub service: String,
1877        pub protocol: String,
1878        pub priority: i32,
1879        pub weight: i32,
1880        pub port: i32,
1881        pub target: String,
1882
1883        pub domain: DnsDomain,
1884    }
1885
1886    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1887    #[cynic(graphql_type = "SOARecord")]
1888    pub struct SoaRecord {
1889        pub id: cynic::Id,
1890        pub created_at: DateTime,
1891        pub updated_at: DateTime,
1892        pub deleted_at: Option<DateTime>,
1893        pub name: Option<String>,
1894        pub text: String,
1895        pub ttl: Option<i32>,
1896        pub mname: String,
1897        pub rname: String,
1898        pub serial: BigInt,
1899        pub refresh: BigInt,
1900        pub retry: BigInt,
1901        pub expire: BigInt,
1902        pub minimum: BigInt,
1903
1904        pub domain: DnsDomain,
1905    }
1906
1907    #[derive(cynic::Enum, Debug, Clone, Copy)]
1908    pub enum DNSRecordsSortBy {
1909        Newest,
1910        Oldest,
1911    }
1912
1913    #[derive(cynic::QueryVariables, Debug, Clone)]
1914    pub struct GetAllDnsRecordsVariables {
1915        pub after: Option<String>,
1916        pub updated_after: Option<DateTime>,
1917        pub sort_by: Option<DNSRecordsSortBy>,
1918        pub first: Option<i32>,
1919    }
1920
1921    #[derive(cynic::QueryFragment, Debug)]
1922    #[cynic(graphql_type = "Query", variables = "GetAllDnsRecordsVariables")]
1923    pub struct GetAllDnsRecords {
1924        #[arguments(
1925            first: $first,
1926            after: $after,
1927            updatedAfter: $updated_after,
1928            sortBy: $sort_by
1929        )]
1930        #[cynic(rename = "getAllDNSRecords")]
1931        pub get_all_dnsrecords: DnsRecordConnection,
1932    }
1933
1934    #[derive(cynic::QueryVariables, Debug, Clone)]
1935    pub struct GetAllDomainsVariables {
1936        pub after: Option<String>,
1937        pub first: Option<i32>,
1938        pub namespace: Option<String>,
1939    }
1940
1941    #[derive(cynic::QueryFragment, Debug)]
1942    #[cynic(graphql_type = "Query", variables = "GetAllDomainsVariables")]
1943    pub struct GetAllDomains {
1944        #[arguments(
1945            first: $first,
1946            after: $after,
1947            namespace: $namespace,
1948        )]
1949        #[cynic(rename = "getAllDomains")]
1950        pub get_all_domains: DnsDomainConnection,
1951    }
1952
1953    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1954    #[cynic(graphql_type = "PTRRecord")]
1955    pub struct PtrRecord {
1956        pub id: cynic::Id,
1957        pub created_at: DateTime,
1958        pub updated_at: DateTime,
1959        pub deleted_at: Option<DateTime>,
1960        pub name: Option<String>,
1961        pub text: String,
1962        pub ttl: Option<i32>,
1963        pub ptrdname: String,
1964
1965        pub domain: DnsDomain,
1966    }
1967
1968    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1969    #[cynic(graphql_type = "NSRecord")]
1970    pub struct NsRecord {
1971        pub id: cynic::Id,
1972        pub created_at: DateTime,
1973        pub updated_at: DateTime,
1974        pub deleted_at: Option<DateTime>,
1975        pub name: Option<String>,
1976        pub text: String,
1977        pub ttl: Option<i32>,
1978        pub nsdname: String,
1979
1980        pub domain: DnsDomain,
1981    }
1982
1983    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1984    #[cynic(graphql_type = "MXRecord")]
1985    pub struct MxRecord {
1986        pub id: cynic::Id,
1987        pub created_at: DateTime,
1988        pub updated_at: DateTime,
1989        pub deleted_at: Option<DateTime>,
1990        pub name: Option<String>,
1991        pub text: String,
1992        pub ttl: Option<i32>,
1993        pub preference: i32,
1994        pub exchange: String,
1995
1996        pub domain: DnsDomain,
1997    }
1998
1999    #[derive(cynic::QueryFragment, Debug)]
2000    #[cynic(graphql_type = "DNSRecordConnection")]
2001    pub struct DnsRecordConnection {
2002        pub page_info: PageInfo,
2003        pub edges: Vec<Option<DnsRecordEdge>>,
2004    }
2005
2006    #[derive(cynic::QueryFragment, Debug)]
2007    #[cynic(graphql_type = "DNSRecordEdge")]
2008    pub struct DnsRecordEdge {
2009        pub node: Option<DnsRecord>,
2010    }
2011
2012    #[derive(cynic::QueryFragment, Debug)]
2013    #[cynic(graphql_type = "DNSDomainConnection")]
2014    pub struct DnsDomainConnection {
2015        pub page_info: PageInfo,
2016        pub edges: Vec<Option<DnsDomainEdge>>,
2017    }
2018
2019    #[derive(cynic::QueryFragment, Debug)]
2020    #[cynic(graphql_type = "DNSDomainEdge")]
2021    pub struct DnsDomainEdge {
2022        pub node: Option<DnsDomain>,
2023    }
2024
2025    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2026    #[cynic(graphql_type = "DNAMERecord")]
2027    pub struct DNameRecord {
2028        pub id: cynic::Id,
2029        pub created_at: DateTime,
2030        pub updated_at: DateTime,
2031        pub deleted_at: Option<DateTime>,
2032        pub name: Option<String>,
2033        pub text: String,
2034        pub ttl: Option<i32>,
2035        pub d_name: String,
2036
2037        pub domain: DnsDomain,
2038    }
2039
2040    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2041    #[cynic(graphql_type = "CNAMERecord")]
2042    pub struct CNameRecord {
2043        pub id: cynic::Id,
2044        pub created_at: DateTime,
2045        pub updated_at: DateTime,
2046        pub deleted_at: Option<DateTime>,
2047        pub name: Option<String>,
2048        pub text: String,
2049        pub ttl: Option<i32>,
2050        pub c_name: String,
2051
2052        pub domain: DnsDomain,
2053    }
2054
2055    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2056    #[cynic(graphql_type = "CAARecord")]
2057    pub struct CaaRecord {
2058        pub id: cynic::Id,
2059        pub created_at: DateTime,
2060        pub updated_at: DateTime,
2061        pub deleted_at: Option<DateTime>,
2062        pub name: Option<String>,
2063        pub text: String,
2064        pub ttl: Option<i32>,
2065        pub value: String,
2066        pub flags: i32,
2067        pub tag: DnsmanagerCertificationAuthorityAuthorizationRecordTagChoices,
2068
2069        pub domain: DnsDomain,
2070    }
2071
2072    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2073    #[cynic(graphql_type = "ARecord")]
2074    pub struct ARecord {
2075        pub id: cynic::Id,
2076        pub created_at: DateTime,
2077        pub updated_at: DateTime,
2078        pub deleted_at: Option<DateTime>,
2079        pub name: Option<String>,
2080        pub text: String,
2081        pub ttl: Option<i32>,
2082        pub address: String,
2083        pub domain: DnsDomain,
2084    }
2085
2086    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2087    #[cynic(graphql_type = "AAAARecord")]
2088    pub struct AaaaRecord {
2089        pub id: cynic::Id,
2090        pub created_at: DateTime,
2091        pub updated_at: DateTime,
2092        pub deleted_at: Option<DateTime>,
2093        pub name: Option<String>,
2094        pub text: String,
2095        pub ttl: Option<i32>,
2096        pub address: String,
2097        pub domain: DnsDomain,
2098    }
2099
2100    #[derive(cynic::InlineFragments, Debug, Clone, Serialize)]
2101    #[cynic(graphql_type = "DNSRecord")]
2102    pub enum DnsRecord {
2103        A(ARecord),
2104        AAAA(AaaaRecord),
2105        CName(CNameRecord),
2106        Txt(TxtRecord),
2107        Mx(MxRecord),
2108        Ns(NsRecord),
2109        CAA(CaaRecord),
2110        DName(DNameRecord),
2111        Ptr(PtrRecord),
2112        Soa(SoaRecord),
2113        Srv(SrvRecord),
2114        Sshfp(SshfpRecord),
2115        #[cynic(fallback)]
2116        Unknown,
2117    }
2118
2119    impl DnsRecord {
2120        pub fn id(&self) -> &str {
2121            match self {
2122                DnsRecord::A(record) => record.id.inner(),
2123                DnsRecord::AAAA(record) => record.id.inner(),
2124                DnsRecord::CName(record) => record.id.inner(),
2125                DnsRecord::Txt(record) => record.id.inner(),
2126                DnsRecord::Mx(record) => record.id.inner(),
2127                DnsRecord::Ns(record) => record.id.inner(),
2128                DnsRecord::CAA(record) => record.id.inner(),
2129                DnsRecord::DName(record) => record.id.inner(),
2130                DnsRecord::Ptr(record) => record.id.inner(),
2131                DnsRecord::Soa(record) => record.id.inner(),
2132                DnsRecord::Srv(record) => record.id.inner(),
2133                DnsRecord::Sshfp(record) => record.id.inner(),
2134                DnsRecord::Unknown => "",
2135            }
2136        }
2137        pub fn name(&self) -> Option<&str> {
2138            match self {
2139                DnsRecord::A(record) => record.name.as_deref(),
2140                DnsRecord::AAAA(record) => record.name.as_deref(),
2141                DnsRecord::CName(record) => record.name.as_deref(),
2142                DnsRecord::Txt(record) => record.name.as_deref(),
2143                DnsRecord::Mx(record) => record.name.as_deref(),
2144                DnsRecord::Ns(record) => record.name.as_deref(),
2145                DnsRecord::CAA(record) => record.name.as_deref(),
2146                DnsRecord::DName(record) => record.name.as_deref(),
2147                DnsRecord::Ptr(record) => record.name.as_deref(),
2148                DnsRecord::Soa(record) => record.name.as_deref(),
2149                DnsRecord::Srv(record) => record.name.as_deref(),
2150                DnsRecord::Sshfp(record) => record.name.as_deref(),
2151                DnsRecord::Unknown => None,
2152            }
2153        }
2154        pub fn ttl(&self) -> Option<i32> {
2155            match self {
2156                DnsRecord::A(record) => record.ttl,
2157                DnsRecord::AAAA(record) => record.ttl,
2158                DnsRecord::CName(record) => record.ttl,
2159                DnsRecord::Txt(record) => record.ttl,
2160                DnsRecord::Mx(record) => record.ttl,
2161                DnsRecord::Ns(record) => record.ttl,
2162                DnsRecord::CAA(record) => record.ttl,
2163                DnsRecord::DName(record) => record.ttl,
2164                DnsRecord::Ptr(record) => record.ttl,
2165                DnsRecord::Soa(record) => record.ttl,
2166                DnsRecord::Srv(record) => record.ttl,
2167                DnsRecord::Sshfp(record) => record.ttl,
2168                DnsRecord::Unknown => None,
2169            }
2170        }
2171
2172        pub fn text(&self) -> &str {
2173            match self {
2174                DnsRecord::A(record) => record.text.as_str(),
2175                DnsRecord::AAAA(record) => record.text.as_str(),
2176                DnsRecord::CName(record) => record.text.as_str(),
2177                DnsRecord::Txt(record) => record.text.as_str(),
2178                DnsRecord::Mx(record) => record.text.as_str(),
2179                DnsRecord::Ns(record) => record.text.as_str(),
2180                DnsRecord::CAA(record) => record.text.as_str(),
2181                DnsRecord::DName(record) => record.text.as_str(),
2182                DnsRecord::Ptr(record) => record.text.as_str(),
2183                DnsRecord::Soa(record) => record.text.as_str(),
2184                DnsRecord::Srv(record) => record.text.as_str(),
2185                DnsRecord::Sshfp(record) => record.text.as_str(),
2186                DnsRecord::Unknown => "",
2187            }
2188        }
2189        pub fn record_type(&self) -> &str {
2190            match self {
2191                DnsRecord::A(_) => "A",
2192                DnsRecord::AAAA(_) => "AAAA",
2193                DnsRecord::CName(_) => "CNAME",
2194                DnsRecord::Txt(_) => "TXT",
2195                DnsRecord::Mx(_) => "MX",
2196                DnsRecord::Ns(_) => "NS",
2197                DnsRecord::CAA(_) => "CAA",
2198                DnsRecord::DName(_) => "DNAME",
2199                DnsRecord::Ptr(_) => "PTR",
2200                DnsRecord::Soa(_) => "SOA",
2201                DnsRecord::Srv(_) => "SRV",
2202                DnsRecord::Sshfp(_) => "SSHFP",
2203                DnsRecord::Unknown => "",
2204            }
2205        }
2206
2207        pub fn domain(&self) -> Option<&DnsDomain> {
2208            match self {
2209                DnsRecord::A(record) => Some(&record.domain),
2210                DnsRecord::AAAA(record) => Some(&record.domain),
2211                DnsRecord::CName(record) => Some(&record.domain),
2212                DnsRecord::Txt(record) => Some(&record.domain),
2213                DnsRecord::Mx(record) => Some(&record.domain),
2214                DnsRecord::Ns(record) => Some(&record.domain),
2215                DnsRecord::CAA(record) => Some(&record.domain),
2216                DnsRecord::DName(record) => Some(&record.domain),
2217                DnsRecord::Ptr(record) => Some(&record.domain),
2218                DnsRecord::Soa(record) => Some(&record.domain),
2219                DnsRecord::Srv(record) => Some(&record.domain),
2220                DnsRecord::Sshfp(record) => Some(&record.domain),
2221                DnsRecord::Unknown => None,
2222            }
2223        }
2224
2225        pub fn created_at(&self) -> Option<&DateTime> {
2226            match self {
2227                DnsRecord::A(record) => Some(&record.created_at),
2228                DnsRecord::AAAA(record) => Some(&record.created_at),
2229                DnsRecord::CName(record) => Some(&record.created_at),
2230                DnsRecord::Txt(record) => Some(&record.created_at),
2231                DnsRecord::Mx(record) => Some(&record.created_at),
2232                DnsRecord::Ns(record) => Some(&record.created_at),
2233                DnsRecord::CAA(record) => Some(&record.created_at),
2234                DnsRecord::DName(record) => Some(&record.created_at),
2235                DnsRecord::Ptr(record) => Some(&record.created_at),
2236                DnsRecord::Soa(record) => Some(&record.created_at),
2237                DnsRecord::Srv(record) => Some(&record.created_at),
2238                DnsRecord::Sshfp(record) => Some(&record.created_at),
2239                DnsRecord::Unknown => None,
2240            }
2241        }
2242
2243        pub fn updated_at(&self) -> Option<&DateTime> {
2244            match self {
2245                Self::A(record) => Some(&record.updated_at),
2246                Self::AAAA(record) => Some(&record.updated_at),
2247                Self::CName(record) => Some(&record.updated_at),
2248                Self::Txt(record) => Some(&record.updated_at),
2249                Self::Mx(record) => Some(&record.updated_at),
2250                Self::Ns(record) => Some(&record.updated_at),
2251                Self::CAA(record) => Some(&record.updated_at),
2252                Self::DName(record) => Some(&record.updated_at),
2253                Self::Ptr(record) => Some(&record.updated_at),
2254                Self::Soa(record) => Some(&record.updated_at),
2255                Self::Srv(record) => Some(&record.updated_at),
2256                Self::Sshfp(record) => Some(&record.updated_at),
2257                Self::Unknown => None,
2258            }
2259        }
2260
2261        pub fn deleted_at(&self) -> Option<&DateTime> {
2262            match self {
2263                Self::A(record) => record.deleted_at.as_ref(),
2264                Self::AAAA(record) => record.deleted_at.as_ref(),
2265                Self::CName(record) => record.deleted_at.as_ref(),
2266                Self::Txt(record) => record.deleted_at.as_ref(),
2267                Self::Mx(record) => record.deleted_at.as_ref(),
2268                Self::Ns(record) => record.deleted_at.as_ref(),
2269                Self::CAA(record) => record.deleted_at.as_ref(),
2270                Self::DName(record) => record.deleted_at.as_ref(),
2271                Self::Ptr(record) => record.deleted_at.as_ref(),
2272                Self::Soa(record) => record.deleted_at.as_ref(),
2273                Self::Srv(record) => record.deleted_at.as_ref(),
2274                Self::Sshfp(record) => record.deleted_at.as_ref(),
2275                Self::Unknown => None,
2276            }
2277        }
2278    }
2279
2280    #[derive(cynic::Enum, Clone, Copy, Debug)]
2281    pub enum DnsmanagerCertificationAuthorityAuthorizationRecordTagChoices {
2282        Issue,
2283        Issuewild,
2284        Iodef,
2285    }
2286
2287    impl DnsmanagerCertificationAuthorityAuthorizationRecordTagChoices {
2288        pub fn as_str(self) -> &'static str {
2289            match self {
2290                Self::Issue => "issue",
2291                Self::Issuewild => "issuewild",
2292                Self::Iodef => "iodef",
2293            }
2294        }
2295    }
2296
2297    #[derive(cynic::Enum, Clone, Copy, Debug)]
2298    pub enum DnsmanagerSshFingerprintRecordAlgorithmChoices {
2299        #[cynic(rename = "A_1")]
2300        A1,
2301        #[cynic(rename = "A_2")]
2302        A2,
2303        #[cynic(rename = "A_3")]
2304        A3,
2305        #[cynic(rename = "A_4")]
2306        A4,
2307    }
2308
2309    #[derive(cynic::Enum, Clone, Copy, Debug)]
2310    pub enum DnsmanagerSshFingerprintRecordTypeChoices {
2311        #[cynic(rename = "A_1")]
2312        A1,
2313        #[cynic(rename = "A_2")]
2314        A2,
2315    }
2316
2317    #[derive(cynic::QueryVariables, Debug)]
2318    pub struct GetDomainVars {
2319        pub domain: String,
2320    }
2321
2322    #[derive(cynic::QueryFragment, Debug)]
2323    #[cynic(graphql_type = "Query", variables = "GetDomainVars")]
2324    pub struct GetDomain {
2325        #[arguments(name: $domain)]
2326        pub get_domain: Option<DnsDomain>,
2327    }
2328
2329    #[derive(cynic::QueryFragment, Debug)]
2330    #[cynic(graphql_type = "Query", variables = "GetDomainVars")]
2331    pub struct GetDomainWithZoneFile {
2332        #[arguments(name: $domain)]
2333        pub get_domain: Option<DnsDomainWithZoneFile>,
2334    }
2335
2336    #[derive(cynic::QueryFragment, Debug)]
2337    #[cynic(graphql_type = "Query", variables = "GetDomainVars")]
2338    pub struct GetDomainWithRecords {
2339        #[arguments(name: $domain)]
2340        pub get_domain: Option<DnsDomainWithRecords>,
2341    }
2342
2343    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2344    #[cynic(graphql_type = "DNSDomain")]
2345    pub struct DnsDomain {
2346        pub id: cynic::Id,
2347        pub name: String,
2348        pub slug: String,
2349        pub owner: Owner,
2350    }
2351
2352    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2353    #[cynic(graphql_type = "DNSDomain")]
2354    pub struct DnsDomainWithZoneFile {
2355        pub id: cynic::Id,
2356        pub name: String,
2357        pub slug: String,
2358        pub zone_file: String,
2359    }
2360
2361    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2362    #[cynic(graphql_type = "DNSDomain")]
2363    pub struct DnsDomainWithRecords {
2364        pub id: cynic::Id,
2365        pub name: String,
2366        pub slug: String,
2367        pub records: Option<Vec<Option<DnsRecord>>>,
2368    }
2369
2370    #[derive(cynic::QueryVariables, Debug)]
2371    pub struct PurgeCacheForAppVersionVars {
2372        pub id: cynic::Id,
2373    }
2374
2375    #[derive(cynic::QueryFragment, Debug)]
2376    pub struct PurgeCacheForAppVersionPayload {
2377        pub app_version: DeployAppVersion,
2378    }
2379
2380    #[derive(cynic::QueryFragment, Debug)]
2381    #[cynic(graphql_type = "Mutation", variables = "PurgeCacheForAppVersionVars")]
2382    pub struct PurgeCacheForAppVersion {
2383        #[arguments(input: {id: $id})]
2384        pub purge_cache_for_app_version: Option<PurgeCacheForAppVersionPayload>,
2385    }
2386
2387    #[derive(cynic::Scalar, Debug, Clone)]
2388    #[cynic(graphql_type = "URL")]
2389    pub struct Url(pub String);
2390
2391    #[derive(cynic::Scalar, Debug, Clone)]
2392    pub struct BigInt(pub i64);
2393
2394    #[derive(cynic::Enum, Clone, Copy, Debug, PartialEq, Eq)]
2395    pub enum ProgrammingLanguage {
2396        Python,
2397        Javascript,
2398    }
2399
2400    /// A library that exposes bindings to a Wasmer package.
2401    #[derive(Debug, Clone)]
2402    pub struct Bindings {
2403        /// A unique ID specifying this set of bindings.
2404        pub id: String,
2405        /// The URL which can be used to download the files that were generated
2406        /// (typically as a `*.tar.gz` file).
2407        pub url: String,
2408        /// The programming language these bindings are written in.
2409        pub language: ProgrammingLanguage,
2410        /// The generator used to generate these bindings.
2411        pub generator: BindingsGenerator,
2412    }
2413
2414    #[derive(cynic::QueryVariables, Debug, Clone)]
2415    pub struct GetBindingsQueryVariables<'a> {
2416        pub name: &'a str,
2417        pub version: Option<&'a str>,
2418    }
2419
2420    #[derive(cynic::QueryFragment, Debug, Clone)]
2421    #[cynic(graphql_type = "Query", variables = "GetBindingsQueryVariables")]
2422    pub struct GetBindingsQuery {
2423        #[arguments(name: $name, version: $version)]
2424        #[cynic(rename = "getPackageVersion")]
2425        pub package_version: Option<PackageBindingsVersion>,
2426    }
2427
2428    #[derive(cynic::QueryFragment, Debug, Clone)]
2429    #[cynic(graphql_type = "PackageVersion")]
2430    pub struct PackageBindingsVersion {
2431        pub bindings: Vec<Option<PackageVersionLanguageBinding>>,
2432    }
2433
2434    #[derive(cynic::QueryFragment, Debug, Clone)]
2435    pub struct BindingsGenerator {
2436        pub package_version: PackageVersion,
2437        pub command_name: String,
2438    }
2439
2440    #[derive(cynic::QueryFragment, Debug, Clone)]
2441    pub struct PackageVersionLanguageBinding {
2442        pub id: cynic::Id,
2443        pub language: ProgrammingLanguage,
2444        pub url: String,
2445        pub generator: BindingsGenerator,
2446        pub __typename: String,
2447    }
2448
2449    #[derive(cynic::QueryVariables, Debug)]
2450    pub struct PackageVersionReadySubscriptionVariables {
2451        pub package_version_id: cynic::Id,
2452    }
2453
2454    #[derive(cynic::QueryFragment, Debug)]
2455    #[cynic(
2456        graphql_type = "Subscription",
2457        variables = "PackageVersionReadySubscriptionVariables"
2458    )]
2459    pub struct PackageVersionReadySubscription {
2460        #[arguments(packageVersionId: $package_version_id)]
2461        pub package_version_ready: PackageVersionReadyResponse,
2462    }
2463
2464    #[derive(cynic::QueryFragment, Debug)]
2465    pub struct PackageVersionReadyResponse {
2466        pub state: PackageVersionState,
2467        pub success: bool,
2468    }
2469
2470    #[derive(cynic::Enum, Clone, Copy, Debug)]
2471    pub enum PackageVersionState {
2472        WebcGenerated,
2473        BindingsGenerated,
2474        NativeExesGenerated,
2475    }
2476
2477    #[derive(cynic::InlineFragments, Debug, Clone)]
2478    #[cynic(graphql_type = "Node", variables = "GetDeployAppVersionsByIdVars")]
2479    pub enum NodeDeployAppVersions {
2480        DeployApp(Box<DeployAppVersionsById>),
2481        #[cynic(fallback)]
2482        Unknown,
2483    }
2484
2485    impl NodeDeployAppVersions {
2486        pub fn into_app(self) -> Option<DeployAppVersionsById> {
2487            match self {
2488                Self::DeployApp(v) => Some(*v),
2489                _ => None,
2490            }
2491        }
2492    }
2493
2494    #[derive(cynic::InlineFragments, Debug)]
2495    pub enum Node {
2496        DeployApp(Box<DeployApp>),
2497        DeployAppVersion(Box<DeployAppVersion>),
2498        AutobuildRepository(Box<AutobuildRepository>),
2499        #[cynic(fallback)]
2500        Unknown,
2501    }
2502
2503    impl Node {
2504        pub fn into_deploy_app(self) -> Option<DeployApp> {
2505            match self {
2506                Node::DeployApp(app) => Some(*app),
2507                _ => None,
2508            }
2509        }
2510
2511        pub fn into_deploy_app_version(self) -> Option<DeployAppVersion> {
2512            match self {
2513                Node::DeployAppVersion(version) => Some(*version),
2514                _ => None,
2515            }
2516        }
2517    }
2518}
2519
2520#[allow(non_snake_case, non_camel_case_types)]
2521mod schema {
2522    cynic::use_schema!(r#"schema.graphql"#);
2523}