wasmer_api/
types.rs

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