google_cloud_containeranalysis_v1/
model.rs1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate grafeas;
25extern crate iam_v1;
26extern crate lazy_static;
27extern crate reqwest;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct ExportSBOMRequest {
44 pub name: std::string::String,
47
48 pub target: std::option::Option<crate::model::export_sbom_request::Target>,
50
51 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
52}
53
54impl ExportSBOMRequest {
55 pub fn new() -> Self {
56 std::default::Default::default()
57 }
58
59 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
61 self.name = v.into();
62 self
63 }
64
65 pub fn set_target<
70 T: std::convert::Into<std::option::Option<crate::model::export_sbom_request::Target>>,
71 >(
72 mut self,
73 v: T,
74 ) -> Self {
75 self.target = v.into();
76 self
77 }
78
79 pub fn cloud_storage_location(
83 &self,
84 ) -> std::option::Option<
85 &std::boxed::Box<crate::model::export_sbom_request::CloudStorageLocation>,
86 > {
87 #[allow(unreachable_patterns)]
88 self.target.as_ref().and_then(|v| match v {
89 crate::model::export_sbom_request::Target::CloudStorageLocation(v) => {
90 std::option::Option::Some(v)
91 }
92 _ => std::option::Option::None,
93 })
94 }
95
96 pub fn set_cloud_storage_location<
102 T: std::convert::Into<
103 std::boxed::Box<crate::model::export_sbom_request::CloudStorageLocation>,
104 >,
105 >(
106 mut self,
107 v: T,
108 ) -> Self {
109 self.target = std::option::Option::Some(
110 crate::model::export_sbom_request::Target::CloudStorageLocation(v.into()),
111 );
112 self
113 }
114}
115
116impl wkt::message::Message for ExportSBOMRequest {
117 fn typename() -> &'static str {
118 "type.googleapis.com/google.devtools.containeranalysis.v1.ExportSBOMRequest"
119 }
120}
121
122pub mod export_sbom_request {
124 #[allow(unused_imports)]
125 use super::*;
126
127 #[derive(Clone, Default, PartialEq)]
130 #[non_exhaustive]
131 pub struct CloudStorageLocation {
132 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
133 }
134
135 impl CloudStorageLocation {
136 pub fn new() -> Self {
137 std::default::Default::default()
138 }
139 }
140
141 impl wkt::message::Message for CloudStorageLocation {
142 fn typename() -> &'static str {
143 "type.googleapis.com/google.devtools.containeranalysis.v1.ExportSBOMRequest.CloudStorageLocation"
144 }
145 }
146
147 #[derive(Clone, Debug, PartialEq)]
149 #[non_exhaustive]
150 pub enum Target {
151 CloudStorageLocation(
154 std::boxed::Box<crate::model::export_sbom_request::CloudStorageLocation>,
155 ),
156 }
157}
158
159#[derive(Clone, Default, PartialEq)]
161#[non_exhaustive]
162pub struct ExportSBOMResponse {
163 pub discovery_occurrence: std::string::String,
167
168 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
169}
170
171impl ExportSBOMResponse {
172 pub fn new() -> Self {
173 std::default::Default::default()
174 }
175
176 pub fn set_discovery_occurrence<T: std::convert::Into<std::string::String>>(
178 mut self,
179 v: T,
180 ) -> Self {
181 self.discovery_occurrence = v.into();
182 self
183 }
184}
185
186impl wkt::message::Message for ExportSBOMResponse {
187 fn typename() -> &'static str {
188 "type.googleapis.com/google.devtools.containeranalysis.v1.ExportSBOMResponse"
189 }
190}
191
192#[derive(Clone, Default, PartialEq)]
194#[non_exhaustive]
195pub struct GetVulnerabilityOccurrencesSummaryRequest {
196 pub parent: std::string::String,
199
200 pub filter: std::string::String,
202
203 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
204}
205
206impl GetVulnerabilityOccurrencesSummaryRequest {
207 pub fn new() -> Self {
208 std::default::Default::default()
209 }
210
211 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
213 self.parent = v.into();
214 self
215 }
216
217 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
219 self.filter = v.into();
220 self
221 }
222}
223
224impl wkt::message::Message for GetVulnerabilityOccurrencesSummaryRequest {
225 fn typename() -> &'static str {
226 "type.googleapis.com/google.devtools.containeranalysis.v1.GetVulnerabilityOccurrencesSummaryRequest"
227 }
228}
229
230#[derive(Clone, Default, PartialEq)]
233#[non_exhaustive]
234pub struct VulnerabilityOccurrencesSummary {
235 pub counts:
237 std::vec::Vec<crate::model::vulnerability_occurrences_summary::FixableTotalByDigest>,
238
239 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
240}
241
242impl VulnerabilityOccurrencesSummary {
243 pub fn new() -> Self {
244 std::default::Default::default()
245 }
246
247 pub fn set_counts<T, V>(mut self, v: T) -> Self
249 where
250 T: std::iter::IntoIterator<Item = V>,
251 V: std::convert::Into<
252 crate::model::vulnerability_occurrences_summary::FixableTotalByDigest,
253 >,
254 {
255 use std::iter::Iterator;
256 self.counts = v.into_iter().map(|i| i.into()).collect();
257 self
258 }
259}
260
261impl wkt::message::Message for VulnerabilityOccurrencesSummary {
262 fn typename() -> &'static str {
263 "type.googleapis.com/google.devtools.containeranalysis.v1.VulnerabilityOccurrencesSummary"
264 }
265}
266
267pub mod vulnerability_occurrences_summary {
269 #[allow(unused_imports)]
270 use super::*;
271
272 #[derive(Clone, Default, PartialEq)]
274 #[non_exhaustive]
275 pub struct FixableTotalByDigest {
276 pub resource_uri: std::string::String,
278
279 pub severity: grafeas::model::Severity,
282
283 pub fixable_count: i64,
285
286 pub total_count: i64,
288
289 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
290 }
291
292 impl FixableTotalByDigest {
293 pub fn new() -> Self {
294 std::default::Default::default()
295 }
296
297 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(
299 mut self,
300 v: T,
301 ) -> Self {
302 self.resource_uri = v.into();
303 self
304 }
305
306 pub fn set_severity<T: std::convert::Into<grafeas::model::Severity>>(
308 mut self,
309 v: T,
310 ) -> Self {
311 self.severity = v.into();
312 self
313 }
314
315 pub fn set_fixable_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
317 self.fixable_count = v.into();
318 self
319 }
320
321 pub fn set_total_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
323 self.total_count = v.into();
324 self
325 }
326 }
327
328 impl wkt::message::Message for FixableTotalByDigest {
329 fn typename() -> &'static str {
330 "type.googleapis.com/google.devtools.containeranalysis.v1.VulnerabilityOccurrencesSummary.FixableTotalByDigest"
331 }
332 }
333}