#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Pentest {
pub pentest_id: ::std::string::String,
pub agent_space_id: ::std::string::String,
pub title: ::std::string::String,
pub assets: ::std::option::Option<crate::types::Assets>,
pub exclude_risk_types: ::std::option::Option<::std::vec::Vec<crate::types::RiskType>>,
pub service_role: ::std::option::Option<::std::string::String>,
pub log_config: ::std::option::Option<crate::types::CloudWatchLog>,
pub vpc_config: ::std::option::Option<crate::types::VpcConfig>,
pub network_traffic_config: ::std::option::Option<crate::types::NetworkTrafficConfig>,
pub code_remediation_strategy: ::std::option::Option<crate::types::CodeRemediationStrategy>,
pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl Pentest {
pub fn pentest_id(&self) -> &str {
use std::ops::Deref;
self.pentest_id.deref()
}
pub fn agent_space_id(&self) -> &str {
use std::ops::Deref;
self.agent_space_id.deref()
}
pub fn title(&self) -> &str {
use std::ops::Deref;
self.title.deref()
}
pub fn assets(&self) -> ::std::option::Option<&crate::types::Assets> {
self.assets.as_ref()
}
pub fn exclude_risk_types(&self) -> &[crate::types::RiskType] {
self.exclude_risk_types.as_deref().unwrap_or_default()
}
pub fn service_role(&self) -> ::std::option::Option<&str> {
self.service_role.as_deref()
}
pub fn log_config(&self) -> ::std::option::Option<&crate::types::CloudWatchLog> {
self.log_config.as_ref()
}
pub fn vpc_config(&self) -> ::std::option::Option<&crate::types::VpcConfig> {
self.vpc_config.as_ref()
}
pub fn network_traffic_config(&self) -> ::std::option::Option<&crate::types::NetworkTrafficConfig> {
self.network_traffic_config.as_ref()
}
pub fn code_remediation_strategy(&self) -> ::std::option::Option<&crate::types::CodeRemediationStrategy> {
self.code_remediation_strategy.as_ref()
}
pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.created_at.as_ref()
}
pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.updated_at.as_ref()
}
}
impl Pentest {
pub fn builder() -> crate::types::builders::PentestBuilder {
crate::types::builders::PentestBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PentestBuilder {
pub(crate) pentest_id: ::std::option::Option<::std::string::String>,
pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
pub(crate) title: ::std::option::Option<::std::string::String>,
pub(crate) assets: ::std::option::Option<crate::types::Assets>,
pub(crate) exclude_risk_types: ::std::option::Option<::std::vec::Vec<crate::types::RiskType>>,
pub(crate) service_role: ::std::option::Option<::std::string::String>,
pub(crate) log_config: ::std::option::Option<crate::types::CloudWatchLog>,
pub(crate) vpc_config: ::std::option::Option<crate::types::VpcConfig>,
pub(crate) network_traffic_config: ::std::option::Option<crate::types::NetworkTrafficConfig>,
pub(crate) code_remediation_strategy: ::std::option::Option<crate::types::CodeRemediationStrategy>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl PentestBuilder {
pub fn pentest_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.pentest_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_pentest_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.pentest_id = input;
self
}
pub fn get_pentest_id(&self) -> &::std::option::Option<::std::string::String> {
&self.pentest_id
}
pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.agent_space_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.agent_space_id = input;
self
}
pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
&self.agent_space_id
}
pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.title = ::std::option::Option::Some(input.into());
self
}
pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.title = input;
self
}
pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
&self.title
}
pub fn assets(mut self, input: crate::types::Assets) -> Self {
self.assets = ::std::option::Option::Some(input);
self
}
pub fn set_assets(mut self, input: ::std::option::Option<crate::types::Assets>) -> Self {
self.assets = input;
self
}
pub fn get_assets(&self) -> &::std::option::Option<crate::types::Assets> {
&self.assets
}
pub fn exclude_risk_types(mut self, input: crate::types::RiskType) -> Self {
let mut v = self.exclude_risk_types.unwrap_or_default();
v.push(input);
self.exclude_risk_types = ::std::option::Option::Some(v);
self
}
pub fn set_exclude_risk_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RiskType>>) -> Self {
self.exclude_risk_types = input;
self
}
pub fn get_exclude_risk_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RiskType>> {
&self.exclude_risk_types
}
pub fn service_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.service_role = ::std::option::Option::Some(input.into());
self
}
pub fn set_service_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.service_role = input;
self
}
pub fn get_service_role(&self) -> &::std::option::Option<::std::string::String> {
&self.service_role
}
pub fn log_config(mut self, input: crate::types::CloudWatchLog) -> Self {
self.log_config = ::std::option::Option::Some(input);
self
}
pub fn set_log_config(mut self, input: ::std::option::Option<crate::types::CloudWatchLog>) -> Self {
self.log_config = input;
self
}
pub fn get_log_config(&self) -> &::std::option::Option<crate::types::CloudWatchLog> {
&self.log_config
}
pub fn vpc_config(mut self, input: crate::types::VpcConfig) -> Self {
self.vpc_config = ::std::option::Option::Some(input);
self
}
pub fn set_vpc_config(mut self, input: ::std::option::Option<crate::types::VpcConfig>) -> Self {
self.vpc_config = input;
self
}
pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::VpcConfig> {
&self.vpc_config
}
pub fn network_traffic_config(mut self, input: crate::types::NetworkTrafficConfig) -> Self {
self.network_traffic_config = ::std::option::Option::Some(input);
self
}
pub fn set_network_traffic_config(mut self, input: ::std::option::Option<crate::types::NetworkTrafficConfig>) -> Self {
self.network_traffic_config = input;
self
}
pub fn get_network_traffic_config(&self) -> &::std::option::Option<crate::types::NetworkTrafficConfig> {
&self.network_traffic_config
}
pub fn code_remediation_strategy(mut self, input: crate::types::CodeRemediationStrategy) -> Self {
self.code_remediation_strategy = ::std::option::Option::Some(input);
self
}
pub fn set_code_remediation_strategy(mut self, input: ::std::option::Option<crate::types::CodeRemediationStrategy>) -> Self {
self.code_remediation_strategy = input;
self
}
pub fn get_code_remediation_strategy(&self) -> &::std::option::Option<crate::types::CodeRemediationStrategy> {
&self.code_remediation_strategy
}
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_at
}
pub fn build(self) -> ::std::result::Result<crate::types::Pentest, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Pentest {
pentest_id: self.pentest_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"pentest_id",
"pentest_id was not specified but it is required when building Pentest",
)
})?,
agent_space_id: self.agent_space_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"agent_space_id",
"agent_space_id was not specified but it is required when building Pentest",
)
})?,
title: self.title.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"title",
"title was not specified but it is required when building Pentest",
)
})?,
assets: self.assets,
exclude_risk_types: self.exclude_risk_types,
service_role: self.service_role,
log_config: self.log_config,
vpc_config: self.vpc_config,
network_traffic_config: self.network_traffic_config,
code_remediation_strategy: self.code_remediation_strategy,
created_at: self.created_at,
updated_at: self.updated_at,
})
}
}