#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_grafeas_v1;
extern crate google_cloud_iam_v1;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportSBOMRequest {
pub name: std::string::String,
pub target: std::option::Option<crate::model::export_sbom_request::Target>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExportSBOMRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_target<
T: std::convert::Into<std::option::Option<crate::model::export_sbom_request::Target>>,
>(
mut self,
v: T,
) -> Self {
self.target = v.into();
self
}
pub fn cloud_storage_location(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::export_sbom_request::CloudStorageLocation>,
> {
#[allow(unreachable_patterns)]
self.target.as_ref().and_then(|v| match v {
crate::model::export_sbom_request::Target::CloudStorageLocation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_cloud_storage_location<
T: std::convert::Into<
std::boxed::Box<crate::model::export_sbom_request::CloudStorageLocation>,
>,
>(
mut self,
v: T,
) -> Self {
self.target = std::option::Option::Some(
crate::model::export_sbom_request::Target::CloudStorageLocation(v.into()),
);
self
}
}
impl wkt::message::Message for ExportSBOMRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.devtools.containeranalysis.v1.ExportSBOMRequest"
}
}
pub mod export_sbom_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudStorageLocation {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudStorageLocation {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CloudStorageLocation {
fn typename() -> &'static str {
"type.googleapis.com/google.devtools.containeranalysis.v1.ExportSBOMRequest.CloudStorageLocation"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Target {
CloudStorageLocation(
std::boxed::Box<crate::model::export_sbom_request::CloudStorageLocation>,
),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportSBOMResponse {
pub discovery_occurrence: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExportSBOMResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_discovery_occurrence<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.discovery_occurrence = v.into();
self
}
}
impl wkt::message::Message for ExportSBOMResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.devtools.containeranalysis.v1.ExportSBOMResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetVulnerabilityOccurrencesSummaryRequest {
pub parent: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetVulnerabilityOccurrencesSummaryRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for GetVulnerabilityOccurrencesSummaryRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.devtools.containeranalysis.v1.GetVulnerabilityOccurrencesSummaryRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VulnerabilityOccurrencesSummary {
pub counts:
std::vec::Vec<crate::model::vulnerability_occurrences_summary::FixableTotalByDigest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VulnerabilityOccurrencesSummary {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_counts<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<
crate::model::vulnerability_occurrences_summary::FixableTotalByDigest,
>,
{
use std::iter::Iterator;
self.counts = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for VulnerabilityOccurrencesSummary {
fn typename() -> &'static str {
"type.googleapis.com/google.devtools.containeranalysis.v1.VulnerabilityOccurrencesSummary"
}
}
pub mod vulnerability_occurrences_summary {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FixableTotalByDigest {
pub resource_uri: std::string::String,
pub severity: google_cloud_grafeas_v1::model::Severity,
pub fixable_count: i64,
pub total_count: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FixableTotalByDigest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.resource_uri = v.into();
self
}
pub fn set_severity<T: std::convert::Into<google_cloud_grafeas_v1::model::Severity>>(
mut self,
v: T,
) -> Self {
self.severity = v.into();
self
}
pub fn set_fixable_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.fixable_count = v.into();
self
}
pub fn set_total_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.total_count = v.into();
self
}
}
impl wkt::message::Message for FixableTotalByDigest {
fn typename() -> &'static str {
"type.googleapis.com/google.devtools.containeranalysis.v1.VulnerabilityOccurrencesSummary.FixableTotalByDigest"
}
}
}