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
35#[serde_with::serde_as]
38#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
39#[serde(default, rename_all = "camelCase")]
40#[non_exhaustive]
41pub struct ExportSBOMRequest {
42 #[serde(skip_serializing_if = "std::string::String::is_empty")]
45 pub name: std::string::String,
46
47 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
49 pub target: std::option::Option<crate::model::export_sbom_request::Target>,
50
51 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
52 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
53}
54
55impl ExportSBOMRequest {
56 pub fn new() -> Self {
57 std::default::Default::default()
58 }
59
60 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
62 self.name = v.into();
63 self
64 }
65
66 pub fn set_target<
71 T: std::convert::Into<std::option::Option<crate::model::export_sbom_request::Target>>,
72 >(
73 mut self,
74 v: T,
75 ) -> Self {
76 self.target = v.into();
77 self
78 }
79
80 pub fn cloud_storage_location(
84 &self,
85 ) -> std::option::Option<
86 &std::boxed::Box<crate::model::export_sbom_request::CloudStorageLocation>,
87 > {
88 #[allow(unreachable_patterns)]
89 self.target.as_ref().and_then(|v| match v {
90 crate::model::export_sbom_request::Target::CloudStorageLocation(v) => {
91 std::option::Option::Some(v)
92 }
93 _ => std::option::Option::None,
94 })
95 }
96
97 pub fn set_cloud_storage_location<
103 T: std::convert::Into<
104 std::boxed::Box<crate::model::export_sbom_request::CloudStorageLocation>,
105 >,
106 >(
107 mut self,
108 v: T,
109 ) -> Self {
110 self.target = std::option::Option::Some(
111 crate::model::export_sbom_request::Target::CloudStorageLocation(v.into()),
112 );
113 self
114 }
115}
116
117impl wkt::message::Message for ExportSBOMRequest {
118 fn typename() -> &'static str {
119 "type.googleapis.com/google.devtools.containeranalysis.v1.ExportSBOMRequest"
120 }
121}
122
123pub mod export_sbom_request {
125 #[allow(unused_imports)]
126 use super::*;
127
128 #[serde_with::serde_as]
131 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
132 #[serde(default, rename_all = "camelCase")]
133 #[non_exhaustive]
134 pub struct CloudStorageLocation {
135 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
136 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
137 }
138
139 impl CloudStorageLocation {
140 pub fn new() -> Self {
141 std::default::Default::default()
142 }
143 }
144
145 impl wkt::message::Message for CloudStorageLocation {
146 fn typename() -> &'static str {
147 "type.googleapis.com/google.devtools.containeranalysis.v1.ExportSBOMRequest.CloudStorageLocation"
148 }
149 }
150
151 #[serde_with::serde_as]
153 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
154 #[serde(rename_all = "camelCase")]
155 #[non_exhaustive]
156 pub enum Target {
157 CloudStorageLocation(
160 std::boxed::Box<crate::model::export_sbom_request::CloudStorageLocation>,
161 ),
162 }
163}
164
165#[serde_with::serde_as]
167#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
168#[serde(default, rename_all = "camelCase")]
169#[non_exhaustive]
170pub struct ExportSBOMResponse {
171 #[serde(skip_serializing_if = "std::string::String::is_empty")]
175 pub discovery_occurrence: std::string::String,
176
177 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
178 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
179}
180
181impl ExportSBOMResponse {
182 pub fn new() -> Self {
183 std::default::Default::default()
184 }
185
186 pub fn set_discovery_occurrence<T: std::convert::Into<std::string::String>>(
188 mut self,
189 v: T,
190 ) -> Self {
191 self.discovery_occurrence = v.into();
192 self
193 }
194}
195
196impl wkt::message::Message for ExportSBOMResponse {
197 fn typename() -> &'static str {
198 "type.googleapis.com/google.devtools.containeranalysis.v1.ExportSBOMResponse"
199 }
200}
201
202#[serde_with::serde_as]
204#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
205#[serde(default, rename_all = "camelCase")]
206#[non_exhaustive]
207pub struct GetVulnerabilityOccurrencesSummaryRequest {
208 #[serde(skip_serializing_if = "std::string::String::is_empty")]
211 pub parent: std::string::String,
212
213 #[serde(skip_serializing_if = "std::string::String::is_empty")]
215 pub filter: std::string::String,
216
217 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
218 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
219}
220
221impl GetVulnerabilityOccurrencesSummaryRequest {
222 pub fn new() -> Self {
223 std::default::Default::default()
224 }
225
226 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
228 self.parent = v.into();
229 self
230 }
231
232 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
234 self.filter = v.into();
235 self
236 }
237}
238
239impl wkt::message::Message for GetVulnerabilityOccurrencesSummaryRequest {
240 fn typename() -> &'static str {
241 "type.googleapis.com/google.devtools.containeranalysis.v1.GetVulnerabilityOccurrencesSummaryRequest"
242 }
243}
244
245#[serde_with::serde_as]
248#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
249#[serde(default, rename_all = "camelCase")]
250#[non_exhaustive]
251pub struct VulnerabilityOccurrencesSummary {
252 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
254 pub counts:
255 std::vec::Vec<crate::model::vulnerability_occurrences_summary::FixableTotalByDigest>,
256
257 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
258 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
259}
260
261impl VulnerabilityOccurrencesSummary {
262 pub fn new() -> Self {
263 std::default::Default::default()
264 }
265
266 pub fn set_counts<T, V>(mut self, v: T) -> Self
268 where
269 T: std::iter::IntoIterator<Item = V>,
270 V: std::convert::Into<
271 crate::model::vulnerability_occurrences_summary::FixableTotalByDigest,
272 >,
273 {
274 use std::iter::Iterator;
275 self.counts = v.into_iter().map(|i| i.into()).collect();
276 self
277 }
278}
279
280impl wkt::message::Message for VulnerabilityOccurrencesSummary {
281 fn typename() -> &'static str {
282 "type.googleapis.com/google.devtools.containeranalysis.v1.VulnerabilityOccurrencesSummary"
283 }
284}
285
286pub mod vulnerability_occurrences_summary {
288 #[allow(unused_imports)]
289 use super::*;
290
291 #[serde_with::serde_as]
293 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
294 #[serde(default, rename_all = "camelCase")]
295 #[non_exhaustive]
296 pub struct FixableTotalByDigest {
297 #[serde(skip_serializing_if = "std::string::String::is_empty")]
299 pub resource_uri: std::string::String,
300
301 pub severity: grafeas::model::Severity,
304
305 #[serde(skip_serializing_if = "wkt::internal::is_default")]
307 #[serde_as(as = "serde_with::DisplayFromStr")]
308 pub fixable_count: i64,
309
310 #[serde(skip_serializing_if = "wkt::internal::is_default")]
312 #[serde_as(as = "serde_with::DisplayFromStr")]
313 pub total_count: i64,
314
315 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
316 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
317 }
318
319 impl FixableTotalByDigest {
320 pub fn new() -> Self {
321 std::default::Default::default()
322 }
323
324 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(
326 mut self,
327 v: T,
328 ) -> Self {
329 self.resource_uri = v.into();
330 self
331 }
332
333 pub fn set_severity<T: std::convert::Into<grafeas::model::Severity>>(
335 mut self,
336 v: T,
337 ) -> Self {
338 self.severity = v.into();
339 self
340 }
341
342 pub fn set_fixable_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
344 self.fixable_count = v.into();
345 self
346 }
347
348 pub fn set_total_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
350 self.total_count = v.into();
351 self
352 }
353 }
354
355 impl wkt::message::Message for FixableTotalByDigest {
356 fn typename() -> &'static str {
357 "type.googleapis.com/google.devtools.containeranalysis.v1.VulnerabilityOccurrencesSummary.FixableTotalByDigest"
358 }
359 }
360}