Skip to main content

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::Scalar, Debug, Clone)]
43    pub struct GenericScalar(pub serde_json::Value);
44
45    #[derive(cynic::Enum, Clone, Copy, Debug)]
46    pub enum GrapheneRole {
47        Owner,
48        Admin,
49        Editor,
50        Viewer,
51    }
52
53    #[derive(cynic::QueryVariables, Debug)]
54    pub struct ViewerCanVariables<'a> {
55        pub action: OwnerAction,
56        pub owner_name: &'a str,
57    }
58
59    #[derive(cynic::QueryFragment, Debug)]
60    #[cynic(graphql_type = "Query", variables = "ViewerCanVariables")]
61    pub struct ViewerCan {
62        #[arguments(action: $action, ownerName: $owner_name)]
63        pub viewer_can: bool,
64    }
65
66    #[derive(cynic::Enum, Clone, Copy, Debug)]
67    pub enum OwnerAction {
68        DeployApp,
69        PublishPackage,
70    }
71
72    #[derive(cynic::QueryVariables, Debug)]
73    pub struct RevokeTokenVariables {
74        pub token: String,
75    }
76
77    #[derive(cynic::QueryFragment, Debug)]
78    #[cynic(graphql_type = "Mutation", variables = "RevokeTokenVariables")]
79    pub struct RevokeToken {
80        #[arguments(input: { token: $token })]
81        pub revoke_api_token: Option<RevokeAPITokenPayload>,
82    }
83
84    #[derive(cynic::QueryFragment, Debug)]
85    pub struct RevokeAPITokenPayload {
86        pub success: Option<bool>,
87    }
88
89    #[derive(cynic::QueryVariables, Debug)]
90    pub struct CreateNewNonceVariables {
91        pub callback_url: String,
92        pub name: String,
93    }
94
95    #[derive(cynic::QueryFragment, Debug)]
96    #[cynic(graphql_type = "Mutation", variables = "CreateNewNonceVariables")]
97    pub struct CreateNewNonce {
98        #[arguments(input: { callbackUrl: $callback_url, name: $name })]
99        pub new_nonce: Option<NewNoncePayload>,
100    }
101
102    #[derive(cynic::QueryFragment, Debug)]
103    pub struct NewNoncePayload {
104        pub client_mutation_id: Option<String>,
105        pub nonce: Nonce,
106    }
107
108    #[derive(cynic::QueryFragment, Debug)]
109    pub struct Nonce {
110        pub auth_url: String,
111        pub callback_url: String,
112        pub created_at: DateTime,
113        pub expired: bool,
114        pub id: cynic::Id,
115        pub is_validated: bool,
116        pub name: String,
117        pub secret: String,
118    }
119
120    #[derive(cynic::QueryFragment, Debug)]
121    #[cynic(graphql_type = "Query")]
122    pub struct GetCurrentUser {
123        pub viewer: Option<User>,
124    }
125
126    #[derive(cynic::QueryVariables, Debug)]
127    pub struct GetCurrentUserWithNamespacesVars {
128        pub namespace_role: Option<GrapheneRole>,
129    }
130
131    #[derive(cynic::QueryFragment, Debug)]
132    #[cynic(graphql_type = "Query", variables = "GetCurrentUserWithNamespacesVars")]
133    pub struct GetCurrentUserWithNamespaces {
134        pub viewer: Option<UserWithNamespaces>,
135    }
136
137    #[derive(cynic::QueryFragment, Debug, serde::Serialize)]
138    pub struct User {
139        pub id: cynic::Id,
140        pub username: String,
141    }
142
143    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
144    pub struct Package {
145        pub id: cynic::Id,
146        pub package_name: String,
147        pub namespace: Option<String>,
148        pub last_version: Option<PackageVersion>,
149        pub private: bool,
150    }
151
152    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
153    pub struct PackageDistribution {
154        pub pirita_sha256_hash: Option<String>,
155        pub pirita_download_url: Option<String>,
156        pub download_url: Option<String>,
157        pub size: Option<i32>,
158        pub pirita_size: Option<i32>,
159        pub webc_version: Option<WebcVersion>,
160        pub webc_manifest: Option<JSONString>,
161    }
162
163    #[derive(cynic::Enum, Clone, Copy, Debug)]
164    pub enum WebcVersion {
165        V2,
166        V3,
167    }
168
169    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
170    pub struct WebcImage {
171        pub created_at: DateTime,
172        pub updated_at: DateTime,
173        pub webc_url: String,
174        pub webc_sha256: String,
175        pub file_size: BigInt,
176        pub manifest: JSONString,
177        pub version: Option<WebcVersion>,
178    }
179
180    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
181    pub struct PackageWebc {
182        pub id: cynic::Id,
183        pub created_at: DateTime,
184        pub updated_at: DateTime,
185        pub tag: String,
186        pub is_archived: bool,
187        pub webc_url: String,
188        pub webc: Option<WebcImage>,
189        pub webc_v3: Option<WebcImage>,
190    }
191
192    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
193    pub struct PackageVersion {
194        pub id: cynic::Id,
195        pub version: String,
196        pub created_at: DateTime,
197        pub distribution: PackageDistribution,
198    }
199
200    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
201    #[cynic(graphql_type = "PackageVersion")]
202    pub struct PackageVersionWithPackage {
203        pub id: cynic::Id,
204        pub version: String,
205        pub created_at: DateTime,
206        pub description: String,
207        pub license: Option<String>,
208        pub homepage: Option<String>,
209        pub repository: Option<String>,
210        pub pirita_manifest: Option<JSONString>,
211        pub package: Package,
212
213        #[arguments(version: "V3")]
214        #[cynic(rename = "distribution")]
215        pub distribution_v3: PackageDistribution,
216
217        #[arguments(version: "V2")]
218        #[cynic(rename = "distribution")]
219        pub distribution_v2: PackageDistribution,
220    }
221
222    #[derive(cynic::QueryVariables, Debug)]
223    pub struct GetAppTemplateFromSlugVariables {
224        pub slug: String,
225    }
226
227    #[derive(cynic::QueryFragment, Debug)]
228    #[cynic(graphql_type = "Query", variables = "GetAppTemplateFromSlugVariables")]
229    pub struct GetAppTemplateFromSlug {
230        #[arguments(slug: $slug)]
231        pub get_app_template: Option<AppTemplate>,
232    }
233
234    #[derive(cynic::Enum, Clone, Copy, Debug)]
235    pub enum AppTemplatesSortBy {
236        Newest,
237        Oldest,
238        Popular,
239    }
240
241    #[derive(cynic::QueryVariables, Debug, Clone)]
242    pub struct GetAppTemplatesFromFrameworkVars {
243        pub framework_slug: String,
244        pub first: i32,
245        pub after: Option<String>,
246        pub sort_by: Option<AppTemplatesSortBy>,
247    }
248
249    #[derive(cynic::QueryFragment, Debug)]
250    #[cynic(graphql_type = "Query", variables = "GetAppTemplatesFromFrameworkVars")]
251    pub struct GetAppTemplatesFromFramework {
252        #[arguments(
253            frameworkSlug: $framework_slug,
254            first: $first,
255            after: $after,
256            sortBy: $sort_by
257        )]
258        pub get_app_templates: Option<AppTemplateConnection>,
259    }
260
261    #[derive(cynic::QueryVariables, Debug, Clone)]
262    pub struct GetAppTemplatesFromLanguageVars {
263        pub language_slug: String,
264        pub first: i32,
265        pub after: Option<String>,
266        pub sort_by: Option<AppTemplatesSortBy>,
267    }
268
269    #[derive(cynic::QueryFragment, Debug)]
270    #[cynic(graphql_type = "Query", variables = "GetAppTemplatesFromLanguageVars")]
271    pub struct GetAppTemplatesFromLanguage {
272        #[arguments(
273            languageSlug: $language_slug,
274            first: $first,
275            after: $after,
276            sortBy: $sort_by
277        )]
278        pub get_app_templates: Option<AppTemplateConnection>,
279    }
280
281    #[derive(cynic::QueryVariables, Debug, Clone)]
282    pub struct GetAppTemplatesVars {
283        pub category_slug: String,
284        pub first: i32,
285        pub after: Option<String>,
286        pub sort_by: Option<AppTemplatesSortBy>,
287    }
288
289    #[derive(cynic::QueryFragment, Debug)]
290    #[cynic(graphql_type = "Query", variables = "GetAppTemplatesVars")]
291    pub struct GetAppTemplates {
292        #[arguments(
293            categorySlug: $category_slug,
294            first: $first,
295            after: $after,
296            sortBy: $sort_by
297        )]
298        pub get_app_templates: Option<AppTemplateConnection>,
299    }
300
301    #[derive(cynic::QueryFragment, Debug)]
302    pub struct AppTemplateConnection {
303        pub edges: Vec<Option<AppTemplateEdge>>,
304        pub page_info: PageInfo,
305    }
306
307    #[derive(cynic::QueryFragment, Debug)]
308    pub struct AppTemplateEdge {
309        pub node: Option<AppTemplate>,
310        pub cursor: String,
311    }
312
313    #[derive(serde::Serialize, cynic::QueryFragment, PartialEq, Eq, Debug, Clone)]
314    pub struct AppTemplate {
315        #[serde(rename = "demoUrl")]
316        pub demo_url: String,
317        pub language: Option<String>,
318        pub name: String,
319        pub framework: String,
320        #[serde(rename = "createdAt")]
321        pub created_at: DateTime,
322        pub description: String,
323        pub id: cynic::Id,
324        #[serde(rename = "isPublic")]
325        pub is_public: bool,
326        #[serde(rename = "repoLicense")]
327        pub repo_license: String,
328        pub readme: String,
329        #[serde(rename = "repoUrl")]
330        pub repo_url: String,
331        pub slug: String,
332        #[serde(rename = "updatedAt")]
333        pub updated_at: DateTime,
334        #[serde(rename = "useCases")]
335        pub use_cases: Jsonstring,
336        #[serde(rename = "branch")]
337        pub branch: Option<String>,
338        #[serde(rename = "rootDir")]
339        pub root_dir: Option<String>,
340    }
341
342    #[derive(cynic::QueryVariables, Debug, Clone)]
343    pub struct GetTemplateFrameworksVars {
344        pub after: Option<String>,
345        pub first: Option<i32>,
346    }
347
348    #[derive(cynic::QueryFragment, Debug)]
349    #[cynic(graphql_type = "Query", variables = "GetTemplateFrameworksVars")]
350    pub struct GetTemplateFrameworks {
351        #[arguments(after: $after, first: $first)]
352        pub get_template_frameworks: Option<TemplateFrameworkConnection>,
353    }
354
355    #[derive(cynic::QueryFragment, Debug)]
356    pub struct TemplateFrameworkConnection {
357        pub edges: Vec<Option<TemplateFrameworkEdge>>,
358        pub page_info: PageInfo,
359        pub total_count: Option<i32>,
360    }
361
362    #[derive(cynic::QueryFragment, Debug)]
363    pub struct TemplateFrameworkEdge {
364        pub cursor: String,
365        pub node: Option<TemplateFramework>,
366    }
367
368    #[derive(serde::Serialize, cynic::QueryFragment, PartialEq, Eq, Debug)]
369    pub struct TemplateFramework {
370        #[serde(rename = "createdAt")]
371        pub created_at: DateTime,
372        pub id: cynic::Id,
373        pub name: String,
374        pub slug: String,
375        #[serde(rename = "updatedAt")]
376        pub updated_at: DateTime,
377    }
378
379    #[derive(cynic::QueryVariables, Debug, Clone)]
380    pub struct GetTemplateLanguagesVars {
381        pub after: Option<String>,
382        pub first: Option<i32>,
383    }
384
385    #[derive(cynic::QueryFragment, Debug)]
386    #[cynic(graphql_type = "Query", variables = "GetTemplateLanguagesVars")]
387    pub struct GetTemplateLanguages {
388        #[arguments(after: $after, first: $first)]
389        pub get_template_languages: Option<TemplateLanguageConnection>,
390    }
391
392    #[derive(cynic::QueryFragment, Debug)]
393    pub struct TemplateLanguageConnection {
394        pub edges: Vec<Option<TemplateLanguageEdge>>,
395        pub page_info: PageInfo,
396        pub total_count: Option<i32>,
397    }
398
399    #[derive(cynic::QueryFragment, Debug)]
400    pub struct TemplateLanguageEdge {
401        pub cursor: String,
402        pub node: Option<TemplateLanguage>,
403    }
404
405    #[derive(serde::Serialize, cynic::QueryFragment, PartialEq, Eq, Debug)]
406    pub struct TemplateLanguage {
407        #[serde(rename = "createdAt")]
408        pub created_at: DateTime,
409        pub id: cynic::Id,
410        pub name: String,
411        pub slug: String,
412        #[serde(rename = "updatedAt")]
413        pub updated_at: DateTime,
414    }
415
416    #[derive(cynic::Scalar, Debug, Clone, PartialEq, Eq)]
417    #[cynic(graphql_type = "JSONString")]
418    pub struct Jsonstring(pub String);
419
420    #[derive(cynic::QueryVariables, Debug)]
421    pub struct GetPackageReleaseVars {
422        pub hash: String,
423    }
424
425    #[derive(cynic::QueryFragment, Debug)]
426    #[cynic(graphql_type = "Query", variables = "GetPackageReleaseVars")]
427    pub struct GetPackageRelease {
428        #[arguments(hash: $hash)]
429        pub get_package_release: Option<PackageWebc>,
430    }
431
432    #[derive(cynic::QueryVariables, Debug)]
433    pub struct GetPackageVars {
434        pub name: String,
435    }
436
437    #[derive(cynic::QueryFragment, Debug)]
438    #[cynic(graphql_type = "Query", variables = "GetPackageVars")]
439    pub struct GetPackage {
440        #[arguments(name: $name)]
441        pub get_package: Option<Package>,
442    }
443
444    #[derive(cynic::QueryFragment, Debug)]
445    #[cynic(graphql_type = "Query", variables = "GetPackageVars")]
446    pub struct GetPackageVersionNumbers {
447        #[arguments(name: $name)]
448        pub get_package: Option<PackageVersionNumbers>,
449    }
450
451    #[derive(cynic::QueryFragment, Debug)]
452    #[cynic(graphql_type = "Package")]
453    pub struct PackageVersionNumbers {
454        pub versions: Option<Vec<Option<PackageVersionNumber>>>,
455    }
456
457    #[derive(cynic::QueryFragment, Debug)]
458    #[cynic(graphql_type = "PackageVersion")]
459    pub struct PackageVersionNumber {
460        pub version: String,
461    }
462
463    #[derive(cynic::QueryVariables, Debug)]
464    pub struct GetPackageVersionVars {
465        pub name: String,
466        pub version: String,
467    }
468
469    #[derive(cynic::QueryFragment, Debug)]
470    #[cynic(graphql_type = "Query", variables = "GetPackageVersionVars")]
471    pub struct GetPackageVersion {
472        #[arguments(name: $name, version: $version)]
473        pub get_package_version: Option<PackageVersionWithPackage>,
474    }
475
476    #[derive(cynic::Enum, Clone, Copy, Debug)]
477    pub enum PackageVersionSortBy {
478        Newest,
479        Oldest,
480    }
481
482    #[derive(cynic::QueryVariables, Debug)]
483    pub struct PushPackageReleaseVariables<'a> {
484        pub name: Option<&'a str>,
485        pub namespace: &'a str,
486        pub private: Option<bool>,
487        pub signed_url: &'a str,
488    }
489
490    #[derive(cynic::QueryFragment, Debug)]
491    #[cynic(graphql_type = "Mutation", variables = "PushPackageReleaseVariables")]
492    pub struct PushPackageRelease {
493        #[arguments(input: { name: $name, namespace: $namespace, private: $private, signedUrl: $signed_url })]
494        pub push_package_release: Option<PushPackageReleasePayload>,
495    }
496
497    #[derive(cynic::QueryFragment, Debug)]
498    pub struct PushPackageReleasePayload {
499        pub package_webc: Option<PackageWebc>,
500        pub success: bool,
501    }
502
503    #[derive(cynic::QueryVariables, Debug)]
504    pub struct TagPackageReleaseVariables<'a> {
505        pub description: Option<&'a str>,
506        pub homepage: Option<&'a str>,
507        pub license: Option<&'a str>,
508        pub license_file: Option<&'a str>,
509        pub manifest: Option<&'a str>,
510        pub name: &'a str,
511        pub namespace: Option<&'a str>,
512        pub package_release_id: &'a cynic::Id,
513        pub private: Option<bool>,
514        pub readme: Option<&'a str>,
515        pub repository: Option<&'a str>,
516        pub version: &'a str,
517    }
518
519    #[derive(cynic::QueryFragment, Debug)]
520    #[cynic(graphql_type = "Mutation", variables = "TagPackageReleaseVariables")]
521    pub struct TagPackageRelease {
522        #[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 })]
523        pub tag_package_release: Option<TagPackageReleasePayload>,
524    }
525
526    #[derive(cynic::QueryFragment, Debug)]
527    pub struct TagPackageReleasePayload {
528        pub success: bool,
529        pub package_version: Option<PackageVersion>,
530    }
531
532    #[derive(cynic::InputObject, Debug)]
533    pub struct InputSignature<'a> {
534        pub public_key_key_id: &'a str,
535        pub data: &'a str,
536    }
537
538    #[derive(cynic::QueryVariables, Debug, Clone, Default)]
539    pub struct AllPackageVersionsVars {
540        pub offset: Option<i32>,
541        pub before: Option<String>,
542        pub after: Option<String>,
543        pub first: Option<i32>,
544        pub last: Option<i32>,
545
546        pub created_after: Option<DateTime>,
547        pub updated_after: Option<DateTime>,
548        pub sort_by: Option<PackageVersionSortBy>,
549    }
550
551    #[derive(cynic::QueryFragment, Debug)]
552    #[cynic(graphql_type = "Query", variables = "AllPackageVersionsVars")]
553    pub struct GetAllPackageVersions {
554        #[arguments(
555            first: $first,
556            last: $last,
557            after: $after,
558            before: $before,
559            offset: $offset,
560            updatedAfter: $updated_after,
561            createdAfter: $created_after,
562            sortBy: $sort_by,
563        )]
564        pub all_package_versions: PackageVersionConnection,
565    }
566
567    #[derive(cynic::QueryVariables, Debug, Clone, Default)]
568    pub struct AllPackageReleasesVars {
569        pub offset: Option<i32>,
570        pub before: Option<String>,
571        pub after: Option<String>,
572        pub first: Option<i32>,
573        pub last: Option<i32>,
574
575        pub created_after: Option<DateTime>,
576        pub updated_after: Option<DateTime>,
577        pub sort_by: Option<PackageVersionSortBy>,
578    }
579
580    #[derive(cynic::QueryFragment, Debug)]
581    #[cynic(graphql_type = "Query", variables = "AllPackageReleasesVars")]
582    pub struct GetAllPackageReleases {
583        #[arguments(
584            first: $first,
585            last: $last,
586            after: $after,
587            before: $before,
588            offset: $offset,
589            updatedAfter: $updated_after,
590            createdAfter: $created_after,
591            sortBy: $sort_by,
592        )]
593        pub all_package_releases: PackageWebcConnection,
594    }
595
596    impl GetAllPackageReleases {
597        pub fn into_packages(self) -> Vec<PackageWebc> {
598            self.all_package_releases
599                .edges
600                .into_iter()
601                .flatten()
602                .filter_map(|x| x.node)
603                .collect()
604        }
605    }
606
607    #[derive(cynic::QueryVariables, Debug)]
608    pub struct GetSignedUrlForPackageUploadVariables<'a> {
609        pub expires_after_seconds: Option<i32>,
610        pub filename: Option<&'a str>,
611        pub name: Option<&'a str>,
612        pub version: Option<&'a str>,
613        pub method: Option<&'a str>,
614    }
615
616    #[derive(cynic::QueryFragment, Debug)]
617    #[cynic(
618        graphql_type = "Query",
619        variables = "GetSignedUrlForPackageUploadVariables"
620    )]
621    pub struct GetSignedUrlForPackageUpload {
622        #[arguments(name: $name, version: $version, filename: $filename, expiresAfterSeconds: $expires_after_seconds, method: $method)]
623        pub get_signed_url_for_package_upload: Option<SignedUrl>,
624    }
625
626    #[derive(cynic::QueryFragment, Debug)]
627    pub struct SignedUrl {
628        pub url: String,
629    }
630
631    #[derive(cynic::QueryVariables, Debug)]
632    pub struct GenerateUploadUrlVariables<'a> {
633        pub expires_after_seconds: Option<i32>,
634        pub filename: &'a str,
635        pub name: Option<&'a str>,
636        pub version: Option<&'a str>,
637        pub method: Option<&'a str>,
638    }
639
640    #[derive(cynic::QueryFragment, Debug)]
641    #[cynic(graphql_type = "Mutation", variables = "GenerateUploadUrlVariables")]
642    pub struct GenerateUploadUrl {
643        #[arguments(input: { expiresAfterSeconds: $expires_after_seconds, filename: $filename, name: $name, version: $version, method: $method })]
644        pub generate_upload_url: Option<GenerateUploadUrlPayload>,
645    }
646
647    #[derive(cynic::QueryFragment, Debug)]
648    pub struct GenerateUploadUrlPayload {
649        #[cynic(rename = "signedUrl")]
650        pub signed_url: SignedUrl,
651        pub method: String,
652    }
653
654    #[derive(cynic::QueryFragment, Debug)]
655    pub struct PackageWebcConnection {
656        pub page_info: PageInfo,
657        pub edges: Vec<Option<PackageWebcEdge>>,
658    }
659
660    #[derive(cynic::QueryFragment, Debug)]
661    pub struct PackageWebcEdge {
662        pub node: Option<PackageWebc>,
663    }
664
665    #[derive(cynic::QueryFragment, Debug)]
666    pub struct PackageVersionConnection {
667        pub page_info: PageInfo,
668        pub edges: Vec<Option<PackageVersionEdge>>,
669    }
670
671    #[derive(cynic::QueryFragment, Debug)]
672    pub struct PackageVersionEdge {
673        pub node: Option<PackageVersionWithPackage>,
674        pub cursor: String,
675    }
676
677    #[derive(cynic::Enum, Clone, Copy, Debug)]
678    pub enum SearchOrderSort {
679        Asc,
680        Desc,
681    }
682
683    #[derive(cynic::Enum, Clone, Copy, Debug)]
684    pub enum SearchPublishDate {
685        LastDay,
686        LastWeek,
687        LastMonth,
688        LastYear,
689    }
690
691    #[derive(cynic::Enum, Clone, Copy, Debug)]
692    pub enum PackageOrderBy {
693        Alphabetically,
694        Size,
695        TotalDownloads,
696        PublishedDate,
697        CreatedDate,
698        TotalLikes,
699    }
700
701    #[derive(cynic::Enum, Clone, Copy, Debug)]
702    pub enum CountComparison {
703        Equal,
704        GreaterThan,
705        LessThan,
706        GreaterThanOrEqual,
707        LessThanOrEqual,
708    }
709
710    #[derive(cynic::InputObject, Debug, Clone)]
711    pub struct CountFilter {
712        pub count: Option<i32>,
713        pub comparison: Option<CountComparison>,
714    }
715
716    /// Filters for [`search_packages`](crate::query::search_packages).
717    #[derive(cynic::InputObject, Debug, Clone, Default)]
718    pub struct PackagesFilter {
719        pub count: Option<i32>,
720        pub sort_by: Option<SearchOrderSort>,
721        pub curated: Option<bool>,
722        pub publish_date: Option<SearchPublishDate>,
723        pub has_bindings: Option<bool>,
724        pub is_standalone: Option<bool>,
725        pub has_commands: Option<bool>,
726        pub with_interfaces: Option<Vec<Option<String>>>,
727        pub deployable: Option<bool>,
728        pub license: Option<String>,
729        pub created_after: Option<DateTime>,
730        pub created_before: Option<DateTime>,
731        pub last_published_after: Option<DateTime>,
732        pub last_published_before: Option<DateTime>,
733        pub size: Option<CountFilter>,
734        pub downloads: Option<CountFilter>,
735        pub likes: Option<CountFilter>,
736        pub owner: Option<String>,
737        pub published_by: Option<String>,
738        pub order_by: Option<PackageOrderBy>,
739    }
740
741    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
742    #[cynic(graphql_type = "PackageVersion")]
743    pub struct SearchPackageVersion {
744        pub id: cynic::Id,
745        pub version: String,
746        pub created_at: DateTime,
747        pub package: Package,
748    }
749
750    #[derive(cynic::InlineFragments, Debug, Clone)]
751    #[cynic(graphql_type = "SearchResult")]
752    pub enum SearchResult {
753        PackageVersion(Box<SearchPackageVersion>),
754        #[cynic(fallback)]
755        Unknown,
756    }
757
758    impl SearchResult {
759        /// Extract the package version from a search result, if it is one.
760        pub fn into_package_version(self) -> Option<SearchPackageVersion> {
761            match self {
762                SearchResult::PackageVersion(v) => Some(*v),
763                SearchResult::Unknown => None,
764            }
765        }
766    }
767
768    #[derive(cynic::QueryFragment, Debug)]
769    pub struct SearchEdge {
770        pub node: Option<SearchResult>,
771        pub cursor: String,
772    }
773
774    #[derive(cynic::QueryFragment, Debug)]
775    pub struct SearchConnection {
776        pub page_info: PageInfo,
777        pub edges: Vec<Option<SearchEdge>>,
778        pub total_count: Option<i32>,
779    }
780
781    #[derive(cynic::QueryVariables, Debug, Default)]
782    pub struct SearchPackagesVars {
783        pub query: String,
784        pub packages: Option<PackagesFilter>,
785        pub first: Option<i32>,
786        pub after: Option<String>,
787    }
788
789    #[derive(cynic::QueryFragment, Debug)]
790    #[cynic(graphql_type = "Query", variables = "SearchPackagesVars")]
791    pub struct SearchPackages {
792        #[arguments(query: $query, packages: $packages, first: $first, after: $after)]
793        pub search: SearchConnection,
794    }
795
796    #[derive(cynic::QueryVariables, Debug)]
797    pub struct GetPackageAndAppVars {
798        pub package: String,
799        pub app_owner: String,
800        pub app_name: String,
801    }
802
803    #[derive(cynic::QueryFragment, Debug)]
804    #[cynic(graphql_type = "Query", variables = "GetPackageAndAppVars")]
805    pub struct GetPackageAndApp {
806        #[arguments(name: $package)]
807        pub get_package: Option<Package>,
808        #[arguments(owner: $app_owner, name: $app_name)]
809        pub get_deploy_app: Option<DeployApp>,
810    }
811
812    #[derive(cynic::QueryVariables, Debug)]
813    pub struct GetCurrentUserWithAppsVars {
814        pub first: Option<i32>,
815        pub after: Option<String>,
816        pub sort: Option<DeployAppsSortBy>,
817    }
818
819    #[derive(cynic::QueryFragment, Debug)]
820    #[cynic(graphql_type = "Query", variables = "GetCurrentUserWithAppsVars")]
821    pub struct GetCurrentUserWithApps {
822        pub viewer: Option<UserWithApps>,
823    }
824
825    #[derive(cynic::QueryFragment, Debug)]
826    #[cynic(graphql_type = "User")]
827    #[cynic(variables = "GetCurrentUserWithAppsVars")]
828    pub struct UserWithApps {
829        pub id: cynic::Id,
830        pub username: String,
831        #[arguments(after: $after, sortBy: $sort, first: $first)]
832        pub apps: DeployAppConnection,
833    }
834
835    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
836    pub struct Owner {
837        pub global_name: String,
838    }
839
840    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
841    #[cynic(graphql_type = "User", variables = "GetCurrentUserWithNamespacesVars")]
842    pub struct UserWithNamespaces {
843        pub id: cynic::Id,
844        pub username: String,
845        #[arguments(role: $namespace_role)]
846        pub namespaces: NamespaceConnection,
847    }
848
849    #[derive(cynic::QueryVariables, Debug)]
850    pub struct GetUserAppsVars {
851        pub username: String,
852    }
853
854    #[derive(cynic::QueryFragment, Debug)]
855    #[cynic(graphql_type = "Query", variables = "GetUserAppsVars")]
856    pub struct GetUserApps {
857        #[arguments(username: $username)]
858        pub get_user: Option<User>,
859    }
860
861    #[derive(cynic::QueryVariables, Debug)]
862    pub struct GetDeployAppVars {
863        pub name: String,
864        pub owner: String,
865    }
866
867    #[derive(cynic::QueryFragment, Debug)]
868    #[cynic(graphql_type = "Query", variables = "GetDeployAppVars")]
869    pub struct GetDeployApp {
870        #[arguments(owner: $owner, name: $name)]
871        pub get_deploy_app: Option<DeployApp>,
872    }
873
874    #[derive(cynic::QueryFragment, Debug)]
875    #[cynic(graphql_type = "Query", variables = "GetDeployAppVars")]
876    pub struct GetDeployAppS3Credentials {
877        #[arguments(owner: $owner, name: $name)]
878        pub get_deploy_app: Option<AppWithS3Credentials>,
879    }
880
881    #[derive(cynic::QueryFragment, Debug)]
882    #[cynic(graphql_type = "DeployApp", variables = "GetDeployAppVars")]
883    pub struct AppWithS3Credentials {
884        pub s3_credentials: Option<S3Credentials>,
885    }
886
887    #[derive(cynic::QueryFragment, Debug)]
888    pub struct S3Credentials {
889        pub access_key: String,
890        pub secret_key: String,
891        pub endpoint: String,
892    }
893
894    #[derive(cynic::QueryVariables, Debug, Clone)]
895    pub(crate) struct GetDeployAppVolumesVars {
896        pub owner: String,
897        pub name: String,
898        pub after: Option<String>,
899    }
900
901    #[derive(cynic::QueryFragment, Debug)]
902    #[cynic(graphql_type = "Query", variables = "GetDeployAppVolumesVars")]
903    pub(crate) struct GetDeployAppVolumes {
904        #[arguments(owner: $owner, name: $name)]
905        pub get_deploy_app: Option<AppWithVolumes>,
906    }
907
908    #[derive(cynic::QueryFragment, Debug)]
909    #[cynic(graphql_type = "DeployApp", variables = "GetDeployAppVolumesVars")]
910    pub(crate) struct AppWithVolumes {
911        #[arguments(first: 100, after: $after)]
912        pub volumes: AppVolumeConnection,
913    }
914
915    #[derive(cynic::QueryFragment, Debug)]
916    pub(crate) struct AppVolumeConnection {
917        pub page_info: PageInfo,
918        pub edges: Vec<AppVolumeEdge>,
919    }
920
921    #[derive(cynic::QueryFragment, Debug)]
922    pub(crate) struct AppVolumeEdge {
923        pub node: AppVolume,
924    }
925
926    /// A persistent `DeployApp.volumes` node, including its S3 state and (if S3
927    /// is enabled) credentials. `s3` is `None` unless the volume has S3 enabled.
928    #[derive(cynic::QueryFragment, Debug)]
929    pub struct AppVolume {
930        pub id: cynic::Id,
931        pub volume_id: String,
932        pub mount_path: String,
933        pub s3_enabled: bool,
934        pub s3: Option<S3>,
935    }
936
937    #[derive(cynic::QueryFragment, Debug)]
938    pub struct S3 {
939        pub access_key: String,
940        pub secret_key: String,
941        pub endpoint: String,
942    }
943
944    #[derive(cynic::QueryVariables, Debug)]
945    pub struct UpdateVolumeVariables {
946        pub id: cynic::Id,
947        pub s3_enabled: Option<bool>,
948    }
949
950    #[derive(cynic::QueryFragment, Debug)]
951    #[cynic(graphql_type = "Mutation", variables = "UpdateVolumeVariables")]
952    pub struct UpdateVolume {
953        #[arguments(input: { id: $id, s3Enabled: $s3_enabled })]
954        pub update_volume: UpdateVolumePayload,
955    }
956
957    #[derive(cynic::QueryFragment, Debug)]
958    pub struct UpdateVolumePayload {
959        pub success: bool,
960    }
961
962    #[derive(cynic::QueryVariables, Debug)]
963    pub struct RotateS3CredentialsVariables {
964        pub id: cynic::Id,
965    }
966
967    #[derive(cynic::QueryFragment, Debug)]
968    #[cynic(graphql_type = "Mutation", variables = "RotateS3CredentialsVariables")]
969    pub struct RotateS3Credentials {
970        #[arguments(input: { id: $id })]
971        pub rotate_s3_credentials: RotateS3CredentialsPayload,
972    }
973
974    #[derive(cynic::QueryFragment, Debug)]
975    pub struct RotateS3CredentialsPayload {
976        pub access_key: String,
977        pub secret_key: String,
978        pub endpoint: String,
979        pub success: bool,
980    }
981
982    #[derive(cynic::QueryVariables, Debug, Clone)]
983    pub struct PaginationVars {
984        pub offset: Option<i32>,
985        pub before: Option<String>,
986        pub after: Option<String>,
987        pub first: Option<i32>,
988        pub last: Option<i32>,
989    }
990
991    #[derive(cynic::Enum, Clone, Copy, Debug)]
992    pub enum DeployAppsSortBy {
993        Newest,
994        Oldest,
995        MostActive,
996    }
997
998    #[derive(cynic::QueryVariables, Debug, Clone, Default)]
999    pub struct GetDeployAppsVars {
1000        pub offset: Option<i32>,
1001        pub before: Option<String>,
1002        pub after: Option<String>,
1003        pub first: Option<i32>,
1004        pub last: Option<i32>,
1005
1006        pub updated_after: Option<DateTime>,
1007        pub sort_by: Option<DeployAppsSortBy>,
1008    }
1009
1010    #[derive(cynic::QueryFragment, Debug)]
1011    #[cynic(graphql_type = "Query", variables = "GetDeployAppsVars")]
1012    pub struct GetDeployApps {
1013        #[arguments(
1014            first: $first,
1015            last: $last,
1016            after: $after,
1017            before: $before,
1018            offset: $offset,
1019            updatedAfter: $updated_after,
1020            sortBy: $sort_by,
1021        )]
1022        pub get_deploy_apps: Option<DeployAppConnection>,
1023    }
1024
1025    #[derive(cynic::QueryVariables, Debug)]
1026    pub struct GetDeployAppByAliasVars {
1027        pub alias: String,
1028    }
1029
1030    #[derive(cynic::QueryFragment, Debug)]
1031    #[cynic(graphql_type = "Query", variables = "GetDeployAppByAliasVars")]
1032    pub struct GetDeployAppByAlias {
1033        #[arguments(alias: $alias)]
1034        pub get_app_by_global_alias: Option<DeployApp>,
1035    }
1036
1037    #[derive(cynic::QueryVariables, Debug)]
1038    pub struct GetDeployAppAndVersionVars {
1039        pub name: String,
1040        pub owner: String,
1041        pub version: String,
1042    }
1043
1044    #[derive(cynic::QueryFragment, Debug)]
1045    #[cynic(graphql_type = "Query", variables = "GetDeployAppAndVersionVars")]
1046    pub struct GetDeployAppAndVersion {
1047        #[arguments(owner: $owner, name: $name)]
1048        pub get_deploy_app: Option<DeployApp>,
1049        #[arguments(owner: $owner, name: $name, version: $version)]
1050        pub get_deploy_app_version: Option<DeployAppVersion>,
1051    }
1052
1053    #[derive(cynic::QueryVariables, Debug)]
1054    pub struct GetDeployAppVersionVars {
1055        pub name: String,
1056        pub owner: String,
1057        pub version: String,
1058    }
1059
1060    #[derive(cynic::QueryFragment, Debug)]
1061    #[cynic(graphql_type = "Query", variables = "GetDeployAppVersionVars")]
1062    pub struct GetDeployAppVersion {
1063        #[arguments(owner: $owner, name: $name, version: $version)]
1064        pub get_deploy_app_version: Option<DeployAppVersion>,
1065    }
1066
1067    #[derive(cynic::QueryVariables, Debug)]
1068    pub(crate) struct GetAppVolumesVars {
1069        pub name: String,
1070        pub owner: String,
1071    }
1072
1073    #[derive(cynic::QueryFragment, Debug)]
1074    #[cynic(graphql_type = "Query", variables = "GetAppVolumesVars")]
1075    pub(crate) struct GetAppVolumes {
1076        #[arguments(owner: $owner, name: $name)]
1077        pub get_deploy_app: Option<AppVolumes>,
1078    }
1079
1080    #[derive(cynic::QueryFragment, Debug)]
1081    #[cynic(graphql_type = "DeployApp")]
1082    pub(crate) struct AppVolumes {
1083        pub active_version: Option<AppVersionVolumes>,
1084    }
1085
1086    #[derive(cynic::QueryFragment, Debug)]
1087    #[cynic(graphql_type = "DeployAppVersion")]
1088    pub(crate) struct AppVersionVolumes {
1089        pub volumes: Option<Vec<Option<AppVersionVolume>>>,
1090    }
1091
1092    #[derive(serde::Serialize, cynic::QueryFragment, Debug)]
1093    pub struct AppVersionVolume {
1094        pub name: String,
1095        pub size: Option<BigInt>,
1096        pub used_size: Option<BigInt>,
1097        pub mount_paths: Vec<AppVersionVolumeMountPath>,
1098    }
1099
1100    #[derive(serde::Serialize, cynic::QueryFragment, Debug)]
1101    pub struct AppVersionVolumeMountPath {
1102        pub path: String,
1103    }
1104
1105    #[derive(cynic::QueryVariables, Debug)]
1106    pub(crate) struct GetAppDatabasesVars {
1107        pub name: String,
1108        pub owner: String,
1109        pub after: Option<String>,
1110    }
1111
1112    #[derive(cynic::QueryFragment, Debug)]
1113    #[cynic(graphql_type = "Query", variables = "GetAppDatabasesVars")]
1114    pub(crate) struct GetAppDatabases {
1115        #[arguments(owner: $owner, name: $name)]
1116        pub get_deploy_app: Option<AppDatabases>,
1117    }
1118
1119    #[derive(cynic::QueryFragment, Debug)]
1120    pub(crate) struct AppDatabaseConnection {
1121        pub page_info: PageInfo,
1122        pub edges: Vec<Option<AppDatabaseEdge>>,
1123    }
1124
1125    #[derive(cynic::QueryFragment, Debug)]
1126    #[cynic(graphql_type = "DeployApp")]
1127    pub(crate) struct AppDatabases {
1128        pub databases: AppDatabaseConnection,
1129    }
1130
1131    #[derive(cynic::QueryFragment, Debug)]
1132    pub(crate) struct AppDatabaseEdge {
1133        pub node: Option<AppDatabase>,
1134    }
1135
1136    #[derive(serde::Serialize, cynic::QueryFragment, Debug)]
1137    pub struct AppDatabase {
1138        pub id: cynic::Id,
1139        pub name: String,
1140        pub created_at: DateTime,
1141        pub updated_at: DateTime,
1142        pub deleted_at: Option<DateTime>,
1143        pub username: String,
1144        pub db_explorer_url: Option<String>,
1145        pub host: String,
1146        pub port: String,
1147        pub password: Option<String>,
1148    }
1149
1150    #[derive(cynic::QueryFragment, Debug)]
1151    pub struct RegisterDomainPayload {
1152        pub success: bool,
1153        pub domain: Option<DnsDomain>,
1154    }
1155
1156    #[derive(cynic::QueryVariables, Debug)]
1157    pub struct RegisterDomainVars {
1158        pub name: String,
1159        pub namespace: Option<String>,
1160        pub import_records: Option<bool>,
1161    }
1162
1163    #[derive(cynic::QueryFragment, Debug)]
1164    #[cynic(graphql_type = "Mutation", variables = "RegisterDomainVars")]
1165    pub struct RegisterDomain {
1166        #[arguments(input: {name: $name, importRecords: $import_records, namespace: $namespace})]
1167        pub register_domain: Option<RegisterDomainPayload>,
1168    }
1169
1170    #[derive(cynic::QueryVariables, Debug)]
1171    pub struct UpsertDomainFromZoneFileVars {
1172        pub zone_file: String,
1173        pub delete_missing_records: Option<bool>,
1174    }
1175
1176    #[derive(cynic::QueryFragment, Debug)]
1177    #[cynic(graphql_type = "Mutation", variables = "UpsertDomainFromZoneFileVars")]
1178    pub struct UpsertDomainFromZoneFile {
1179        #[arguments(input: {zoneFile: $zone_file, deleteMissingRecords: $delete_missing_records})]
1180        pub upsert_domain_from_zone_file: Option<UpsertDomainFromZoneFilePayload>,
1181    }
1182
1183    #[derive(cynic::QueryFragment, Debug)]
1184    pub struct UpsertDomainFromZoneFilePayload {
1185        pub success: bool,
1186        pub domain: DnsDomain,
1187    }
1188
1189    #[derive(cynic::QueryVariables, Debug)]
1190    pub struct CreateNamespaceVars {
1191        pub input: CreateNamespaceInput,
1192    }
1193
1194    #[derive(cynic::QueryFragment, Debug)]
1195    #[cynic(graphql_type = "Mutation", variables = "CreateNamespaceVars")]
1196    pub struct CreateNamespace {
1197        #[arguments(input: $input)]
1198        pub create_namespace: Option<CreateNamespacePayload>,
1199    }
1200
1201    #[derive(cynic::QueryFragment, Debug)]
1202    pub struct CreateNamespacePayload {
1203        pub namespace: Namespace,
1204    }
1205
1206    #[derive(cynic::InputObject, Debug)]
1207    pub struct CreateNamespaceInput {
1208        pub name: String,
1209        pub display_name: Option<String>,
1210        pub description: Option<String>,
1211        pub avatar: Option<String>,
1212        pub client_mutation_id: Option<String>,
1213    }
1214
1215    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1216    pub struct NamespaceEdge {
1217        pub node: Option<Namespace>,
1218    }
1219
1220    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1221    pub struct NamespaceConnection {
1222        pub edges: Vec<Option<NamespaceEdge>>,
1223    }
1224
1225    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1226    pub struct Namespace {
1227        pub id: cynic::Id,
1228        pub name: String,
1229        pub global_name: String,
1230    }
1231
1232    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1233    pub struct DeployApp {
1234        pub id: cynic::Id,
1235        pub name: String,
1236        pub created_at: DateTime,
1237        pub updated_at: DateTime,
1238        pub description: Option<String>,
1239        pub active_version: Option<DeployAppVersion>,
1240        pub admin_url: String,
1241        pub owner: Owner,
1242        pub url: String,
1243        pub permalink: String,
1244        pub deleted: bool,
1245        pub aliases: AppAliasConnection,
1246        pub s3_url: Option<Url>,
1247        pub will_perish_at: Option<DateTime>,
1248        pub perish_reason: Option<DeployDeployAppPerishReasonChoices>,
1249    }
1250
1251    #[derive(cynic::Enum, Clone, Copy, Debug, PartialEq, Eq)]
1252    pub enum CronJobKind {
1253        #[cynic(rename = "FETCH")]
1254        Fetch,
1255        #[cynic(rename = "EXECUTE")]
1256        Execute,
1257    }
1258
1259    #[derive(cynic::Enum, Clone, Copy, Debug)]
1260    pub enum CronJobSource {
1261        #[cynic(rename = "CONFIG")]
1262        Config,
1263        #[cynic(rename = "API")]
1264        Api,
1265        #[cynic(rename = "PROVISIONED")]
1266        Provisioned,
1267    }
1268
1269    #[derive(cynic::Enum, Clone, Copy, Debug)]
1270    pub enum CronJobInvocationStatus {
1271        #[cynic(rename = "PENDING")]
1272        Pending,
1273        #[cynic(rename = "RUNNING")]
1274        Running,
1275        #[cynic(rename = "SUCCESS")]
1276        Success,
1277        #[cynic(rename = "FAILURE")]
1278        Failure,
1279    }
1280
1281    #[derive(cynic::QueryVariables, Debug, Clone)]
1282    pub struct GetAppCronJobsVars {
1283        pub owner: String,
1284        pub name: String,
1285        pub after: Option<String>,
1286        pub first: Option<i32>,
1287    }
1288
1289    #[derive(cynic::QueryFragment, Debug, Clone)]
1290    #[cynic(graphql_type = "Query", variables = "GetAppCronJobsVars")]
1291    pub struct GetAppCronJobs {
1292        #[arguments(owner: $owner, name: $name)]
1293        pub get_deploy_app: Option<DeployAppCronJobs>,
1294    }
1295
1296    #[derive(cynic::QueryFragment, Debug, Clone)]
1297    #[cynic(graphql_type = "DeployApp", variables = "GetAppCronJobsVars")]
1298    pub struct DeployAppCronJobs {
1299        #[arguments(first: $first, after: $after)]
1300        pub cron_jobs: CronJobConnection,
1301    }
1302
1303    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1304    pub struct CronJobConnection {
1305        pub page_info: PageInfo,
1306        pub edges: Vec<Option<CronJobEdge>>,
1307    }
1308
1309    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1310    pub struct CronJobEdge {
1311        pub cursor: String,
1312        pub node: Option<CronJob>,
1313    }
1314
1315    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1316    pub struct CronJob {
1317        pub id: cynic::Id,
1318        pub name: String,
1319        pub schedule: String,
1320        pub kind: CronJobKind,
1321        pub source: CronJobSource,
1322        pub enabled: bool,
1323        pub is_managed: bool,
1324        pub timeout: Option<String>,
1325        pub max_schedule_drift: Option<String>,
1326        pub max_retries: Option<i32>,
1327        pub created_at: DateTime,
1328        pub updated_at: DateTime,
1329        pub target: CronJobTarget,
1330    }
1331
1332    #[derive(cynic::QueryVariables, Debug, Clone)]
1333    pub struct ToggleCronJobVars {
1334        pub cron_job_id: cynic::Id,
1335        pub enabled: bool,
1336    }
1337
1338    #[derive(cynic::QueryFragment, Debug, Clone)]
1339    #[cynic(graphql_type = "Mutation", variables = "ToggleCronJobVars")]
1340    pub struct ToggleCronJob {
1341        #[arguments(input: { cronJobId: $cron_job_id, enabled: $enabled })]
1342        pub toggle_cron_job: Option<ToggleCronJobPayload>,
1343    }
1344
1345    #[derive(cynic::QueryFragment, Debug, Clone)]
1346    pub struct ToggleCronJobPayload {
1347        pub cron_job: CronJob,
1348    }
1349
1350    #[derive(cynic::InlineFragments, Debug, Clone, Serialize)]
1351    #[cynic(graphql_type = "CronJobTarget")]
1352    pub enum CronJobTarget {
1353        FetchCronJobTarget(FetchCronJobTarget),
1354        ExecuteCronJobTarget(ExecuteCronJobTarget),
1355        #[cynic(fallback)]
1356        Unknown,
1357    }
1358
1359    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1360    pub struct FetchCronJobTarget {
1361        pub body: Option<String>,
1362        pub headers: GenericScalar,
1363        pub method: String,
1364        pub path: String,
1365        pub expect_body_includes: Option<String>,
1366        pub expect_body_regex: Option<String>,
1367        pub expect_status_codes: Option<GenericScalar>,
1368    }
1369
1370    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1371    pub struct ExecuteCronJobTarget {
1372        pub package_name: Option<String>,
1373        pub command: Option<String>,
1374        pub cli_args: GenericScalar,
1375        pub env: GenericScalar,
1376    }
1377
1378    #[derive(cynic::QueryVariables, Debug, Clone)]
1379    pub struct GetCronJobInvocationsVars {
1380        pub owner: String,
1381        pub name: String,
1382        pub cron_after: Option<String>,
1383        pub cron_first: Option<i32>,
1384        pub invocation_start: Option<DateTime>,
1385        pub invocation_end: Option<DateTime>,
1386        pub invocation_after: Option<String>,
1387        pub invocation_first: Option<i32>,
1388    }
1389
1390    #[derive(cynic::QueryVariables, Debug, Clone)]
1391    pub struct GetCronJobInvocationsByIdVars {
1392        pub id: cynic::Id,
1393        pub invocation_start: Option<DateTime>,
1394        pub invocation_end: Option<DateTime>,
1395        pub invocation_after: Option<String>,
1396        pub invocation_first: Option<i32>,
1397    }
1398
1399    #[derive(cynic::QueryVariables, Debug, Clone)]
1400    pub struct GetCronJobInvocationLogsByInvocationIdVars {
1401        pub id: cynic::Id,
1402        pub log_first: Option<i32>,
1403    }
1404
1405    #[derive(cynic::QueryFragment, Debug, Clone)]
1406    #[cynic(graphql_type = "Query", variables = "GetCronJobInvocationsByIdVars")]
1407    pub struct GetCronJobInvocationsById {
1408        #[arguments(id: $id)]
1409        #[cynic(rename = "node")]
1410        pub cron_job: Option<NodeCronJobWithInvocations>,
1411    }
1412
1413    /// Resolve one invocation directly by its own id, without walking the
1414    /// cron job's invocation pages.
1415    #[derive(cynic::QueryFragment, Debug, Clone)]
1416    #[cynic(
1417        graphql_type = "Query",
1418        variables = "GetCronJobInvocationLogsByInvocationIdVars"
1419    )]
1420    pub struct GetCronJobInvocationLogsByInvocationId {
1421        #[arguments(id: $id)]
1422        pub get_cron_job_invocation: Option<CronJobInvocationWithLogsByInvocationId>,
1423    }
1424
1425    #[derive(cynic::InlineFragments, Debug, Clone)]
1426    #[cynic(graphql_type = "Node", variables = "GetCronJobInvocationsByIdVars")]
1427    pub enum NodeCronJobWithInvocations {
1428        CronJob(CronJobWithInvocationsById),
1429        #[cynic(fallback)]
1430        Unknown,
1431    }
1432
1433    impl NodeCronJobWithInvocations {
1434        pub fn into_cron_job(self) -> Option<CronJobWithInvocationsById> {
1435            match self {
1436                Self::CronJob(cron_job) => Some(cron_job),
1437                Self::Unknown => None,
1438            }
1439        }
1440    }
1441
1442    #[derive(cynic::QueryFragment, Debug, Clone)]
1443    #[cynic(graphql_type = "Query", variables = "GetCronJobInvocationsVars")]
1444    pub struct GetCronJobInvocations {
1445        #[arguments(owner: $owner, name: $name)]
1446        pub get_deploy_app: Option<DeployAppCronJobInvocations>,
1447    }
1448
1449    #[derive(cynic::QueryFragment, Debug, Clone)]
1450    #[cynic(graphql_type = "DeployApp", variables = "GetCronJobInvocationsVars")]
1451    pub struct DeployAppCronJobInvocations {
1452        #[arguments(first: $cron_first, after: $cron_after)]
1453        pub cron_jobs: CronJobConnectionForInvocations,
1454    }
1455
1456    #[derive(cynic::QueryFragment, Debug, Clone)]
1457    #[cynic(
1458        graphql_type = "CronJobConnection",
1459        variables = "GetCronJobInvocationsVars"
1460    )]
1461    pub struct CronJobConnectionForInvocations {
1462        pub page_info: PageInfo,
1463        pub nodes: Vec<CronJobWithInvocations>,
1464    }
1465
1466    #[derive(cynic::QueryFragment, Debug, Clone)]
1467    #[cynic(graphql_type = "CronJob", variables = "GetCronJobInvocationsVars")]
1468    pub struct CronJobWithInvocations {
1469        pub id: cynic::Id,
1470        pub name: String,
1471        #[arguments(first: $invocation_first, after: $invocation_after, start: $invocation_start, end: $invocation_end)]
1472        pub invocations: CronJobInvocationConnection,
1473    }
1474
1475    #[derive(cynic::QueryFragment, Debug, Clone)]
1476    #[cynic(graphql_type = "CronJob", variables = "GetCronJobInvocationsByIdVars")]
1477    pub struct CronJobWithInvocationsById {
1478        pub id: cynic::Id,
1479        pub name: String,
1480        #[arguments(first: $invocation_first, after: $invocation_after, start: $invocation_start, end: $invocation_end)]
1481        pub invocations: CronJobInvocationConnection,
1482    }
1483
1484    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1485    pub struct CronJobInvocationConnection {
1486        pub page_info: PageInfo,
1487        pub nodes: Vec<CronJobInvocation>,
1488    }
1489
1490    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1491    pub struct CronJobInvocation {
1492        pub id: cynic::Id,
1493        pub status: Option<CronJobInvocationStatus>,
1494        pub scheduled_at: Option<DateTime>,
1495        pub started_at: Option<DateTime>,
1496        pub finished_at: Option<DateTime>,
1497        pub duration_ms: Option<i32>,
1498        pub retry_attempts: Option<i32>,
1499        pub error_summary: Option<String>,
1500        pub result: Option<CronJobInvocationResult>,
1501    }
1502
1503    #[derive(cynic::QueryFragment, Debug, Clone)]
1504    #[cynic(
1505        graphql_type = "CronJobInvocation",
1506        variables = "GetCronJobInvocationLogsByInvocationIdVars"
1507    )]
1508    pub struct CronJobInvocationWithLogsByInvocationId {
1509        #[arguments(first: $log_first)]
1510        pub logs: CronJobLogConnection,
1511    }
1512
1513    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1514    #[cynic(graphql_type = "LogConnection")]
1515    pub struct CronJobLogConnection {
1516        pub edges: Vec<Option<CronJobLogEdge>>,
1517    }
1518
1519    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1520    #[cynic(graphql_type = "LogEdge")]
1521    pub struct CronJobLogEdge {
1522        pub node: Option<CronJobLog>,
1523    }
1524
1525    #[derive(cynic::QueryFragment, Debug, Clone, Serialize, PartialEq)]
1526    #[cynic(graphql_type = "Log")]
1527    pub struct CronJobLog {
1528        pub message: String,
1529        pub datetime: DateTime,
1530        pub stream: Option<LogStream>,
1531    }
1532
1533    #[derive(cynic::InlineFragments, Debug, Clone, Serialize)]
1534    #[cynic(graphql_type = "CronJobInvocationResult")]
1535    pub enum CronJobInvocationResult {
1536        ExecuteCronJobInvocationResult(ExecuteCronJobInvocationResult),
1537        FetchCronJobInvocationResult(FetchCronJobInvocationResult),
1538        #[cynic(fallback)]
1539        Unknown,
1540    }
1541
1542    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1543    pub struct ExecuteCronJobInvocationResult {
1544        pub exit_code: Option<i32>,
1545        pub instance_id: Option<String>,
1546    }
1547
1548    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1549    pub struct FetchCronJobInvocationResult {
1550        pub status_code: Option<i32>,
1551        pub request_id: Option<String>,
1552    }
1553
1554    #[derive(cynic::Enum, Clone, Copy, Debug)]
1555    pub enum DeployDeployAppPerishReasonChoices {
1556        #[cynic(rename = "USER_PENDING_VERIFICATION")]
1557        UserPendingVerification,
1558        #[cynic(rename = "USER_REQUESTED")]
1559        UserRequested,
1560        #[cynic(rename = "APP_UNCLAIMED")]
1561        AppUnclaimed,
1562        #[cynic(rename = "PLAN_NON_PERSISTENT")]
1563        PlanNonPersistent,
1564    }
1565
1566    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1567    pub struct AppAliasConnection {
1568        pub page_info: PageInfo,
1569        pub edges: Vec<Option<AppAliasEdge>>,
1570    }
1571
1572    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1573    pub struct AppAliasEdge {
1574        pub node: Option<AppAlias>,
1575    }
1576
1577    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1578    pub struct AppAlias {
1579        pub name: String,
1580        pub hostname: String,
1581    }
1582
1583    #[derive(cynic::QueryVariables, Debug, Clone)]
1584    pub struct DeleteAppVars {
1585        pub app_id: cynic::Id,
1586    }
1587
1588    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1589    pub struct DeleteAppPayload {
1590        pub success: bool,
1591    }
1592
1593    #[derive(cynic::QueryFragment, Debug)]
1594    #[cynic(graphql_type = "Mutation", variables = "DeleteAppVars")]
1595    pub struct DeleteApp {
1596        #[arguments(input: { id: $app_id })]
1597        pub delete_app: Option<DeleteAppPayload>,
1598    }
1599
1600    #[derive(cynic::Enum, Clone, Copy, Debug)]
1601    pub enum DeployAppVersionsSortBy {
1602        Newest,
1603        Oldest,
1604    }
1605
1606    #[derive(cynic::QueryVariables, Debug, Clone)]
1607    pub struct GetDeployAppVersionsVars {
1608        pub owner: String,
1609        pub name: String,
1610
1611        pub offset: Option<i32>,
1612        pub before: Option<String>,
1613        pub after: Option<String>,
1614        pub first: Option<i32>,
1615        pub last: Option<i32>,
1616        pub sort_by: Option<DeployAppVersionsSortBy>,
1617    }
1618
1619    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1620    #[cynic(graphql_type = "Query", variables = "GetDeployAppVersionsVars")]
1621    pub struct GetDeployAppVersions {
1622        #[arguments(owner: $owner, name: $name)]
1623        pub get_deploy_app: Option<DeployAppVersions>,
1624    }
1625
1626    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1627    #[cynic(graphql_type = "DeployApp", variables = "GetDeployAppVersionsVars")]
1628    pub struct DeployAppVersions {
1629        #[arguments(
1630            first: $first,
1631            last: $last,
1632            before: $before,
1633            after: $after,
1634            offset: $offset,
1635            sortBy: $sort_by
1636        )]
1637        pub versions: DeployAppVersionConnection,
1638    }
1639
1640    #[derive(cynic::QueryVariables, Debug, Clone)]
1641    pub struct GetDeployAppVersionsByIdVars {
1642        pub id: cynic::Id,
1643
1644        pub offset: Option<i32>,
1645        pub before: Option<String>,
1646        pub after: Option<String>,
1647        pub first: Option<i32>,
1648        pub last: Option<i32>,
1649        pub sort_by: Option<DeployAppVersionsSortBy>,
1650    }
1651
1652    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1653    #[cynic(graphql_type = "DeployApp", variables = "GetDeployAppVersionsByIdVars")]
1654    pub struct DeployAppVersionsById {
1655        #[arguments(
1656            first: $first,
1657            last: $last,
1658            before: $before,
1659            after: $after,
1660            offset: $offset,
1661            sortBy: $sort_by
1662        )]
1663        pub versions: DeployAppVersionConnection,
1664    }
1665
1666    #[derive(cynic::QueryFragment, Debug, Clone)]
1667    #[cynic(graphql_type = "Query", variables = "GetDeployAppVersionsByIdVars")]
1668    pub struct GetDeployAppVersionsById {
1669        #[arguments(id: $id)]
1670        pub node: Option<NodeDeployAppVersions>,
1671    }
1672
1673    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1674    #[cynic(graphql_type = "DeployApp")]
1675    pub struct SparseDeployApp {
1676        pub id: cynic::Id,
1677    }
1678
1679    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1680    pub struct DeployAppVersion {
1681        pub id: cynic::Id,
1682        pub created_at: DateTime,
1683        pub updated_at: DateTime,
1684        pub version: String,
1685        pub description: Option<String>,
1686        pub yaml_config: String,
1687        pub user_yaml_config: String,
1688        pub config: String,
1689        pub json_config: String,
1690        pub url: String,
1691        pub disabled_at: Option<DateTime>,
1692        pub disabled_reason: Option<String>,
1693
1694        pub app: Option<SparseDeployApp>,
1695    }
1696
1697    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1698    pub struct DeployAppVersionConnection {
1699        pub page_info: PageInfo,
1700        pub edges: Vec<Option<DeployAppVersionEdge>>,
1701    }
1702
1703    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1704    pub struct DeployAppVersionEdge {
1705        pub node: Option<DeployAppVersion>,
1706        pub cursor: String,
1707    }
1708
1709    #[derive(cynic::QueryFragment, Debug)]
1710    pub struct DeployAppConnection {
1711        pub page_info: PageInfo,
1712        pub edges: Vec<Option<DeployAppEdge>>,
1713    }
1714
1715    #[derive(cynic::QueryFragment, Debug)]
1716    pub struct DeployAppEdge {
1717        pub node: Option<DeployApp>,
1718        pub cursor: String,
1719    }
1720
1721    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1722    pub struct PageInfo {
1723        pub has_next_page: bool,
1724        pub end_cursor: Option<String>,
1725    }
1726
1727    #[derive(cynic::QueryVariables, Debug)]
1728    pub struct GetNamespaceVars {
1729        pub name: String,
1730    }
1731
1732    #[derive(cynic::QueryFragment, Serialize, Debug, Clone)]
1733    pub struct MarkAppVersionAsActivePayload {
1734        pub app: DeployApp,
1735    }
1736
1737    #[derive(cynic::InputObject, Debug)]
1738    pub struct MarkAppVersionAsActiveInput {
1739        pub app_version: cynic::Id,
1740    }
1741
1742    #[derive(cynic::QueryVariables, Debug)]
1743    pub struct MarkAppVersionAsActiveVars {
1744        pub input: MarkAppVersionAsActiveInput,
1745    }
1746
1747    #[derive(cynic::QueryFragment, Debug)]
1748    #[cynic(graphql_type = "Mutation", variables = "MarkAppVersionAsActiveVars")]
1749    pub struct MarkAppVersionAsActive {
1750        #[arguments(input: $input)]
1751        pub mark_app_version_as_active: Option<MarkAppVersionAsActivePayload>,
1752    }
1753
1754    #[derive(cynic::QueryFragment, Debug)]
1755    #[cynic(graphql_type = "Query", variables = "GetNamespaceVars")]
1756    pub struct GetNamespace {
1757        #[arguments(name: $name)]
1758        pub get_namespace: Option<Namespace>,
1759    }
1760
1761    #[derive(cynic::QueryVariables, Debug)]
1762    pub struct GetNamespaceAppsVars {
1763        pub name: String,
1764        pub after: Option<String>,
1765        pub sort: Option<DeployAppsSortBy>,
1766    }
1767
1768    #[derive(cynic::QueryFragment, Debug)]
1769    #[cynic(graphql_type = "Query", variables = "GetNamespaceAppsVars")]
1770    pub struct GetNamespaceApps {
1771        #[arguments(name: $name)]
1772        pub get_namespace: Option<NamespaceWithApps>,
1773    }
1774
1775    #[derive(cynic::QueryFragment, Debug)]
1776    #[cynic(graphql_type = "Namespace")]
1777    #[cynic(variables = "GetNamespaceAppsVars")]
1778    pub struct NamespaceWithApps {
1779        pub id: cynic::Id,
1780        pub name: String,
1781        #[arguments(after: $after, sortBy: $sort)]
1782        pub apps: DeployAppConnection,
1783    }
1784
1785    #[derive(cynic::QueryVariables, Debug)]
1786    pub struct RedeployActiveAppVariables {
1787        pub id: cynic::Id,
1788    }
1789
1790    #[derive(cynic::QueryFragment, Debug)]
1791    #[cynic(graphql_type = "Mutation", variables = "RedeployActiveAppVariables")]
1792    pub struct RedeployActiveApp {
1793        #[arguments(input: { id: $id })]
1794        pub redeploy_active_version: Option<RedeployActiveVersionPayload>,
1795    }
1796
1797    #[derive(cynic::QueryFragment, Debug)]
1798    pub struct RedeployActiveVersionPayload {
1799        pub app: DeployApp,
1800    }
1801
1802    #[derive(cynic::QueryVariables, Debug)]
1803    pub struct GetAppDeploymentsVariables {
1804        pub after: Option<String>,
1805        pub first: Option<i32>,
1806        pub name: String,
1807        pub offset: Option<i32>,
1808        pub owner: String,
1809    }
1810
1811    #[derive(cynic::QueryFragment, Debug)]
1812    #[cynic(graphql_type = "Query", variables = "GetAppDeploymentsVariables")]
1813    pub struct GetAppDeployments {
1814        #[arguments(owner: $owner, name: $name)]
1815        pub get_deploy_app: Option<DeployAppDeployments>,
1816    }
1817
1818    #[derive(cynic::QueryFragment, Debug)]
1819    #[cynic(graphql_type = "DeployApp", variables = "GetAppDeploymentsVariables")]
1820    pub struct DeployAppDeployments {
1821        // FIXME: add $offset, $after, currently causes an error from the backend
1822        // #[arguments(first: $first, after: $after, offset: $offset)]
1823        pub deployments: Option<DeploymentConnection>,
1824    }
1825
1826    #[derive(cynic::QueryFragment, Debug)]
1827    pub struct DeploymentConnection {
1828        pub page_info: PageInfo,
1829        pub edges: Vec<Option<DeploymentEdge>>,
1830    }
1831
1832    #[derive(cynic::QueryFragment, Debug)]
1833    pub struct DeploymentEdge {
1834        pub node: Option<Deployment>,
1835    }
1836
1837    #[allow(clippy::large_enum_variant)]
1838    #[derive(cynic::InlineFragments, Debug, Clone, Serialize)]
1839    pub enum Deployment {
1840        AutobuildRepository(AutobuildRepository),
1841        NakedDeployment(NakedDeployment),
1842        #[cynic(fallback)]
1843        Other,
1844    }
1845
1846    #[derive(cynic::QueryFragment, serde::Serialize, Debug, Clone)]
1847    pub struct NakedDeployment {
1848        pub id: cynic::Id,
1849        pub created_at: DateTime,
1850        pub updated_at: DateTime,
1851        pub app_version: Option<DeployAppVersion>,
1852    }
1853
1854    #[derive(cynic::QueryFragment, serde::Serialize, Debug, Clone)]
1855    pub struct AutobuildRepository {
1856        pub id: cynic::Id,
1857        pub build_id: Uuid,
1858        pub created_at: DateTime,
1859        pub updated_at: DateTime,
1860        pub status: StatusEnum,
1861        pub log_url: Option<String>,
1862        pub repo_url: String,
1863    }
1864
1865    #[derive(cynic::Enum, Clone, Copy, Debug)]
1866    pub enum StatusEnum {
1867        Success,
1868        Working,
1869        Failed,
1870        Queued,
1871        Timeout,
1872        InternalError,
1873        Cancelled,
1874        Running,
1875    }
1876
1877    impl StatusEnum {
1878        pub fn as_str(&self) -> &'static str {
1879            match self {
1880                Self::Success => "success",
1881                Self::Working => "working",
1882                Self::Failed => "failed",
1883                Self::Queued => "queued",
1884                Self::Timeout => "timeout",
1885                Self::InternalError => "internal_error",
1886                Self::Cancelled => "cancelled",
1887                Self::Running => "running",
1888            }
1889        }
1890    }
1891
1892    #[derive(cynic::QueryVariables, Debug)]
1893    pub struct AutobuildConfigForZipUploadVariables<'a> {
1894        pub upload_url: &'a str,
1895    }
1896
1897    #[derive(cynic::QueryFragment, Debug)]
1898    #[cynic(
1899        graphql_type = "Mutation",
1900        variables = "AutobuildConfigForZipUploadVariables"
1901    )]
1902    pub struct AutobuildConfigForZipUpload {
1903        #[arguments(input: { uploadUrl: $upload_url })]
1904        pub autobuild_config_for_zip_upload: Option<AutobuildConfigForZipUploadPayload>,
1905    }
1906
1907    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1908    pub struct AutobuildConfigForZipUploadPayload {
1909        pub build_config: Option<BuildConfig>,
1910    }
1911
1912    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1913    pub struct BuildConfig {
1914        pub build_cmd: Option<String>,
1915        pub install_cmd: Option<String>,
1916        pub start_cmd: Option<String>,
1917        pub setup_db: bool,
1918        pub preset_name: String,
1919        pub app_name: String,
1920        pub completion_time_in_seconds: i32,
1921        pub branch: Option<String>,
1922    }
1923
1924    #[derive(cynic::InputObject, Debug, Clone)]
1925    pub struct WordpressDeploymentExtraData {
1926        pub site_name: String,
1927        pub admin_username: String,
1928        pub admin_password: String,
1929        pub admin_email: String,
1930        pub language: Option<String>,
1931    }
1932
1933    #[derive(cynic::InputObject, Debug, Clone)]
1934    pub struct AutobuildDeploymentExtraData {
1935        pub wordpress: Option<WordpressDeploymentExtraData>,
1936    }
1937
1938    #[derive(cynic::InputObject, Debug, Clone)]
1939    pub struct JobDefinitionInput {
1940        pub name: Option<String>,
1941        pub package: Option<String>,
1942        pub command: String,
1943        pub cli_args: Option<Vec<Option<String>>>,
1944        pub env: Option<Vec<Option<String>>>,
1945        pub timeout: Option<String>,
1946    }
1947
1948    #[derive(cynic::QueryVariables, Debug, Clone)]
1949    pub struct DeployViaAutobuildVars {
1950        pub repo_url: Option<String>,
1951        pub upload_url: Option<String>,
1952        pub app_name: Option<String>,
1953        pub app_id: Option<cynic::Id>,
1954        pub owner: Option<String>,
1955        pub build_cmd: Option<String>,
1956        pub install_cmd: Option<String>,
1957        pub enable_database: Option<bool>,
1958        pub secrets: Option<Vec<SecretInput>>,
1959        pub extra_data: Option<AutobuildDeploymentExtraData>,
1960        pub params: Option<AutobuildDeploymentExtraData>,
1961        pub managed: Option<bool>,
1962        pub kind: Option<String>,
1963        pub wait_for_screenshot_generation: Option<bool>,
1964        pub region: Option<String>,
1965        pub branch: Option<String>,
1966        pub allow_existing_app: Option<bool>,
1967        pub jobs: Option<Vec<JobDefinitionInput>>,
1968        pub domains: Option<Vec<Option<String>>>,
1969        pub client_mutation_id: Option<String>,
1970    }
1971
1972    #[derive(cynic::QueryFragment, Debug)]
1973    #[cynic(graphql_type = "Mutation", variables = "DeployViaAutobuildVars")]
1974    pub struct DeployViaAutobuild {
1975        #[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 })]
1976        pub deploy_via_autobuild: Option<DeployViaAutobuildPayload>,
1977    }
1978
1979    #[derive(cynic::QueryFragment, Debug)]
1980    pub struct DeployViaAutobuildPayload {
1981        pub success: bool,
1982        pub build_id: Uuid,
1983    }
1984
1985    #[derive(cynic::Scalar, Debug, Clone)]
1986    #[cynic(graphql_type = "UUID")]
1987    pub struct Uuid(pub String);
1988
1989    #[derive(cynic::QueryVariables, Debug)]
1990    pub struct PublishDeployAppVars {
1991        pub config: String,
1992        pub name: cynic::Id,
1993        pub owner: Option<cynic::Id>,
1994        pub make_default: Option<bool>,
1995    }
1996
1997    #[derive(cynic::QueryFragment, Debug)]
1998    #[cynic(graphql_type = "Mutation", variables = "PublishDeployAppVars")]
1999    pub struct PublishDeployApp {
2000        #[arguments(input: { config: { yamlConfig: $config }, name: $name, owner: $owner, makeDefault: $make_default })]
2001        pub publish_deploy_app: Option<PublishDeployAppPayload>,
2002    }
2003
2004    #[derive(cynic::QueryFragment, Debug)]
2005    pub struct PublishDeployAppPayload {
2006        pub deploy_app_version: DeployAppVersion,
2007    }
2008
2009    #[derive(cynic::QueryVariables, Debug)]
2010    pub struct GenerateDeployTokenVars {
2011        pub app_version_id: String,
2012    }
2013
2014    #[derive(cynic::QueryFragment, Debug)]
2015    #[cynic(graphql_type = "Mutation", variables = "GenerateDeployTokenVars")]
2016    pub struct GenerateDeployToken {
2017        #[arguments(input: { deployConfigVersionId: $app_version_id })]
2018        pub generate_deploy_token: Option<GenerateDeployTokenPayload>,
2019    }
2020
2021    #[derive(cynic::QueryFragment, Debug)]
2022    pub struct GenerateDeployTokenPayload {
2023        pub token: String,
2024    }
2025
2026    #[derive(cynic::Enum, Clone, Copy, Debug, PartialEq)]
2027    pub enum LogStream {
2028        Stdout,
2029        Stderr,
2030        Runtime,
2031    }
2032
2033    #[derive(cynic::QueryVariables, Debug, Clone)]
2034    pub struct GetDeployAppLogsVars {
2035        pub name: String,
2036        pub owner: String,
2037        /// The tag associated with a particular app version. Uses the active
2038        /// version if not provided.
2039        pub version: Option<String>,
2040        /// The lower bound for log messages, in nanoseconds since the Unix
2041        /// epoch.
2042        pub starting_from: f64,
2043        /// The upper bound for log messages, in nanoseconds since the Unix
2044        /// epoch.
2045        pub until: Option<f64>,
2046        pub first: Option<i32>,
2047
2048        pub request_id: Option<String>,
2049
2050        pub instance_ids: Option<Vec<String>>,
2051
2052        pub streams: Option<Vec<LogStream>>,
2053    }
2054
2055    #[derive(cynic::QueryFragment, Debug)]
2056    #[cynic(graphql_type = "Query", variables = "GetDeployAppLogsVars")]
2057    pub struct GetDeployAppLogs {
2058        #[arguments(name: $name, owner: $owner, version: $version)]
2059        pub get_deploy_app_version: Option<DeployAppVersionLogs>,
2060    }
2061
2062    #[derive(cynic::QueryFragment, Debug)]
2063    #[cynic(graphql_type = "DeployAppVersion", variables = "GetDeployAppLogsVars")]
2064    pub struct DeployAppVersionLogs {
2065        #[arguments(startingFrom: $starting_from, until: $until, first: $first, instanceIds: $instance_ids, requestId: $request_id, streams: $streams)]
2066        pub logs: LogConnection,
2067    }
2068
2069    #[derive(cynic::QueryFragment, Debug, Clone)]
2070    pub struct LogConnection {
2071        pub edges: Vec<Option<LogEdge>>,
2072    }
2073
2074    #[derive(cynic::QueryFragment, Debug, Clone)]
2075    pub struct LogEdge {
2076        pub node: Option<Log>,
2077    }
2078
2079    #[derive(cynic::QueryFragment, Debug, Clone, serde::Serialize, PartialEq)]
2080    pub struct Log {
2081        pub message: String,
2082        /// When the message was recorded, in nanoseconds since the Unix epoch.
2083        pub timestamp: f64,
2084        pub stream: Option<LogStream>,
2085        pub instance_id: String,
2086    }
2087
2088    #[derive(cynic::Enum, Clone, Copy, Debug, PartialEq, Eq)]
2089    pub enum AutoBuildDeployAppLogKind {
2090        Log,
2091        PreparingToDeployStatus,
2092        FetchingPlanStatus,
2093        BuildStatus,
2094        DeployStatus,
2095        Complete,
2096        Failed,
2097    }
2098
2099    #[derive(cynic::QueryVariables, Debug)]
2100    pub struct AutobuildDeploymentSubscriptionVariables {
2101        pub build_id: Uuid,
2102    }
2103
2104    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2105    #[cynic(
2106        graphql_type = "Subscription",
2107        variables = "AutobuildDeploymentSubscriptionVariables"
2108    )]
2109    pub struct AutobuildDeploymentSubscription {
2110        #[arguments(buildId: $build_id)]
2111        pub autobuild_deployment: Option<AutobuildLog>,
2112    }
2113
2114    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2115    pub struct AutobuildLog {
2116        pub kind: AutoBuildDeployAppLogKind,
2117        pub message: Option<String>,
2118        pub app_version: Option<DeployAppVersion>,
2119        pub timestamp: String,
2120        pub datetime: DateTime,
2121        pub stream: Option<LogStream>,
2122    }
2123
2124    #[derive(cynic::QueryVariables, Debug)]
2125    pub struct GenerateDeployConfigTokenVars {
2126        pub input: String,
2127    }
2128    #[derive(cynic::QueryFragment, Debug)]
2129    #[cynic(graphql_type = "Mutation", variables = "GenerateDeployConfigTokenVars")]
2130    pub struct GenerateDeployConfigToken {
2131        #[arguments(input: { config: $input })]
2132        pub generate_deploy_config_token: Option<GenerateDeployConfigTokenPayload>,
2133    }
2134
2135    #[derive(cynic::QueryFragment, Debug)]
2136    pub struct GenerateDeployConfigTokenPayload {
2137        pub token: String,
2138    }
2139
2140    #[derive(cynic::QueryVariables, Debug)]
2141    pub struct GenerateSshTokenVariables {
2142        pub app_id: Option<cynic::Id>,
2143    }
2144
2145    #[derive(cynic::QueryFragment, Debug)]
2146    #[cynic(graphql_type = "Mutation", variables = "GenerateSshTokenVariables")]
2147    pub struct GenerateSshToken {
2148        #[arguments(input: { appId: $app_id })]
2149        pub generate_ssh_token: Option<GenerateSshTokenPayload>,
2150    }
2151
2152    #[derive(cynic::QueryFragment, Debug)]
2153    pub struct GenerateSshTokenPayload {
2154        pub token: String,
2155    }
2156
2157    #[derive(cynic::QueryVariables, Debug)]
2158    pub struct GetNodeVars {
2159        pub id: cynic::Id,
2160    }
2161
2162    #[derive(cynic::QueryFragment, Debug)]
2163    #[cynic(graphql_type = "Query", variables = "GetNodeVars")]
2164    pub struct GetNode {
2165        #[arguments(id: $id)]
2166        pub node: Option<Node>,
2167    }
2168
2169    #[derive(cynic::QueryVariables, Debug, Clone)]
2170    pub struct GetCronJobByIdVars {
2171        pub id: cynic::Id,
2172    }
2173
2174    #[derive(cynic::QueryFragment, Debug, Clone)]
2175    #[cynic(graphql_type = "Query", variables = "GetCronJobByIdVars")]
2176    pub struct GetCronJobById {
2177        #[arguments(id: $id)]
2178        #[cynic(rename = "node")]
2179        pub cron_job: Option<NodeCronJob>,
2180    }
2181
2182    #[derive(cynic::InlineFragments, Debug, Clone)]
2183    #[cynic(graphql_type = "Node")]
2184    pub enum NodeCronJob {
2185        CronJob(Box<CronJob>),
2186        #[cynic(fallback)]
2187        Unknown,
2188    }
2189
2190    impl NodeCronJob {
2191        pub fn into_cron_job(self) -> Option<CronJob> {
2192            match self {
2193                Self::CronJob(cron_job) => Some(*cron_job),
2194                Self::Unknown => None,
2195            }
2196        }
2197    }
2198
2199    #[derive(cynic::QueryVariables, Debug)]
2200    pub struct GetDeployAppByIdVars {
2201        pub app_id: cynic::Id,
2202    }
2203
2204    #[derive(cynic::QueryFragment, Debug)]
2205    #[cynic(graphql_type = "Query", variables = "GetDeployAppByIdVars")]
2206    pub struct GetDeployAppById {
2207        #[arguments(id: $app_id)]
2208        #[cynic(rename = "node")]
2209        pub app: Option<Node>,
2210    }
2211
2212    #[derive(cynic::QueryVariables, Debug)]
2213    pub struct GetDeployAppAndVersionByIdVars {
2214        pub app_id: cynic::Id,
2215        pub version_id: cynic::Id,
2216    }
2217
2218    #[derive(cynic::QueryFragment, Debug)]
2219    #[cynic(graphql_type = "Query", variables = "GetDeployAppAndVersionByIdVars")]
2220    pub struct GetDeployAppAndVersionById {
2221        #[arguments(id: $app_id)]
2222        #[cynic(rename = "node")]
2223        pub app: Option<Node>,
2224        #[arguments(id: $version_id)]
2225        #[cynic(rename = "node")]
2226        pub version: Option<Node>,
2227    }
2228
2229    #[derive(cynic::QueryVariables, Debug)]
2230    pub struct GetDeployAppVersionByIdVars {
2231        pub version_id: cynic::Id,
2232    }
2233
2234    #[derive(cynic::QueryFragment, Debug)]
2235    #[cynic(graphql_type = "Query", variables = "GetDeployAppVersionByIdVars")]
2236    pub struct GetDeployAppVersionById {
2237        #[arguments(id: $version_id)]
2238        #[cynic(rename = "node")]
2239        pub version: Option<Node>,
2240    }
2241
2242    #[derive(cynic::QueryVariables, Debug)]
2243    pub struct DeleteAppSecretVariables {
2244        pub id: cynic::Id,
2245    }
2246
2247    #[derive(cynic::QueryFragment, Debug)]
2248    #[cynic(graphql_type = "Mutation", variables = "DeleteAppSecretVariables")]
2249    pub struct DeleteAppSecret {
2250        #[arguments(input: { id: $id })]
2251        pub delete_app_secret: Option<DeleteAppSecretPayload>,
2252    }
2253
2254    #[derive(cynic::QueryFragment, Debug)]
2255    pub struct DeleteAppSecretPayload {
2256        pub success: bool,
2257    }
2258    #[derive(cynic::QueryVariables, Debug, Clone)]
2259    pub struct GetAllAppSecretsVariables {
2260        pub after: Option<String>,
2261        pub app_id: cynic::Id,
2262        pub before: Option<String>,
2263        pub first: Option<i32>,
2264        pub last: Option<i32>,
2265        pub offset: Option<i32>,
2266        pub names: Option<Vec<String>>,
2267    }
2268
2269    #[derive(cynic::QueryFragment, Debug)]
2270    #[cynic(graphql_type = "Query", variables = "GetAllAppSecretsVariables")]
2271    pub struct GetAllAppSecrets {
2272        #[arguments(appId: $app_id, after: $after, before: $before, first: $first, last: $last, offset: $offset, names: $names)]
2273        pub get_app_secrets: Option<SecretConnection>,
2274    }
2275
2276    #[derive(cynic::QueryFragment, Debug)]
2277    pub struct SecretConnection {
2278        pub edges: Vec<Option<SecretEdge>>,
2279        pub page_info: PageInfo,
2280        pub total_count: Option<i32>,
2281    }
2282
2283    #[derive(cynic::QueryFragment, Debug)]
2284    pub struct SecretEdge {
2285        pub cursor: String,
2286        pub node: Option<Secret>,
2287    }
2288
2289    #[derive(cynic::QueryVariables, Debug)]
2290    pub struct GetAppSecretVariables {
2291        pub app_id: cynic::Id,
2292        pub secret_name: String,
2293    }
2294
2295    #[derive(cynic::QueryFragment, Debug)]
2296    #[cynic(graphql_type = "Query", variables = "GetAppSecretVariables")]
2297    pub struct GetAppSecret {
2298        #[arguments(appId: $app_id, secretName: $secret_name)]
2299        pub get_app_secret: Option<Secret>,
2300    }
2301
2302    #[derive(cynic::QueryVariables, Debug)]
2303    pub struct GetAppSecretValueVariables {
2304        pub id: cynic::Id,
2305    }
2306
2307    #[derive(cynic::QueryFragment, Debug)]
2308    #[cynic(graphql_type = "Query", variables = "GetAppSecretValueVariables")]
2309    pub struct GetAppSecretValue {
2310        #[arguments(id: $id)]
2311        pub get_secret_value: Option<String>,
2312    }
2313
2314    #[derive(cynic::QueryVariables, Debug)]
2315    pub struct UpsertAppSecretVariables<'a> {
2316        pub app_id: cynic::Id,
2317        pub name: &'a str,
2318        pub value: &'a str,
2319    }
2320
2321    #[derive(cynic::QueryFragment, Debug)]
2322    #[cynic(graphql_type = "Mutation", variables = "UpsertAppSecretVariables")]
2323    pub struct UpsertAppSecret {
2324        #[arguments(input: { appId: $app_id, name: $name, value: $value })]
2325        pub upsert_app_secret: Option<UpsertAppSecretPayload>,
2326    }
2327
2328    #[derive(cynic::QueryFragment, Debug)]
2329    pub struct UpsertAppSecretPayload {
2330        pub secret: Secret,
2331        pub success: bool,
2332    }
2333
2334    #[derive(cynic::QueryVariables, Debug)]
2335    pub struct UpsertAppSecretsVariables {
2336        pub app_id: cynic::Id,
2337        pub secrets: Option<Vec<SecretInput>>,
2338    }
2339
2340    #[derive(cynic::QueryFragment, Debug)]
2341    #[cynic(graphql_type = "Mutation", variables = "UpsertAppSecretsVariables")]
2342    pub struct UpsertAppSecrets {
2343        #[arguments(input: { appId: $app_id, secrets: $secrets })]
2344        pub upsert_app_secrets: Option<UpsertAppSecretsPayload>,
2345    }
2346
2347    #[derive(cynic::QueryFragment, Debug)]
2348    pub struct UpsertAppSecretsPayload {
2349        pub secrets: Vec<Option<Secret>>,
2350        pub success: bool,
2351    }
2352
2353    #[derive(cynic::InputObject, Debug, Clone)]
2354    pub struct SecretInput {
2355        pub name: String,
2356        pub value: String,
2357    }
2358    #[derive(cynic::QueryFragment, Debug, Serialize)]
2359    pub struct Secret {
2360        #[serde(skip_serializing)]
2361        pub id: cynic::Id,
2362        pub name: String,
2363        pub created_at: DateTime,
2364        pub updated_at: DateTime,
2365    }
2366
2367    #[derive(cynic::QueryVariables, Debug, Clone)]
2368    pub struct GetAllAppRegionsVariables {
2369        pub after: Option<String>,
2370        pub before: Option<String>,
2371        pub first: Option<i32>,
2372        pub last: Option<i32>,
2373        pub offset: Option<i32>,
2374    }
2375
2376    #[derive(cynic::QueryFragment, Debug)]
2377    #[cynic(graphql_type = "Query", variables = "GetAllAppRegionsVariables")]
2378    pub struct GetAllAppRegions {
2379        #[arguments(after: $after, offset: $offset, before: $before, first: $first, last: $last)]
2380        pub get_app_regions: AppRegionConnection,
2381    }
2382
2383    #[derive(cynic::QueryFragment, Debug)]
2384    pub struct AppRegionConnection {
2385        pub edges: Vec<Option<AppRegionEdge>>,
2386        pub page_info: PageInfo,
2387        pub total_count: Option<i32>,
2388    }
2389
2390    #[derive(cynic::QueryFragment, Debug)]
2391    pub struct AppRegionEdge {
2392        pub cursor: String,
2393        pub node: Option<AppRegion>,
2394    }
2395
2396    #[derive(cynic::QueryFragment, Debug, Serialize)]
2397    pub struct AppRegion {
2398        pub city: String,
2399        pub country: String,
2400        pub id: cynic::Id,
2401        pub name: String,
2402    }
2403
2404    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2405    #[cynic(graphql_type = "TXTRecord")]
2406    pub struct TxtRecord {
2407        pub id: cynic::Id,
2408        pub created_at: DateTime,
2409        pub updated_at: DateTime,
2410        pub deleted_at: Option<DateTime>,
2411        pub name: Option<String>,
2412        pub text: String,
2413        pub ttl: Option<i32>,
2414        pub data: String,
2415
2416        pub domain: DnsDomain,
2417    }
2418
2419    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2420    #[cynic(graphql_type = "SSHFPRecord")]
2421    pub struct SshfpRecord {
2422        pub id: cynic::Id,
2423        pub created_at: DateTime,
2424        pub updated_at: DateTime,
2425        pub deleted_at: Option<DateTime>,
2426        pub name: Option<String>,
2427        pub text: String,
2428        pub ttl: Option<i32>,
2429        #[cynic(rename = "type")]
2430        pub type_: DnsmanagerSshFingerprintRecordTypeChoices,
2431        pub algorithm: DnsmanagerSshFingerprintRecordAlgorithmChoices,
2432        pub fingerprint: String,
2433
2434        pub domain: DnsDomain,
2435    }
2436
2437    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2438    #[cynic(graphql_type = "SRVRecord")]
2439    pub struct SrvRecord {
2440        pub id: cynic::Id,
2441        pub created_at: DateTime,
2442        pub updated_at: DateTime,
2443        pub deleted_at: Option<DateTime>,
2444        pub name: Option<String>,
2445        pub text: String,
2446        pub ttl: Option<i32>,
2447        pub service: String,
2448        pub protocol: String,
2449        pub priority: i32,
2450        pub weight: i32,
2451        pub port: i32,
2452        pub target: String,
2453
2454        pub domain: DnsDomain,
2455    }
2456
2457    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2458    #[cynic(graphql_type = "SOARecord")]
2459    pub struct SoaRecord {
2460        pub id: cynic::Id,
2461        pub created_at: DateTime,
2462        pub updated_at: DateTime,
2463        pub deleted_at: Option<DateTime>,
2464        pub name: Option<String>,
2465        pub text: String,
2466        pub ttl: Option<i32>,
2467        pub mname: String,
2468        pub rname: String,
2469        pub serial: BigInt,
2470        pub refresh: BigInt,
2471        pub retry: BigInt,
2472        pub expire: BigInt,
2473        pub minimum: BigInt,
2474
2475        pub domain: DnsDomain,
2476    }
2477
2478    #[derive(cynic::Enum, Debug, Clone, Copy)]
2479    pub enum DNSRecordsSortBy {
2480        Newest,
2481        Oldest,
2482    }
2483
2484    #[derive(cynic::QueryVariables, Debug, Clone)]
2485    pub struct GetAllDnsRecordsVariables {
2486        pub after: Option<String>,
2487        pub updated_after: Option<DateTime>,
2488        pub sort_by: Option<DNSRecordsSortBy>,
2489        pub first: Option<i32>,
2490    }
2491
2492    #[derive(cynic::QueryFragment, Debug)]
2493    #[cynic(graphql_type = "Query", variables = "GetAllDnsRecordsVariables")]
2494    pub struct GetAllDnsRecords {
2495        #[arguments(
2496            first: $first,
2497            after: $after,
2498            updatedAfter: $updated_after,
2499            sortBy: $sort_by
2500        )]
2501        #[cynic(rename = "getAllDNSRecords")]
2502        pub get_all_dnsrecords: DnsRecordConnection,
2503    }
2504
2505    #[derive(cynic::QueryVariables, Debug, Clone)]
2506    pub struct GetAllDomainsVariables {
2507        pub after: Option<String>,
2508        pub first: Option<i32>,
2509        pub namespace: Option<String>,
2510    }
2511
2512    #[derive(cynic::QueryFragment, Debug)]
2513    #[cynic(graphql_type = "Query", variables = "GetAllDomainsVariables")]
2514    pub struct GetAllDomains {
2515        #[arguments(
2516            first: $first,
2517            after: $after,
2518            namespace: $namespace,
2519        )]
2520        #[cynic(rename = "getAllDomains")]
2521        pub get_all_domains: DnsDomainConnection,
2522    }
2523
2524    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2525    #[cynic(graphql_type = "PTRRecord")]
2526    pub struct PtrRecord {
2527        pub id: cynic::Id,
2528        pub created_at: DateTime,
2529        pub updated_at: DateTime,
2530        pub deleted_at: Option<DateTime>,
2531        pub name: Option<String>,
2532        pub text: String,
2533        pub ttl: Option<i32>,
2534        pub ptrdname: String,
2535
2536        pub domain: DnsDomain,
2537    }
2538
2539    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2540    #[cynic(graphql_type = "NSRecord")]
2541    pub struct NsRecord {
2542        pub id: cynic::Id,
2543        pub created_at: DateTime,
2544        pub updated_at: DateTime,
2545        pub deleted_at: Option<DateTime>,
2546        pub name: Option<String>,
2547        pub text: String,
2548        pub ttl: Option<i32>,
2549        pub nsdname: String,
2550
2551        pub domain: DnsDomain,
2552    }
2553
2554    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2555    #[cynic(graphql_type = "MXRecord")]
2556    pub struct MxRecord {
2557        pub id: cynic::Id,
2558        pub created_at: DateTime,
2559        pub updated_at: DateTime,
2560        pub deleted_at: Option<DateTime>,
2561        pub name: Option<String>,
2562        pub text: String,
2563        pub ttl: Option<i32>,
2564        pub preference: i32,
2565        pub exchange: String,
2566
2567        pub domain: DnsDomain,
2568    }
2569
2570    #[derive(cynic::QueryFragment, Debug)]
2571    #[cynic(graphql_type = "DNSRecordConnection")]
2572    pub struct DnsRecordConnection {
2573        pub page_info: PageInfo,
2574        pub edges: Vec<Option<DnsRecordEdge>>,
2575    }
2576
2577    #[derive(cynic::QueryFragment, Debug)]
2578    #[cynic(graphql_type = "DNSRecordEdge")]
2579    pub struct DnsRecordEdge {
2580        pub node: Option<DnsRecord>,
2581    }
2582
2583    #[derive(cynic::QueryFragment, Debug)]
2584    #[cynic(graphql_type = "DNSDomainConnection")]
2585    pub struct DnsDomainConnection {
2586        pub page_info: PageInfo,
2587        pub edges: Vec<Option<DnsDomainEdge>>,
2588    }
2589
2590    #[derive(cynic::QueryFragment, Debug)]
2591    #[cynic(graphql_type = "DNSDomainEdge")]
2592    pub struct DnsDomainEdge {
2593        pub node: Option<DnsDomain>,
2594    }
2595
2596    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2597    #[cynic(graphql_type = "DNAMERecord")]
2598    pub struct DNameRecord {
2599        pub id: cynic::Id,
2600        pub created_at: DateTime,
2601        pub updated_at: DateTime,
2602        pub deleted_at: Option<DateTime>,
2603        pub name: Option<String>,
2604        pub text: String,
2605        pub ttl: Option<i32>,
2606        pub d_name: String,
2607
2608        pub domain: DnsDomain,
2609    }
2610
2611    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2612    #[cynic(graphql_type = "CNAMERecord")]
2613    pub struct CNameRecord {
2614        pub id: cynic::Id,
2615        pub created_at: DateTime,
2616        pub updated_at: DateTime,
2617        pub deleted_at: Option<DateTime>,
2618        pub name: Option<String>,
2619        pub text: String,
2620        pub ttl: Option<i32>,
2621        pub c_name: String,
2622
2623        pub domain: DnsDomain,
2624    }
2625
2626    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2627    #[cynic(graphql_type = "CAARecord")]
2628    pub struct CaaRecord {
2629        pub id: cynic::Id,
2630        pub created_at: DateTime,
2631        pub updated_at: DateTime,
2632        pub deleted_at: Option<DateTime>,
2633        pub name: Option<String>,
2634        pub text: String,
2635        pub ttl: Option<i32>,
2636        pub value: String,
2637        pub flags: i32,
2638        pub tag: DnsmanagerCertificationAuthorityAuthorizationRecordTagChoices,
2639
2640        pub domain: DnsDomain,
2641    }
2642
2643    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2644    #[cynic(graphql_type = "ARecord")]
2645    pub struct ARecord {
2646        pub id: cynic::Id,
2647        pub created_at: DateTime,
2648        pub updated_at: DateTime,
2649        pub deleted_at: Option<DateTime>,
2650        pub name: Option<String>,
2651        pub text: String,
2652        pub ttl: Option<i32>,
2653        pub address: String,
2654        pub domain: DnsDomain,
2655    }
2656
2657    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2658    #[cynic(graphql_type = "AAAARecord")]
2659    pub struct AaaaRecord {
2660        pub id: cynic::Id,
2661        pub created_at: DateTime,
2662        pub updated_at: DateTime,
2663        pub deleted_at: Option<DateTime>,
2664        pub name: Option<String>,
2665        pub text: String,
2666        pub ttl: Option<i32>,
2667        pub address: String,
2668        pub domain: DnsDomain,
2669    }
2670
2671    #[derive(cynic::InlineFragments, Debug, Clone, Serialize)]
2672    #[cynic(graphql_type = "DNSRecord")]
2673    pub enum DnsRecord {
2674        A(ARecord),
2675        AAAA(AaaaRecord),
2676        CName(CNameRecord),
2677        Txt(TxtRecord),
2678        Mx(MxRecord),
2679        Ns(NsRecord),
2680        CAA(CaaRecord),
2681        DName(DNameRecord),
2682        Ptr(PtrRecord),
2683        Soa(SoaRecord),
2684        Srv(SrvRecord),
2685        Sshfp(SshfpRecord),
2686        #[cynic(fallback)]
2687        Unknown,
2688    }
2689
2690    impl DnsRecord {
2691        pub fn id(&self) -> &str {
2692            match self {
2693                DnsRecord::A(record) => record.id.inner(),
2694                DnsRecord::AAAA(record) => record.id.inner(),
2695                DnsRecord::CName(record) => record.id.inner(),
2696                DnsRecord::Txt(record) => record.id.inner(),
2697                DnsRecord::Mx(record) => record.id.inner(),
2698                DnsRecord::Ns(record) => record.id.inner(),
2699                DnsRecord::CAA(record) => record.id.inner(),
2700                DnsRecord::DName(record) => record.id.inner(),
2701                DnsRecord::Ptr(record) => record.id.inner(),
2702                DnsRecord::Soa(record) => record.id.inner(),
2703                DnsRecord::Srv(record) => record.id.inner(),
2704                DnsRecord::Sshfp(record) => record.id.inner(),
2705                DnsRecord::Unknown => "",
2706            }
2707        }
2708        pub fn name(&self) -> Option<&str> {
2709            match self {
2710                DnsRecord::A(record) => record.name.as_deref(),
2711                DnsRecord::AAAA(record) => record.name.as_deref(),
2712                DnsRecord::CName(record) => record.name.as_deref(),
2713                DnsRecord::Txt(record) => record.name.as_deref(),
2714                DnsRecord::Mx(record) => record.name.as_deref(),
2715                DnsRecord::Ns(record) => record.name.as_deref(),
2716                DnsRecord::CAA(record) => record.name.as_deref(),
2717                DnsRecord::DName(record) => record.name.as_deref(),
2718                DnsRecord::Ptr(record) => record.name.as_deref(),
2719                DnsRecord::Soa(record) => record.name.as_deref(),
2720                DnsRecord::Srv(record) => record.name.as_deref(),
2721                DnsRecord::Sshfp(record) => record.name.as_deref(),
2722                DnsRecord::Unknown => None,
2723            }
2724        }
2725        pub fn ttl(&self) -> Option<i32> {
2726            match self {
2727                DnsRecord::A(record) => record.ttl,
2728                DnsRecord::AAAA(record) => record.ttl,
2729                DnsRecord::CName(record) => record.ttl,
2730                DnsRecord::Txt(record) => record.ttl,
2731                DnsRecord::Mx(record) => record.ttl,
2732                DnsRecord::Ns(record) => record.ttl,
2733                DnsRecord::CAA(record) => record.ttl,
2734                DnsRecord::DName(record) => record.ttl,
2735                DnsRecord::Ptr(record) => record.ttl,
2736                DnsRecord::Soa(record) => record.ttl,
2737                DnsRecord::Srv(record) => record.ttl,
2738                DnsRecord::Sshfp(record) => record.ttl,
2739                DnsRecord::Unknown => None,
2740            }
2741        }
2742
2743        pub fn text(&self) -> &str {
2744            match self {
2745                DnsRecord::A(record) => record.text.as_str(),
2746                DnsRecord::AAAA(record) => record.text.as_str(),
2747                DnsRecord::CName(record) => record.text.as_str(),
2748                DnsRecord::Txt(record) => record.text.as_str(),
2749                DnsRecord::Mx(record) => record.text.as_str(),
2750                DnsRecord::Ns(record) => record.text.as_str(),
2751                DnsRecord::CAA(record) => record.text.as_str(),
2752                DnsRecord::DName(record) => record.text.as_str(),
2753                DnsRecord::Ptr(record) => record.text.as_str(),
2754                DnsRecord::Soa(record) => record.text.as_str(),
2755                DnsRecord::Srv(record) => record.text.as_str(),
2756                DnsRecord::Sshfp(record) => record.text.as_str(),
2757                DnsRecord::Unknown => "",
2758            }
2759        }
2760        pub fn record_type(&self) -> &str {
2761            match self {
2762                DnsRecord::A(_) => "A",
2763                DnsRecord::AAAA(_) => "AAAA",
2764                DnsRecord::CName(_) => "CNAME",
2765                DnsRecord::Txt(_) => "TXT",
2766                DnsRecord::Mx(_) => "MX",
2767                DnsRecord::Ns(_) => "NS",
2768                DnsRecord::CAA(_) => "CAA",
2769                DnsRecord::DName(_) => "DNAME",
2770                DnsRecord::Ptr(_) => "PTR",
2771                DnsRecord::Soa(_) => "SOA",
2772                DnsRecord::Srv(_) => "SRV",
2773                DnsRecord::Sshfp(_) => "SSHFP",
2774                DnsRecord::Unknown => "",
2775            }
2776        }
2777
2778        pub fn domain(&self) -> Option<&DnsDomain> {
2779            match self {
2780                DnsRecord::A(record) => Some(&record.domain),
2781                DnsRecord::AAAA(record) => Some(&record.domain),
2782                DnsRecord::CName(record) => Some(&record.domain),
2783                DnsRecord::Txt(record) => Some(&record.domain),
2784                DnsRecord::Mx(record) => Some(&record.domain),
2785                DnsRecord::Ns(record) => Some(&record.domain),
2786                DnsRecord::CAA(record) => Some(&record.domain),
2787                DnsRecord::DName(record) => Some(&record.domain),
2788                DnsRecord::Ptr(record) => Some(&record.domain),
2789                DnsRecord::Soa(record) => Some(&record.domain),
2790                DnsRecord::Srv(record) => Some(&record.domain),
2791                DnsRecord::Sshfp(record) => Some(&record.domain),
2792                DnsRecord::Unknown => None,
2793            }
2794        }
2795
2796        pub fn created_at(&self) -> Option<&DateTime> {
2797            match self {
2798                DnsRecord::A(record) => Some(&record.created_at),
2799                DnsRecord::AAAA(record) => Some(&record.created_at),
2800                DnsRecord::CName(record) => Some(&record.created_at),
2801                DnsRecord::Txt(record) => Some(&record.created_at),
2802                DnsRecord::Mx(record) => Some(&record.created_at),
2803                DnsRecord::Ns(record) => Some(&record.created_at),
2804                DnsRecord::CAA(record) => Some(&record.created_at),
2805                DnsRecord::DName(record) => Some(&record.created_at),
2806                DnsRecord::Ptr(record) => Some(&record.created_at),
2807                DnsRecord::Soa(record) => Some(&record.created_at),
2808                DnsRecord::Srv(record) => Some(&record.created_at),
2809                DnsRecord::Sshfp(record) => Some(&record.created_at),
2810                DnsRecord::Unknown => None,
2811            }
2812        }
2813
2814        pub fn updated_at(&self) -> Option<&DateTime> {
2815            match self {
2816                Self::A(record) => Some(&record.updated_at),
2817                Self::AAAA(record) => Some(&record.updated_at),
2818                Self::CName(record) => Some(&record.updated_at),
2819                Self::Txt(record) => Some(&record.updated_at),
2820                Self::Mx(record) => Some(&record.updated_at),
2821                Self::Ns(record) => Some(&record.updated_at),
2822                Self::CAA(record) => Some(&record.updated_at),
2823                Self::DName(record) => Some(&record.updated_at),
2824                Self::Ptr(record) => Some(&record.updated_at),
2825                Self::Soa(record) => Some(&record.updated_at),
2826                Self::Srv(record) => Some(&record.updated_at),
2827                Self::Sshfp(record) => Some(&record.updated_at),
2828                Self::Unknown => None,
2829            }
2830        }
2831
2832        pub fn deleted_at(&self) -> Option<&DateTime> {
2833            match self {
2834                Self::A(record) => record.deleted_at.as_ref(),
2835                Self::AAAA(record) => record.deleted_at.as_ref(),
2836                Self::CName(record) => record.deleted_at.as_ref(),
2837                Self::Txt(record) => record.deleted_at.as_ref(),
2838                Self::Mx(record) => record.deleted_at.as_ref(),
2839                Self::Ns(record) => record.deleted_at.as_ref(),
2840                Self::CAA(record) => record.deleted_at.as_ref(),
2841                Self::DName(record) => record.deleted_at.as_ref(),
2842                Self::Ptr(record) => record.deleted_at.as_ref(),
2843                Self::Soa(record) => record.deleted_at.as_ref(),
2844                Self::Srv(record) => record.deleted_at.as_ref(),
2845                Self::Sshfp(record) => record.deleted_at.as_ref(),
2846                Self::Unknown => None,
2847            }
2848        }
2849    }
2850
2851    #[derive(cynic::Enum, Clone, Copy, Debug)]
2852    pub enum DnsmanagerCertificationAuthorityAuthorizationRecordTagChoices {
2853        Issue,
2854        Issuewild,
2855        Iodef,
2856    }
2857
2858    impl DnsmanagerCertificationAuthorityAuthorizationRecordTagChoices {
2859        pub fn as_str(self) -> &'static str {
2860            match self {
2861                Self::Issue => "issue",
2862                Self::Issuewild => "issuewild",
2863                Self::Iodef => "iodef",
2864            }
2865        }
2866    }
2867
2868    #[derive(cynic::Enum, Clone, Copy, Debug)]
2869    pub enum DnsmanagerSshFingerprintRecordAlgorithmChoices {
2870        #[cynic(rename = "A_1")]
2871        A1,
2872        #[cynic(rename = "A_2")]
2873        A2,
2874        #[cynic(rename = "A_3")]
2875        A3,
2876        #[cynic(rename = "A_4")]
2877        A4,
2878    }
2879
2880    #[derive(cynic::Enum, Clone, Copy, Debug)]
2881    pub enum DnsmanagerSshFingerprintRecordTypeChoices {
2882        #[cynic(rename = "A_1")]
2883        A1,
2884        #[cynic(rename = "A_2")]
2885        A2,
2886    }
2887
2888    #[derive(cynic::QueryVariables, Debug)]
2889    pub struct GetDomainVars {
2890        pub domain: String,
2891    }
2892
2893    #[derive(cynic::QueryFragment, Debug)]
2894    #[cynic(graphql_type = "Query", variables = "GetDomainVars")]
2895    pub struct GetDomain {
2896        #[arguments(name: $domain)]
2897        pub get_domain: Option<DnsDomain>,
2898    }
2899
2900    #[derive(cynic::QueryFragment, Debug)]
2901    #[cynic(graphql_type = "Query", variables = "GetDomainVars")]
2902    pub struct GetDomainWithZoneFile {
2903        #[arguments(name: $domain)]
2904        pub get_domain: Option<DnsDomainWithZoneFile>,
2905    }
2906
2907    #[derive(cynic::QueryFragment, Debug)]
2908    #[cynic(graphql_type = "Query", variables = "GetDomainVars")]
2909    pub struct GetDomainWithRecords {
2910        #[arguments(name: $domain)]
2911        pub get_domain: Option<DnsDomainWithRecords>,
2912    }
2913
2914    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2915    #[cynic(graphql_type = "DNSDomain")]
2916    pub struct DnsDomain {
2917        pub id: cynic::Id,
2918        pub name: String,
2919        pub slug: String,
2920        pub owner: Owner,
2921    }
2922
2923    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2924    #[cynic(graphql_type = "DNSDomain")]
2925    pub struct DnsDomainWithZoneFile {
2926        pub id: cynic::Id,
2927        pub name: String,
2928        pub slug: String,
2929        pub zone_file: String,
2930    }
2931
2932    #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2933    #[cynic(graphql_type = "DNSDomain")]
2934    pub struct DnsDomainWithRecords {
2935        pub id: cynic::Id,
2936        pub name: String,
2937        pub slug: String,
2938        pub records: Option<Vec<Option<DnsRecord>>>,
2939    }
2940
2941    #[derive(cynic::QueryVariables, Debug)]
2942    pub struct PurgeCacheForAppVersionVars {
2943        pub id: cynic::Id,
2944    }
2945
2946    #[derive(cynic::QueryFragment, Debug)]
2947    pub struct PurgeCacheForAppVersionPayload {
2948        pub app_version: DeployAppVersion,
2949    }
2950
2951    #[derive(cynic::QueryFragment, Debug)]
2952    #[cynic(graphql_type = "Mutation", variables = "PurgeCacheForAppVersionVars")]
2953    pub struct PurgeCacheForAppVersion {
2954        #[arguments(input: {id: $id})]
2955        pub purge_cache_for_app_version: Option<PurgeCacheForAppVersionPayload>,
2956    }
2957
2958    #[derive(cynic::QueryVariables, Debug)]
2959    pub struct ConfigureAppCdnCacheVars {
2960        pub app: cynic::Id,
2961        pub enabled: Option<bool>,
2962    }
2963
2964    #[derive(cynic::QueryVariables, Debug)]
2965    pub struct PurgeAppCdnCacheVars {
2966        pub app: cynic::Id,
2967    }
2968
2969    #[derive(cynic::QueryFragment, Debug)]
2970    pub struct AppCdnCacheMutationPayload {
2971        pub success: bool,
2972    }
2973
2974    #[derive(cynic::QueryFragment, Debug)]
2975    #[cynic(graphql_type = "Mutation", variables = "ConfigureAppCdnCacheVars")]
2976    pub struct ConfigureAppCdnCache {
2977        #[arguments(app: $app, config: {enabled: $enabled})]
2978        pub configure_app_cdn_cache: AppCdnCacheMutationPayload,
2979    }
2980
2981    #[derive(cynic::QueryFragment, Debug)]
2982    #[cynic(graphql_type = "Mutation", variables = "PurgeAppCdnCacheVars")]
2983    pub struct PurgeAppCdnCache {
2984        #[arguments(app: $app)]
2985        pub purge_app_cdn_cache: AppCdnCacheMutationPayload,
2986    }
2987
2988    #[derive(cynic::QueryVariables, Debug)]
2989    pub struct GetAppCdnCacheStatusVars {
2990        pub app: cynic::Id,
2991    }
2992
2993    #[derive(cynic::QueryFragment, Debug)]
2994    #[cynic(graphql_type = "Query", variables = "GetAppCdnCacheStatusVars")]
2995    pub struct GetAppCdnCacheStatus {
2996        #[arguments(id: $app)]
2997        #[cynic(rename = "node")]
2998        pub app: Option<NodeAppCdnCacheStatus>,
2999    }
3000
3001    #[derive(cynic::InlineFragments, Debug)]
3002    #[cynic(graphql_type = "Node")]
3003    pub enum NodeAppCdnCacheStatus {
3004        DeployApp(Box<AppCdnCacheStatus>),
3005        #[cynic(fallback)]
3006        Unknown,
3007    }
3008
3009    impl NodeAppCdnCacheStatus {
3010        pub fn into_app(self) -> Option<AppCdnCacheStatus> {
3011            match self {
3012                Self::DeployApp(app) => Some(*app),
3013                Self::Unknown => None,
3014            }
3015        }
3016    }
3017
3018    #[derive(cynic::QueryFragment, Debug)]
3019    #[cynic(graphql_type = "DeployApp")]
3020    pub struct AppCdnCacheStatus {
3021        pub cdn_cache_enabled: bool,
3022        pub cdn_cache_purged_at: Option<DateTime>,
3023    }
3024
3025    #[derive(cynic::QueryVariables, Debug)]
3026    pub struct GetAppCdnCacheMetricsVars {
3027        pub app: cynic::Id,
3028        pub start_at: DateTime,
3029        pub end_at: DateTime,
3030        pub grouped_by: MetricGrouping,
3031    }
3032
3033    #[derive(cynic::QueryFragment, Debug)]
3034    #[cynic(graphql_type = "Query", variables = "GetAppCdnCacheMetricsVars")]
3035    pub struct GetAppCdnCacheMetrics {
3036        #[arguments(id: $app)]
3037        #[cynic(rename = "node")]
3038        pub app: Option<NodeAppCdnCacheMetrics>,
3039    }
3040
3041    #[derive(cynic::InlineFragments, Debug)]
3042    #[cynic(graphql_type = "Node", variables = "GetAppCdnCacheMetricsVars")]
3043    pub enum NodeAppCdnCacheMetrics {
3044        DeployApp(Box<AppCdnCacheMetrics>),
3045        #[cynic(fallback)]
3046        Unknown,
3047    }
3048
3049    impl NodeAppCdnCacheMetrics {
3050        pub fn into_app(self) -> Option<AppCdnCacheMetrics> {
3051            match self {
3052                Self::DeployApp(app) => Some(*app),
3053                Self::Unknown => None,
3054            }
3055        }
3056    }
3057
3058    #[derive(cynic::QueryFragment, Debug)]
3059    #[cynic(graphql_type = "DeployApp", variables = "GetAppCdnCacheMetricsVars")]
3060    pub struct AppCdnCacheMetrics {
3061        #[arguments(startAt: $start_at, endAt: $end_at, groupedBy: $grouped_by)]
3062        pub grouped_metrics: UsageMetrics,
3063    }
3064
3065    #[derive(cynic::QueryFragment, Debug)]
3066    pub struct UsageMetrics {
3067        pub totals: MetricsTotals,
3068    }
3069
3070    #[derive(cynic::QueryFragment, Debug)]
3071    pub struct MetricsTotals {
3072        pub requests: RequestMetrics,
3073    }
3074
3075    #[derive(cynic::QueryFragment, Debug)]
3076    pub struct RequestMetrics {
3077        pub total_requests: BigInt,
3078        pub cached_requests: BigInt,
3079        pub data_served_bytes: BigInt,
3080        pub data_cached_bytes: BigInt,
3081    }
3082
3083    #[derive(cynic::Enum, Clone, Copy, Debug)]
3084    pub enum MetricGrouping {
3085        #[cynic(rename = "BY_15_MINUTES")]
3086        By15Minutes,
3087        #[cynic(rename = "BY_5_MINUTES")]
3088        By5Minutes,
3089        #[cynic(rename = "BY_HOUR")]
3090        ByHour,
3091        #[cynic(rename = "BY_DAY")]
3092        ByDay,
3093        #[cynic(rename = "BY_WEEK")]
3094        ByWeek,
3095    }
3096
3097    #[derive(cynic::Scalar, Debug, Clone)]
3098    #[cynic(graphql_type = "URL")]
3099    pub struct Url(pub String);
3100
3101    #[derive(cynic::Scalar, Debug, Clone)]
3102    pub struct BigInt(pub i64);
3103
3104    #[derive(cynic::Enum, Clone, Copy, Debug, PartialEq, Eq)]
3105    pub enum ProgrammingLanguage {
3106        Python,
3107        Javascript,
3108    }
3109
3110    /// A library that exposes bindings to a Wasmer package.
3111    #[derive(Debug, Clone)]
3112    pub struct Bindings {
3113        /// A unique ID specifying this set of bindings.
3114        pub id: String,
3115        /// The URL which can be used to download the files that were generated
3116        /// (typically as a `*.tar.gz` file).
3117        pub url: String,
3118        /// The programming language these bindings are written in.
3119        pub language: ProgrammingLanguage,
3120        /// The generator used to generate these bindings.
3121        pub generator: BindingsGenerator,
3122    }
3123
3124    #[derive(cynic::QueryVariables, Debug, Clone)]
3125    pub struct GetBindingsQueryVariables<'a> {
3126        pub name: &'a str,
3127        pub version: Option<&'a str>,
3128    }
3129
3130    #[derive(cynic::QueryFragment, Debug, Clone)]
3131    #[cynic(graphql_type = "Query", variables = "GetBindingsQueryVariables")]
3132    pub struct GetBindingsQuery {
3133        #[arguments(name: $name, version: $version)]
3134        #[cynic(rename = "getPackageVersion")]
3135        pub package_version: Option<PackageBindingsVersion>,
3136    }
3137
3138    #[derive(cynic::QueryFragment, Debug, Clone)]
3139    #[cynic(graphql_type = "PackageVersion")]
3140    pub struct PackageBindingsVersion {
3141        pub bindings: Vec<Option<PackageVersionLanguageBinding>>,
3142    }
3143
3144    #[derive(cynic::QueryFragment, Debug, Clone)]
3145    pub struct BindingsGenerator {
3146        pub package_version: PackageVersion,
3147        pub command_name: String,
3148    }
3149
3150    #[derive(cynic::QueryFragment, Debug, Clone)]
3151    pub struct PackageVersionLanguageBinding {
3152        pub id: cynic::Id,
3153        pub language: ProgrammingLanguage,
3154        pub url: String,
3155        pub generator: BindingsGenerator,
3156        pub __typename: String,
3157    }
3158
3159    #[derive(cynic::QueryVariables, Debug)]
3160    pub struct PackageVersionReadySubscriptionVariables {
3161        pub package_version_id: cynic::Id,
3162    }
3163
3164    #[derive(cynic::QueryFragment, Debug)]
3165    #[cynic(
3166        graphql_type = "Subscription",
3167        variables = "PackageVersionReadySubscriptionVariables"
3168    )]
3169    pub struct PackageVersionReadySubscription {
3170        #[arguments(packageVersionId: $package_version_id)]
3171        pub package_version_ready: PackageVersionReadyResponse,
3172    }
3173
3174    #[derive(cynic::QueryFragment, Debug)]
3175    pub struct PackageVersionReadyResponse {
3176        pub state: PackageVersionState,
3177        pub success: bool,
3178    }
3179
3180    #[derive(cynic::Enum, Clone, Copy, Debug)]
3181    pub enum PackageVersionState {
3182        WebcGenerated,
3183        BindingsGenerated,
3184        NativeExesGenerated,
3185    }
3186
3187    #[derive(cynic::InlineFragments, Debug, Clone)]
3188    #[cynic(graphql_type = "Node", variables = "GetDeployAppVersionsByIdVars")]
3189    pub enum NodeDeployAppVersions {
3190        DeployApp(Box<DeployAppVersionsById>),
3191        #[cynic(fallback)]
3192        Unknown,
3193    }
3194
3195    impl NodeDeployAppVersions {
3196        pub fn into_app(self) -> Option<DeployAppVersionsById> {
3197            match self {
3198                Self::DeployApp(v) => Some(*v),
3199                _ => None,
3200            }
3201        }
3202    }
3203
3204    #[derive(cynic::InlineFragments, Debug)]
3205    pub enum Node {
3206        DeployApp(Box<DeployApp>),
3207        DeployAppVersion(Box<DeployAppVersion>),
3208        AutobuildRepository(Box<AutobuildRepository>),
3209        #[cynic(fallback)]
3210        Unknown,
3211    }
3212
3213    impl Node {
3214        pub fn into_deploy_app(self) -> Option<DeployApp> {
3215            match self {
3216                Node::DeployApp(app) => Some(*app),
3217                _ => None,
3218            }
3219        }
3220
3221        pub fn into_deploy_app_version(self) -> Option<DeployAppVersion> {
3222            match self {
3223                Node::DeployAppVersion(version) => Some(*version),
3224                _ => None,
3225            }
3226        }
3227    }
3228}
3229
3230#[allow(non_snake_case, non_camel_case_types)]
3231mod schema {
3232    cynic::use_schema!(r#"schema.graphql"#);
3233}