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