-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathsoftware.rs
More file actions
74 lines (67 loc) · 3.33 KB
/
software.rs
File metadata and controls
74 lines (67 loc) · 3.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Copyright (c) [2024] SUSE LLC
//
// All Rights Reserved.
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 of the License, or (at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, contact SUSE LLC.
//
// To contact SUSE LLC about this file by physical or electronic mail, you may
// find current contact information at www.suse.com.
use utoipa::openapi::{Components, ComponentsBuilder, OpenApi, Paths, PathsBuilder};
use super::{common::ServiceStatusApiDocBuilder, ApiDocBuilder};
pub struct SoftwareApiDocBuilder;
impl ApiDocBuilder for SoftwareApiDocBuilder {
fn title(&self) -> String {
"Software HTTP API".to_string()
}
fn paths(&self) -> Paths {
PathsBuilder::new()
.path_from::<crate::software::web::__path_deregister>()
.path_from::<crate::software::web::__path_get_config>()
.path_from::<crate::software::web::__path_get_registration>()
.path_from::<crate::software::web::__path_license>()
.path_from::<crate::software::web::__path_licenses>()
.path_from::<crate::software::web::__path_patterns>()
.path_from::<crate::software::web::__path_probe>()
.path_from::<crate::software::web::__path_products>()
.path_from::<crate::software::web::__path_proposal>()
.path_from::<crate::software::web::__path_register>()
.path_from::<crate::software::web::__path_repositories>()
.path_from::<crate::software::web::__path_set_config>()
.path_from::<crate::software::web::__path_set_resolvables>()
.build()
}
fn components(&self) -> Components {
ComponentsBuilder::new()
.schema_from::<agama_lib::product::Product>()
.schema_from::<agama_lib::software::Pattern>()
.schema_from::<agama_lib::software::SelectedBy>()
.schema_from::<agama_lib::software::model::LanguageTag>()
.schema_from::<agama_lib::software::model::License>()
.schema_from::<agama_lib::software::model::LicenseContent>()
.schema_from::<agama_lib::software::model::RegistrationError>()
.schema_from::<agama_lib::software::model::RegistrationInfo>()
.schema_from::<agama_lib::software::model::RegistrationParams>()
.schema_from::<agama_lib::software::model::Repository>()
.schema_from::<agama_lib::software::model::RepositoryParams>()
.schema_from::<agama_lib::software::model::ResolvableParams>()
.schema_from::<agama_lib::software::model::ResolvableType>()
.schema_from::<agama_lib::software::model::SoftwareConfig>()
.schema_from::<crate::software::web::SoftwareProposal>()
.build()
}
fn nested(&self) -> Option<OpenApi> {
let status = ServiceStatusApiDocBuilder::new("/api/storage/status").build();
Some(status)
}
}