wasmer_backend_api/
types.rs

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