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