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: Option<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<BigInt>,
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: Option<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 GetAppDeploymentsVariables {
1189 pub after: Option<String>,
1190 pub first: Option<i32>,
1191 pub name: String,
1192 pub offset: Option<i32>,
1193 pub owner: String,
1194 }
1195
1196 #[derive(cynic::QueryFragment, Debug)]
1197 #[cynic(graphql_type = "Query", variables = "GetAppDeploymentsVariables")]
1198 pub struct GetAppDeployments {
1199 #[arguments(owner: $owner, name: $name)]
1200 pub get_deploy_app: Option<DeployAppDeployments>,
1201 }
1202
1203 #[derive(cynic::QueryFragment, Debug)]
1204 #[cynic(graphql_type = "DeployApp", variables = "GetAppDeploymentsVariables")]
1205 pub struct DeployAppDeployments {
1206 pub deployments: Option<DeploymentConnection>,
1209 }
1210
1211 #[derive(cynic::QueryFragment, Debug)]
1212 pub struct DeploymentConnection {
1213 pub page_info: PageInfo,
1214 pub edges: Vec<Option<DeploymentEdge>>,
1215 }
1216
1217 #[derive(cynic::QueryFragment, Debug)]
1218 pub struct DeploymentEdge {
1219 pub node: Option<Deployment>,
1220 }
1221
1222 #[allow(clippy::large_enum_variant)]
1223 #[derive(cynic::InlineFragments, Debug, Clone, Serialize)]
1224 pub enum Deployment {
1225 AutobuildRepository(AutobuildRepository),
1226 NakedDeployment(NakedDeployment),
1227 #[cynic(fallback)]
1228 Other,
1229 }
1230
1231 #[derive(cynic::QueryFragment, serde::Serialize, Debug, Clone)]
1232 pub struct NakedDeployment {
1233 pub id: cynic::Id,
1234 pub created_at: DateTime,
1235 pub updated_at: DateTime,
1236 pub app_version: Option<DeployAppVersion>,
1237 }
1238
1239 #[derive(cynic::QueryFragment, serde::Serialize, Debug, Clone)]
1240 pub struct AutobuildRepository {
1241 pub id: cynic::Id,
1242 pub build_id: Uuid,
1243 pub created_at: DateTime,
1244 pub updated_at: DateTime,
1245 pub status: StatusEnum,
1246 pub log_url: Option<String>,
1247 pub repo_url: String,
1248 }
1249
1250 #[derive(cynic::Enum, Clone, Copy, Debug)]
1251 pub enum StatusEnum {
1252 Success,
1253 Working,
1254 Failure,
1255 Queued,
1256 Timeout,
1257 InternalError,
1258 Cancelled,
1259 Running,
1260 }
1261
1262 impl StatusEnum {
1263 pub fn as_str(&self) -> &'static str {
1264 match self {
1265 Self::Success => "success",
1266 Self::Working => "working",
1267 Self::Failure => "failure",
1268 Self::Queued => "queued",
1269 Self::Timeout => "timeout",
1270 Self::InternalError => "internal_error",
1271 Self::Cancelled => "cancelled",
1272 Self::Running => "running",
1273 }
1274 }
1275 }
1276
1277 #[derive(cynic::Scalar, Debug, Clone)]
1278 #[cynic(graphql_type = "UUID")]
1279 pub struct Uuid(pub String);
1280
1281 #[derive(cynic::QueryVariables, Debug)]
1282 pub struct PublishDeployAppVars {
1283 pub config: String,
1284 pub name: cynic::Id,
1285 pub owner: Option<cynic::Id>,
1286 pub make_default: Option<bool>,
1287 }
1288
1289 #[derive(cynic::QueryFragment, Debug)]
1290 #[cynic(graphql_type = "Mutation", variables = "PublishDeployAppVars")]
1291 pub struct PublishDeployApp {
1292 #[arguments(input: { config: { yamlConfig: $config }, name: $name, owner: $owner, makeDefault: $make_default })]
1293 pub publish_deploy_app: Option<PublishDeployAppPayload>,
1294 }
1295
1296 #[derive(cynic::QueryFragment, Debug)]
1297 pub struct PublishDeployAppPayload {
1298 pub deploy_app_version: DeployAppVersion,
1299 }
1300
1301 #[derive(cynic::QueryVariables, Debug)]
1302 pub struct GenerateDeployTokenVars {
1303 pub app_version_id: String,
1304 }
1305
1306 #[derive(cynic::QueryFragment, Debug)]
1307 #[cynic(graphql_type = "Mutation", variables = "GenerateDeployTokenVars")]
1308 pub struct GenerateDeployToken {
1309 #[arguments(input: { deployConfigVersionId: $app_version_id })]
1310 pub generate_deploy_token: Option<GenerateDeployTokenPayload>,
1311 }
1312
1313 #[derive(cynic::QueryFragment, Debug)]
1314 pub struct GenerateDeployTokenPayload {
1315 pub token: String,
1316 }
1317
1318 #[derive(cynic::Enum, Clone, Copy, Debug, PartialEq)]
1319 pub enum LogStream {
1320 Stdout,
1321 Stderr,
1322 Runtime,
1323 }
1324
1325 #[derive(cynic::QueryVariables, Debug, Clone)]
1326 pub struct GetDeployAppLogsVars {
1327 pub name: String,
1328 pub owner: String,
1329 pub version: Option<String>,
1332 pub starting_from: f64,
1335 pub until: Option<f64>,
1338 pub first: Option<i32>,
1339
1340 pub request_id: Option<String>,
1341
1342 pub instance_ids: Option<Vec<String>>,
1343
1344 pub streams: Option<Vec<LogStream>>,
1345 }
1346
1347 #[derive(cynic::QueryFragment, Debug)]
1348 #[cynic(graphql_type = "Query", variables = "GetDeployAppLogsVars")]
1349 pub struct GetDeployAppLogs {
1350 #[arguments(name: $name, owner: $owner, version: $version)]
1351 pub get_deploy_app_version: Option<DeployAppVersionLogs>,
1352 }
1353
1354 #[derive(cynic::QueryFragment, Debug)]
1355 #[cynic(graphql_type = "DeployAppVersion", variables = "GetDeployAppLogsVars")]
1356 pub struct DeployAppVersionLogs {
1357 #[arguments(startingFrom: $starting_from, until: $until, first: $first, instanceIds: $instance_ids, requestId: $request_id, streams: $streams)]
1358 pub logs: LogConnection,
1359 }
1360
1361 #[derive(cynic::QueryFragment, Debug)]
1362 pub struct LogConnection {
1363 pub edges: Vec<Option<LogEdge>>,
1364 }
1365
1366 #[derive(cynic::QueryFragment, Debug)]
1367 pub struct LogEdge {
1368 pub node: Option<Log>,
1369 }
1370
1371 #[derive(cynic::QueryFragment, Debug, serde::Serialize, PartialEq)]
1372 pub struct Log {
1373 pub message: String,
1374 pub timestamp: f64,
1376 pub stream: Option<LogStream>,
1377 pub instance_id: String,
1378 }
1379
1380 #[derive(cynic::QueryVariables, Debug)]
1381 pub struct GenerateDeployConfigTokenVars {
1382 pub input: String,
1383 }
1384 #[derive(cynic::QueryFragment, Debug)]
1385 #[cynic(graphql_type = "Mutation", variables = "GenerateDeployConfigTokenVars")]
1386 pub struct GenerateDeployConfigToken {
1387 #[arguments(input: { config: $input })]
1388 pub generate_deploy_config_token: Option<GenerateDeployConfigTokenPayload>,
1389 }
1390
1391 #[derive(cynic::QueryFragment, Debug)]
1392 pub struct GenerateDeployConfigTokenPayload {
1393 pub token: String,
1394 }
1395
1396 #[derive(cynic::QueryVariables, Debug)]
1397 pub struct GetNodeVars {
1398 pub id: cynic::Id,
1399 }
1400
1401 #[derive(cynic::QueryFragment, Debug)]
1402 #[cynic(graphql_type = "Query", variables = "GetNodeVars")]
1403 pub struct GetNode {
1404 #[arguments(id: $id)]
1405 pub node: Option<Node>,
1406 }
1407
1408 #[derive(cynic::QueryVariables, Debug)]
1409 pub struct GetDeployAppByIdVars {
1410 pub app_id: cynic::Id,
1411 }
1412
1413 #[derive(cynic::QueryFragment, Debug)]
1414 #[cynic(graphql_type = "Query", variables = "GetDeployAppByIdVars")]
1415 pub struct GetDeployAppById {
1416 #[arguments(id: $app_id)]
1417 #[cynic(rename = "node")]
1418 pub app: Option<Node>,
1419 }
1420
1421 #[derive(cynic::QueryVariables, Debug)]
1422 pub struct GetDeployAppAndVersionByIdVars {
1423 pub app_id: cynic::Id,
1424 pub version_id: cynic::Id,
1425 }
1426
1427 #[derive(cynic::QueryFragment, Debug)]
1428 #[cynic(graphql_type = "Query", variables = "GetDeployAppAndVersionByIdVars")]
1429 pub struct GetDeployAppAndVersionById {
1430 #[arguments(id: $app_id)]
1431 #[cynic(rename = "node")]
1432 pub app: Option<Node>,
1433 #[arguments(id: $version_id)]
1434 #[cynic(rename = "node")]
1435 pub version: Option<Node>,
1436 }
1437
1438 #[derive(cynic::QueryVariables, Debug)]
1439 pub struct GetDeployAppVersionByIdVars {
1440 pub version_id: cynic::Id,
1441 }
1442
1443 #[derive(cynic::QueryFragment, Debug)]
1444 #[cynic(graphql_type = "Query", variables = "GetDeployAppVersionByIdVars")]
1445 pub struct GetDeployAppVersionById {
1446 #[arguments(id: $version_id)]
1447 #[cynic(rename = "node")]
1448 pub version: Option<Node>,
1449 }
1450
1451 #[derive(cynic::QueryVariables, Debug)]
1452 pub struct DeleteAppSecretVariables {
1453 pub id: cynic::Id,
1454 }
1455
1456 #[derive(cynic::QueryFragment, Debug)]
1457 #[cynic(graphql_type = "Mutation", variables = "DeleteAppSecretVariables")]
1458 pub struct DeleteAppSecret {
1459 #[arguments(input: { id: $id })]
1460 pub delete_app_secret: Option<DeleteAppSecretPayload>,
1461 }
1462
1463 #[derive(cynic::QueryFragment, Debug)]
1464 pub struct DeleteAppSecretPayload {
1465 pub success: bool,
1466 }
1467 #[derive(cynic::QueryVariables, Debug, Clone)]
1468 pub struct GetAllAppSecretsVariables {
1469 pub after: Option<String>,
1470 pub app_id: cynic::Id,
1471 pub before: Option<String>,
1472 pub first: Option<i32>,
1473 pub last: Option<i32>,
1474 pub offset: Option<i32>,
1475 pub names: Option<Vec<String>>,
1476 }
1477
1478 #[derive(cynic::QueryFragment, Debug)]
1479 #[cynic(graphql_type = "Query", variables = "GetAllAppSecretsVariables")]
1480 pub struct GetAllAppSecrets {
1481 #[arguments(appId: $app_id, after: $after, before: $before, first: $first, last: $last, offset: $offset, names: $names)]
1482 pub get_app_secrets: Option<SecretConnection>,
1483 }
1484
1485 #[derive(cynic::QueryFragment, Debug)]
1486 pub struct SecretConnection {
1487 pub edges: Vec<Option<SecretEdge>>,
1488 pub page_info: PageInfo,
1489 pub total_count: Option<i32>,
1490 }
1491
1492 #[derive(cynic::QueryFragment, Debug)]
1493 pub struct SecretEdge {
1494 pub cursor: String,
1495 pub node: Option<Secret>,
1496 }
1497
1498 #[derive(cynic::QueryVariables, Debug)]
1499 pub struct GetAppSecretVariables {
1500 pub app_id: cynic::Id,
1501 pub secret_name: String,
1502 }
1503
1504 #[derive(cynic::QueryFragment, Debug)]
1505 #[cynic(graphql_type = "Query", variables = "GetAppSecretVariables")]
1506 pub struct GetAppSecret {
1507 #[arguments(appId: $app_id, secretName: $secret_name)]
1508 pub get_app_secret: Option<Secret>,
1509 }
1510
1511 #[derive(cynic::QueryVariables, Debug)]
1512 pub struct GetAppSecretValueVariables {
1513 pub id: cynic::Id,
1514 }
1515
1516 #[derive(cynic::QueryFragment, Debug)]
1517 #[cynic(graphql_type = "Query", variables = "GetAppSecretValueVariables")]
1518 pub struct GetAppSecretValue {
1519 #[arguments(id: $id)]
1520 pub get_secret_value: Option<String>,
1521 }
1522
1523 #[derive(cynic::QueryVariables, Debug)]
1524 pub struct UpsertAppSecretVariables<'a> {
1525 pub app_id: cynic::Id,
1526 pub name: &'a str,
1527 pub value: &'a str,
1528 }
1529
1530 #[derive(cynic::QueryFragment, Debug)]
1531 #[cynic(graphql_type = "Mutation", variables = "UpsertAppSecretVariables")]
1532 pub struct UpsertAppSecret {
1533 #[arguments(input: { appId: $app_id, name: $name, value: $value })]
1534 pub upsert_app_secret: Option<UpsertAppSecretPayload>,
1535 }
1536
1537 #[derive(cynic::QueryFragment, Debug)]
1538 pub struct UpsertAppSecretPayload {
1539 pub secret: Secret,
1540 pub success: bool,
1541 }
1542
1543 #[derive(cynic::QueryVariables, Debug)]
1544 pub struct UpsertAppSecretsVariables {
1545 pub app_id: cynic::Id,
1546 pub secrets: Option<Vec<SecretInput>>,
1547 }
1548
1549 #[derive(cynic::QueryFragment, Debug)]
1550 #[cynic(graphql_type = "Mutation", variables = "UpsertAppSecretsVariables")]
1551 pub struct UpsertAppSecrets {
1552 #[arguments(input: { appId: $app_id, secrets: $secrets })]
1553 pub upsert_app_secrets: Option<UpsertAppSecretsPayload>,
1554 }
1555
1556 #[derive(cynic::QueryFragment, Debug)]
1557 pub struct UpsertAppSecretsPayload {
1558 pub secrets: Vec<Option<Secret>>,
1559 pub success: bool,
1560 }
1561
1562 #[derive(cynic::InputObject, Debug)]
1563 pub struct SecretInput {
1564 pub name: String,
1565 pub value: String,
1566 }
1567 #[derive(cynic::QueryFragment, Debug, Serialize)]
1568 pub struct Secret {
1569 #[serde(skip_serializing)]
1570 pub id: cynic::Id,
1571 pub name: String,
1572 pub created_at: DateTime,
1573 pub updated_at: DateTime,
1574 }
1575
1576 #[derive(cynic::QueryVariables, Debug, Clone)]
1577 pub struct GetAllAppRegionsVariables {
1578 pub after: Option<String>,
1579 pub before: Option<String>,
1580 pub first: Option<i32>,
1581 pub last: Option<i32>,
1582 pub offset: Option<i32>,
1583 }
1584
1585 #[derive(cynic::QueryFragment, Debug)]
1586 #[cynic(graphql_type = "Query", variables = "GetAllAppRegionsVariables")]
1587 pub struct GetAllAppRegions {
1588 #[arguments(after: $after, offset: $offset, before: $before, first: $first, last: $last)]
1589 pub get_app_regions: AppRegionConnection,
1590 }
1591
1592 #[derive(cynic::QueryFragment, Debug)]
1593 pub struct AppRegionConnection {
1594 pub edges: Vec<Option<AppRegionEdge>>,
1595 pub page_info: PageInfo,
1596 pub total_count: Option<i32>,
1597 }
1598
1599 #[derive(cynic::QueryFragment, Debug)]
1600 pub struct AppRegionEdge {
1601 pub cursor: String,
1602 pub node: Option<AppRegion>,
1603 }
1604
1605 #[derive(cynic::QueryFragment, Debug, Serialize)]
1606 pub struct AppRegion {
1607 pub city: String,
1608 pub country: String,
1609 pub id: cynic::Id,
1610 pub name: String,
1611 }
1612
1613 #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1614 #[cynic(graphql_type = "TXTRecord")]
1615 pub struct TxtRecord {
1616 pub id: cynic::Id,
1617 pub created_at: DateTime,
1618 pub updated_at: DateTime,
1619 pub deleted_at: Option<DateTime>,
1620 pub name: Option<String>,
1621 pub text: String,
1622 pub ttl: Option<i32>,
1623 pub data: String,
1624
1625 pub domain: DnsDomain,
1626 }
1627
1628 #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1629 #[cynic(graphql_type = "SSHFPRecord")]
1630 pub struct SshfpRecord {
1631 pub id: cynic::Id,
1632 pub created_at: DateTime,
1633 pub updated_at: DateTime,
1634 pub deleted_at: Option<DateTime>,
1635 pub name: Option<String>,
1636 pub text: String,
1637 pub ttl: Option<i32>,
1638 #[cynic(rename = "type")]
1639 pub type_: DnsmanagerSshFingerprintRecordTypeChoices,
1640 pub algorithm: DnsmanagerSshFingerprintRecordAlgorithmChoices,
1641 pub fingerprint: String,
1642
1643 pub domain: DnsDomain,
1644 }
1645
1646 #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1647 #[cynic(graphql_type = "SRVRecord")]
1648 pub struct SrvRecord {
1649 pub id: cynic::Id,
1650 pub created_at: DateTime,
1651 pub updated_at: DateTime,
1652 pub deleted_at: Option<DateTime>,
1653 pub name: Option<String>,
1654 pub text: String,
1655 pub ttl: Option<i32>,
1656 pub service: String,
1657 pub protocol: String,
1658 pub priority: i32,
1659 pub weight: i32,
1660 pub port: i32,
1661 pub target: String,
1662
1663 pub domain: DnsDomain,
1664 }
1665
1666 #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1667 #[cynic(graphql_type = "SOARecord")]
1668 pub struct SoaRecord {
1669 pub id: cynic::Id,
1670 pub created_at: DateTime,
1671 pub updated_at: DateTime,
1672 pub deleted_at: Option<DateTime>,
1673 pub name: Option<String>,
1674 pub text: String,
1675 pub ttl: Option<i32>,
1676 pub mname: String,
1677 pub rname: String,
1678 pub serial: BigInt,
1679 pub refresh: BigInt,
1680 pub retry: BigInt,
1681 pub expire: BigInt,
1682 pub minimum: BigInt,
1683
1684 pub domain: DnsDomain,
1685 }
1686
1687 #[derive(cynic::Enum, Debug, Clone, Copy)]
1688 pub enum DNSRecordsSortBy {
1689 Newest,
1690 Oldest,
1691 }
1692
1693 #[derive(cynic::QueryVariables, Debug, Clone)]
1694 pub struct GetAllDnsRecordsVariables {
1695 pub after: Option<String>,
1696 pub updated_after: Option<DateTime>,
1697 pub sort_by: Option<DNSRecordsSortBy>,
1698 pub first: Option<i32>,
1699 }
1700
1701 #[derive(cynic::QueryFragment, Debug)]
1702 #[cynic(graphql_type = "Query", variables = "GetAllDnsRecordsVariables")]
1703 pub struct GetAllDnsRecords {
1704 #[arguments(
1705 first: $first,
1706 after: $after,
1707 updatedAfter: $updated_after,
1708 sortBy: $sort_by
1709 )]
1710 #[cynic(rename = "getAllDNSRecords")]
1711 pub get_all_dnsrecords: DnsRecordConnection,
1712 }
1713
1714 #[derive(cynic::QueryVariables, Debug, Clone)]
1715 pub struct GetAllDomainsVariables {
1716 pub after: Option<String>,
1717 pub first: Option<i32>,
1718 pub namespace: Option<String>,
1719 }
1720
1721 #[derive(cynic::QueryFragment, Debug)]
1722 #[cynic(graphql_type = "Query", variables = "GetAllDomainsVariables")]
1723 pub struct GetAllDomains {
1724 #[arguments(
1725 first: $first,
1726 after: $after,
1727 namespace: $namespace,
1728 )]
1729 #[cynic(rename = "getAllDomains")]
1730 pub get_all_domains: DnsDomainConnection,
1731 }
1732
1733 #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1734 #[cynic(graphql_type = "PTRRecord")]
1735 pub struct PtrRecord {
1736 pub id: cynic::Id,
1737 pub created_at: DateTime,
1738 pub updated_at: DateTime,
1739 pub deleted_at: Option<DateTime>,
1740 pub name: Option<String>,
1741 pub text: String,
1742 pub ttl: Option<i32>,
1743 pub ptrdname: String,
1744
1745 pub domain: DnsDomain,
1746 }
1747
1748 #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1749 #[cynic(graphql_type = "NSRecord")]
1750 pub struct NsRecord {
1751 pub id: cynic::Id,
1752 pub created_at: DateTime,
1753 pub updated_at: DateTime,
1754 pub deleted_at: Option<DateTime>,
1755 pub name: Option<String>,
1756 pub text: String,
1757 pub ttl: Option<i32>,
1758 pub nsdname: String,
1759
1760 pub domain: DnsDomain,
1761 }
1762
1763 #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1764 #[cynic(graphql_type = "MXRecord")]
1765 pub struct MxRecord {
1766 pub id: cynic::Id,
1767 pub created_at: DateTime,
1768 pub updated_at: DateTime,
1769 pub deleted_at: Option<DateTime>,
1770 pub name: Option<String>,
1771 pub text: String,
1772 pub ttl: Option<i32>,
1773 pub preference: i32,
1774 pub exchange: String,
1775
1776 pub domain: DnsDomain,
1777 }
1778
1779 #[derive(cynic::QueryFragment, Debug)]
1780 #[cynic(graphql_type = "DNSRecordConnection")]
1781 pub struct DnsRecordConnection {
1782 pub page_info: PageInfo,
1783 pub edges: Vec<Option<DnsRecordEdge>>,
1784 }
1785
1786 #[derive(cynic::QueryFragment, Debug)]
1787 #[cynic(graphql_type = "DNSRecordEdge")]
1788 pub struct DnsRecordEdge {
1789 pub node: Option<DnsRecord>,
1790 }
1791
1792 #[derive(cynic::QueryFragment, Debug)]
1793 #[cynic(graphql_type = "DNSDomainConnection")]
1794 pub struct DnsDomainConnection {
1795 pub page_info: PageInfo,
1796 pub edges: Vec<Option<DnsDomainEdge>>,
1797 }
1798
1799 #[derive(cynic::QueryFragment, Debug)]
1800 #[cynic(graphql_type = "DNSDomainEdge")]
1801 pub struct DnsDomainEdge {
1802 pub node: Option<DnsDomain>,
1803 }
1804
1805 #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1806 #[cynic(graphql_type = "DNAMERecord")]
1807 pub struct DNameRecord {
1808 pub id: cynic::Id,
1809 pub created_at: DateTime,
1810 pub updated_at: DateTime,
1811 pub deleted_at: Option<DateTime>,
1812 pub name: Option<String>,
1813 pub text: String,
1814 pub ttl: Option<i32>,
1815 pub d_name: String,
1816
1817 pub domain: DnsDomain,
1818 }
1819
1820 #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1821 #[cynic(graphql_type = "CNAMERecord")]
1822 pub struct CNameRecord {
1823 pub id: cynic::Id,
1824 pub created_at: DateTime,
1825 pub updated_at: DateTime,
1826 pub deleted_at: Option<DateTime>,
1827 pub name: Option<String>,
1828 pub text: String,
1829 pub ttl: Option<i32>,
1830 pub c_name: String,
1831
1832 pub domain: DnsDomain,
1833 }
1834
1835 #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1836 #[cynic(graphql_type = "CAARecord")]
1837 pub struct CaaRecord {
1838 pub id: cynic::Id,
1839 pub created_at: DateTime,
1840 pub updated_at: DateTime,
1841 pub deleted_at: Option<DateTime>,
1842 pub name: Option<String>,
1843 pub text: String,
1844 pub ttl: Option<i32>,
1845 pub value: String,
1846 pub flags: i32,
1847 pub tag: DnsmanagerCertificationAuthorityAuthorizationRecordTagChoices,
1848
1849 pub domain: DnsDomain,
1850 }
1851
1852 #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1853 #[cynic(graphql_type = "ARecord")]
1854 pub struct ARecord {
1855 pub id: cynic::Id,
1856 pub created_at: DateTime,
1857 pub updated_at: DateTime,
1858 pub deleted_at: Option<DateTime>,
1859 pub name: Option<String>,
1860 pub text: String,
1861 pub ttl: Option<i32>,
1862 pub address: String,
1863 pub domain: DnsDomain,
1864 }
1865
1866 #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
1867 #[cynic(graphql_type = "AAAARecord")]
1868 pub struct AaaaRecord {
1869 pub id: cynic::Id,
1870 pub created_at: DateTime,
1871 pub updated_at: DateTime,
1872 pub deleted_at: Option<DateTime>,
1873 pub name: Option<String>,
1874 pub text: String,
1875 pub ttl: Option<i32>,
1876 pub address: String,
1877 pub domain: DnsDomain,
1878 }
1879
1880 #[derive(cynic::InlineFragments, Debug, Clone, Serialize)]
1881 #[cynic(graphql_type = "DNSRecord")]
1882 pub enum DnsRecord {
1883 A(ARecord),
1884 AAAA(AaaaRecord),
1885 CName(CNameRecord),
1886 Txt(TxtRecord),
1887 Mx(MxRecord),
1888 Ns(NsRecord),
1889 CAA(CaaRecord),
1890 DName(DNameRecord),
1891 Ptr(PtrRecord),
1892 Soa(SoaRecord),
1893 Srv(SrvRecord),
1894 Sshfp(SshfpRecord),
1895 #[cynic(fallback)]
1896 Unknown,
1897 }
1898
1899 impl DnsRecord {
1900 pub fn id(&self) -> &str {
1901 match self {
1902 DnsRecord::A(record) => record.id.inner(),
1903 DnsRecord::AAAA(record) => record.id.inner(),
1904 DnsRecord::CName(record) => record.id.inner(),
1905 DnsRecord::Txt(record) => record.id.inner(),
1906 DnsRecord::Mx(record) => record.id.inner(),
1907 DnsRecord::Ns(record) => record.id.inner(),
1908 DnsRecord::CAA(record) => record.id.inner(),
1909 DnsRecord::DName(record) => record.id.inner(),
1910 DnsRecord::Ptr(record) => record.id.inner(),
1911 DnsRecord::Soa(record) => record.id.inner(),
1912 DnsRecord::Srv(record) => record.id.inner(),
1913 DnsRecord::Sshfp(record) => record.id.inner(),
1914 DnsRecord::Unknown => "",
1915 }
1916 }
1917 pub fn name(&self) -> Option<&str> {
1918 match self {
1919 DnsRecord::A(record) => record.name.as_deref(),
1920 DnsRecord::AAAA(record) => record.name.as_deref(),
1921 DnsRecord::CName(record) => record.name.as_deref(),
1922 DnsRecord::Txt(record) => record.name.as_deref(),
1923 DnsRecord::Mx(record) => record.name.as_deref(),
1924 DnsRecord::Ns(record) => record.name.as_deref(),
1925 DnsRecord::CAA(record) => record.name.as_deref(),
1926 DnsRecord::DName(record) => record.name.as_deref(),
1927 DnsRecord::Ptr(record) => record.name.as_deref(),
1928 DnsRecord::Soa(record) => record.name.as_deref(),
1929 DnsRecord::Srv(record) => record.name.as_deref(),
1930 DnsRecord::Sshfp(record) => record.name.as_deref(),
1931 DnsRecord::Unknown => None,
1932 }
1933 }
1934 pub fn ttl(&self) -> Option<i32> {
1935 match self {
1936 DnsRecord::A(record) => record.ttl,
1937 DnsRecord::AAAA(record) => record.ttl,
1938 DnsRecord::CName(record) => record.ttl,
1939 DnsRecord::Txt(record) => record.ttl,
1940 DnsRecord::Mx(record) => record.ttl,
1941 DnsRecord::Ns(record) => record.ttl,
1942 DnsRecord::CAA(record) => record.ttl,
1943 DnsRecord::DName(record) => record.ttl,
1944 DnsRecord::Ptr(record) => record.ttl,
1945 DnsRecord::Soa(record) => record.ttl,
1946 DnsRecord::Srv(record) => record.ttl,
1947 DnsRecord::Sshfp(record) => record.ttl,
1948 DnsRecord::Unknown => None,
1949 }
1950 }
1951
1952 pub fn text(&self) -> &str {
1953 match self {
1954 DnsRecord::A(record) => record.text.as_str(),
1955 DnsRecord::AAAA(record) => record.text.as_str(),
1956 DnsRecord::CName(record) => record.text.as_str(),
1957 DnsRecord::Txt(record) => record.text.as_str(),
1958 DnsRecord::Mx(record) => record.text.as_str(),
1959 DnsRecord::Ns(record) => record.text.as_str(),
1960 DnsRecord::CAA(record) => record.text.as_str(),
1961 DnsRecord::DName(record) => record.text.as_str(),
1962 DnsRecord::Ptr(record) => record.text.as_str(),
1963 DnsRecord::Soa(record) => record.text.as_str(),
1964 DnsRecord::Srv(record) => record.text.as_str(),
1965 DnsRecord::Sshfp(record) => record.text.as_str(),
1966 DnsRecord::Unknown => "",
1967 }
1968 }
1969 pub fn record_type(&self) -> &str {
1970 match self {
1971 DnsRecord::A(_) => "A",
1972 DnsRecord::AAAA(_) => "AAAA",
1973 DnsRecord::CName(_) => "CNAME",
1974 DnsRecord::Txt(_) => "TXT",
1975 DnsRecord::Mx(_) => "MX",
1976 DnsRecord::Ns(_) => "NS",
1977 DnsRecord::CAA(_) => "CAA",
1978 DnsRecord::DName(_) => "DNAME",
1979 DnsRecord::Ptr(_) => "PTR",
1980 DnsRecord::Soa(_) => "SOA",
1981 DnsRecord::Srv(_) => "SRV",
1982 DnsRecord::Sshfp(_) => "SSHFP",
1983 DnsRecord::Unknown => "",
1984 }
1985 }
1986
1987 pub fn domain(&self) -> Option<&DnsDomain> {
1988 match self {
1989 DnsRecord::A(record) => Some(&record.domain),
1990 DnsRecord::AAAA(record) => Some(&record.domain),
1991 DnsRecord::CName(record) => Some(&record.domain),
1992 DnsRecord::Txt(record) => Some(&record.domain),
1993 DnsRecord::Mx(record) => Some(&record.domain),
1994 DnsRecord::Ns(record) => Some(&record.domain),
1995 DnsRecord::CAA(record) => Some(&record.domain),
1996 DnsRecord::DName(record) => Some(&record.domain),
1997 DnsRecord::Ptr(record) => Some(&record.domain),
1998 DnsRecord::Soa(record) => Some(&record.domain),
1999 DnsRecord::Srv(record) => Some(&record.domain),
2000 DnsRecord::Sshfp(record) => Some(&record.domain),
2001 DnsRecord::Unknown => None,
2002 }
2003 }
2004
2005 pub fn created_at(&self) -> Option<&DateTime> {
2006 match self {
2007 DnsRecord::A(record) => Some(&record.created_at),
2008 DnsRecord::AAAA(record) => Some(&record.created_at),
2009 DnsRecord::CName(record) => Some(&record.created_at),
2010 DnsRecord::Txt(record) => Some(&record.created_at),
2011 DnsRecord::Mx(record) => Some(&record.created_at),
2012 DnsRecord::Ns(record) => Some(&record.created_at),
2013 DnsRecord::CAA(record) => Some(&record.created_at),
2014 DnsRecord::DName(record) => Some(&record.created_at),
2015 DnsRecord::Ptr(record) => Some(&record.created_at),
2016 DnsRecord::Soa(record) => Some(&record.created_at),
2017 DnsRecord::Srv(record) => Some(&record.created_at),
2018 DnsRecord::Sshfp(record) => Some(&record.created_at),
2019 DnsRecord::Unknown => None,
2020 }
2021 }
2022
2023 pub fn updated_at(&self) -> Option<&DateTime> {
2024 match self {
2025 Self::A(record) => Some(&record.updated_at),
2026 Self::AAAA(record) => Some(&record.updated_at),
2027 Self::CName(record) => Some(&record.updated_at),
2028 Self::Txt(record) => Some(&record.updated_at),
2029 Self::Mx(record) => Some(&record.updated_at),
2030 Self::Ns(record) => Some(&record.updated_at),
2031 Self::CAA(record) => Some(&record.updated_at),
2032 Self::DName(record) => Some(&record.updated_at),
2033 Self::Ptr(record) => Some(&record.updated_at),
2034 Self::Soa(record) => Some(&record.updated_at),
2035 Self::Srv(record) => Some(&record.updated_at),
2036 Self::Sshfp(record) => Some(&record.updated_at),
2037 Self::Unknown => None,
2038 }
2039 }
2040
2041 pub fn deleted_at(&self) -> Option<&DateTime> {
2042 match self {
2043 Self::A(record) => record.deleted_at.as_ref(),
2044 Self::AAAA(record) => record.deleted_at.as_ref(),
2045 Self::CName(record) => record.deleted_at.as_ref(),
2046 Self::Txt(record) => record.deleted_at.as_ref(),
2047 Self::Mx(record) => record.deleted_at.as_ref(),
2048 Self::Ns(record) => record.deleted_at.as_ref(),
2049 Self::CAA(record) => record.deleted_at.as_ref(),
2050 Self::DName(record) => record.deleted_at.as_ref(),
2051 Self::Ptr(record) => record.deleted_at.as_ref(),
2052 Self::Soa(record) => record.deleted_at.as_ref(),
2053 Self::Srv(record) => record.deleted_at.as_ref(),
2054 Self::Sshfp(record) => record.deleted_at.as_ref(),
2055 Self::Unknown => None,
2056 }
2057 }
2058 }
2059
2060 #[derive(cynic::Enum, Clone, Copy, Debug)]
2061 pub enum DnsmanagerCertificationAuthorityAuthorizationRecordTagChoices {
2062 Issue,
2063 Issuewild,
2064 Iodef,
2065 }
2066
2067 impl DnsmanagerCertificationAuthorityAuthorizationRecordTagChoices {
2068 pub fn as_str(self) -> &'static str {
2069 match self {
2070 Self::Issue => "issue",
2071 Self::Issuewild => "issuewild",
2072 Self::Iodef => "iodef",
2073 }
2074 }
2075 }
2076
2077 #[derive(cynic::Enum, Clone, Copy, Debug)]
2078 pub enum DnsmanagerSshFingerprintRecordAlgorithmChoices {
2079 #[cynic(rename = "A_1")]
2080 A1,
2081 #[cynic(rename = "A_2")]
2082 A2,
2083 #[cynic(rename = "A_3")]
2084 A3,
2085 #[cynic(rename = "A_4")]
2086 A4,
2087 }
2088
2089 #[derive(cynic::Enum, Clone, Copy, Debug)]
2090 pub enum DnsmanagerSshFingerprintRecordTypeChoices {
2091 #[cynic(rename = "A_1")]
2092 A1,
2093 #[cynic(rename = "A_2")]
2094 A2,
2095 }
2096
2097 #[derive(cynic::QueryVariables, Debug)]
2098 pub struct GetDomainVars {
2099 pub domain: String,
2100 }
2101
2102 #[derive(cynic::QueryFragment, Debug)]
2103 #[cynic(graphql_type = "Query", variables = "GetDomainVars")]
2104 pub struct GetDomain {
2105 #[arguments(name: $domain)]
2106 pub get_domain: Option<DnsDomain>,
2107 }
2108
2109 #[derive(cynic::QueryFragment, Debug)]
2110 #[cynic(graphql_type = "Query", variables = "GetDomainVars")]
2111 pub struct GetDomainWithZoneFile {
2112 #[arguments(name: $domain)]
2113 pub get_domain: Option<DnsDomainWithZoneFile>,
2114 }
2115
2116 #[derive(cynic::QueryFragment, Debug)]
2117 #[cynic(graphql_type = "Query", variables = "GetDomainVars")]
2118 pub struct GetDomainWithRecords {
2119 #[arguments(name: $domain)]
2120 pub get_domain: Option<DnsDomainWithRecords>,
2121 }
2122
2123 #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2124 #[cynic(graphql_type = "DNSDomain")]
2125 pub struct DnsDomain {
2126 pub id: cynic::Id,
2127 pub name: String,
2128 pub slug: String,
2129 pub owner: Owner,
2130 }
2131
2132 #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2133 #[cynic(graphql_type = "DNSDomain")]
2134 pub struct DnsDomainWithZoneFile {
2135 pub id: cynic::Id,
2136 pub name: String,
2137 pub slug: String,
2138 pub zone_file: String,
2139 }
2140
2141 #[derive(cynic::QueryFragment, Debug, Clone, Serialize)]
2142 #[cynic(graphql_type = "DNSDomain")]
2143 pub struct DnsDomainWithRecords {
2144 pub id: cynic::Id,
2145 pub name: String,
2146 pub slug: String,
2147 pub records: Option<Vec<Option<DnsRecord>>>,
2148 }
2149
2150 #[derive(cynic::QueryVariables, Debug)]
2151 pub struct PurgeCacheForAppVersionVars {
2152 pub id: cynic::Id,
2153 }
2154
2155 #[derive(cynic::QueryFragment, Debug)]
2156 pub struct PurgeCacheForAppVersionPayload {
2157 pub app_version: DeployAppVersion,
2158 }
2159
2160 #[derive(cynic::QueryFragment, Debug)]
2161 #[cynic(graphql_type = "Mutation", variables = "PurgeCacheForAppVersionVars")]
2162 pub struct PurgeCacheForAppVersion {
2163 #[arguments(input: {id: $id})]
2164 pub purge_cache_for_app_version: Option<PurgeCacheForAppVersionPayload>,
2165 }
2166
2167 #[derive(cynic::Scalar, Debug, Clone)]
2168 #[cynic(graphql_type = "URL")]
2169 pub struct Url(pub String);
2170
2171 #[derive(cynic::Scalar, Debug, Clone)]
2172 pub struct BigInt(pub i64);
2173
2174 #[derive(cynic::Enum, Clone, Copy, Debug, PartialEq, Eq)]
2175 pub enum ProgrammingLanguage {
2176 Python,
2177 Javascript,
2178 }
2179
2180 #[derive(Debug, Clone)]
2182 pub struct Bindings {
2183 pub id: String,
2185 pub url: String,
2188 pub language: ProgrammingLanguage,
2190 pub generator: BindingsGenerator,
2192 }
2193
2194 #[derive(cynic::QueryVariables, Debug, Clone)]
2195 pub struct GetBindingsQueryVariables<'a> {
2196 pub name: &'a str,
2197 pub version: Option<&'a str>,
2198 }
2199
2200 #[derive(cynic::QueryFragment, Debug, Clone)]
2201 #[cynic(graphql_type = "Query", variables = "GetBindingsQueryVariables")]
2202 pub struct GetBindingsQuery {
2203 #[arguments(name: $name, version: $version)]
2204 #[cynic(rename = "getPackageVersion")]
2205 pub package_version: Option<PackageBindingsVersion>,
2206 }
2207
2208 #[derive(cynic::QueryFragment, Debug, Clone)]
2209 #[cynic(graphql_type = "PackageVersion")]
2210 pub struct PackageBindingsVersion {
2211 pub bindings: Vec<Option<PackageVersionLanguageBinding>>,
2212 }
2213
2214 #[derive(cynic::QueryFragment, Debug, Clone)]
2215 pub struct BindingsGenerator {
2216 pub package_version: PackageVersion,
2217 pub command_name: String,
2218 }
2219
2220 #[derive(cynic::QueryFragment, Debug, Clone)]
2221 pub struct PackageVersionLanguageBinding {
2222 pub id: cynic::Id,
2223 pub language: ProgrammingLanguage,
2224 pub url: String,
2225 pub generator: BindingsGenerator,
2226 pub __typename: String,
2227 }
2228
2229 #[derive(cynic::QueryVariables, Debug)]
2230 pub struct PackageVersionReadySubscriptionVariables {
2231 pub package_version_id: cynic::Id,
2232 }
2233
2234 #[derive(cynic::QueryFragment, Debug)]
2235 #[cynic(
2236 graphql_type = "Subscription",
2237 variables = "PackageVersionReadySubscriptionVariables"
2238 )]
2239 pub struct PackageVersionReadySubscription {
2240 #[arguments(packageVersionId: $package_version_id)]
2241 pub package_version_ready: PackageVersionReadyResponse,
2242 }
2243
2244 #[derive(cynic::QueryFragment, Debug)]
2245 pub struct PackageVersionReadyResponse {
2246 pub state: PackageVersionState,
2247 pub success: bool,
2248 }
2249
2250 #[derive(cynic::Enum, Clone, Copy, Debug)]
2251 pub enum PackageVersionState {
2252 WebcGenerated,
2253 BindingsGenerated,
2254 NativeExesGenerated,
2255 }
2256
2257 #[derive(cynic::InlineFragments, Debug, Clone)]
2258 #[cynic(graphql_type = "Node", variables = "GetDeployAppVersionsByIdVars")]
2259 pub enum NodeDeployAppVersions {
2260 DeployApp(Box<DeployAppVersionsById>),
2261 #[cynic(fallback)]
2262 Unknown,
2263 }
2264
2265 impl NodeDeployAppVersions {
2266 pub fn into_app(self) -> Option<DeployAppVersionsById> {
2267 match self {
2268 Self::DeployApp(v) => Some(*v),
2269 _ => None,
2270 }
2271 }
2272 }
2273
2274 #[derive(cynic::InlineFragments, Debug)]
2275 pub enum Node {
2276 DeployApp(Box<DeployApp>),
2277 DeployAppVersion(Box<DeployAppVersion>),
2278 AutobuildRepository(Box<AutobuildRepository>),
2279 #[cynic(fallback)]
2280 Unknown,
2281 }
2282
2283 impl Node {
2284 pub fn into_deploy_app(self) -> Option<DeployApp> {
2285 match self {
2286 Node::DeployApp(app) => Some(*app),
2287 _ => None,
2288 }
2289 }
2290
2291 pub fn into_deploy_app_version(self) -> Option<DeployAppVersion> {
2292 match self {
2293 Node::DeployAppVersion(version) => Some(*version),
2294 _ => None,
2295 }
2296 }
2297 }
2298}
2299
2300#[allow(non_snake_case, non_camel_case_types)]
2301mod schema {
2302 cynic::use_schema!(r#"schema.graphql"#);
2303}