aws-sdk-securityagent 1.1.0

AWS SDK for AWS Security Agent
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// Represents a pentest configuration and execution details
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Pentest {
    /// Unique identifier for the pentest
    pub pentest_id: ::std::string::String,
    /// ID of the agent space where the pentest exists
    pub agent_space_id: ::std::string::String,
    /// Title or name of the pentest
    pub title: ::std::string::String,
    /// Collection of assets to be tested or used during the pentest
    pub assets: ::std::option::Option<crate::types::Assets>,
    /// A list of risk types excluded from the pentest execution
    pub exclude_risk_types: ::std::option::Option<::std::vec::Vec<crate::types::RiskType>>,
    /// Service role ARN for accessing customer resources
    pub service_role: ::std::option::Option<::std::string::String>,
    /// CloudWatch log group and stream prefix where pentest execution logs are stored
    pub log_config: ::std::option::Option<crate::types::CloudWatchLog>,
    /// VPC configuration that the Security Agent accesses
    pub vpc_config: ::std::option::Option<crate::types::VpcConfig>,
    /// Configuration for network traffic filtering
    pub network_traffic_config: ::std::option::Option<crate::types::NetworkTrafficConfig>,
    /// Strategy for code remediation on findings
    pub code_remediation_strategy: ::std::option::Option<crate::types::CodeRemediationStrategy>,
    /// Timestamp when the pentest was created
    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// Timestamp when the pentest was last updated
    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl Pentest {
    /// Unique identifier for the pentest
    pub fn pentest_id(&self) -> &str {
        use std::ops::Deref;
        self.pentest_id.deref()
    }
    /// ID of the agent space where the pentest exists
    pub fn agent_space_id(&self) -> &str {
        use std::ops::Deref;
        self.agent_space_id.deref()
    }
    /// Title or name of the pentest
    pub fn title(&self) -> &str {
        use std::ops::Deref;
        self.title.deref()
    }
    /// Collection of assets to be tested or used during the pentest
    pub fn assets(&self) -> ::std::option::Option<&crate::types::Assets> {
        self.assets.as_ref()
    }
    /// A list of risk types excluded from the pentest execution
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.exclude_risk_types.is_none()`.
    pub fn exclude_risk_types(&self) -> &[crate::types::RiskType] {
        self.exclude_risk_types.as_deref().unwrap_or_default()
    }
    /// Service role ARN for accessing customer resources
    pub fn service_role(&self) -> ::std::option::Option<&str> {
        self.service_role.as_deref()
    }
    /// CloudWatch log group and stream prefix where pentest execution logs are stored
    pub fn log_config(&self) -> ::std::option::Option<&crate::types::CloudWatchLog> {
        self.log_config.as_ref()
    }
    /// VPC configuration that the Security Agent accesses
    pub fn vpc_config(&self) -> ::std::option::Option<&crate::types::VpcConfig> {
        self.vpc_config.as_ref()
    }
    /// Configuration for network traffic filtering
    pub fn network_traffic_config(&self) -> ::std::option::Option<&crate::types::NetworkTrafficConfig> {
        self.network_traffic_config.as_ref()
    }
    /// Strategy for code remediation on findings
    pub fn code_remediation_strategy(&self) -> ::std::option::Option<&crate::types::CodeRemediationStrategy> {
        self.code_remediation_strategy.as_ref()
    }
    /// Timestamp when the pentest was created
    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_at.as_ref()
    }
    /// Timestamp when the pentest was last updated
    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.updated_at.as_ref()
    }
}
impl Pentest {
    /// Creates a new builder-style object to manufacture [`Pentest`](crate::types::Pentest).
    pub fn builder() -> crate::types::builders::PentestBuilder {
        crate::types::builders::PentestBuilder::default()
    }
}

/// A builder for [`Pentest`](crate::types::Pentest).
#[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 {
    /// Unique identifier for the pentest
    /// This field is required.
    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
    }
    /// Unique identifier for the pentest
    pub fn set_pentest_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.pentest_id = input;
        self
    }
    /// Unique identifier for the pentest
    pub fn get_pentest_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.pentest_id
    }
    /// ID of the agent space where the pentest exists
    /// This field is required.
    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
    }
    /// ID of the agent space where the pentest exists
    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_space_id = input;
        self
    }
    /// ID of the agent space where the pentest exists
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_space_id
    }
    /// Title or name of the pentest
    /// This field is required.
    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.title = ::std::option::Option::Some(input.into());
        self
    }
    /// Title or name of the pentest
    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.title = input;
        self
    }
    /// Title or name of the pentest
    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
        &self.title
    }
    /// Collection of assets to be tested or used during the pentest
    /// This field is required.
    pub fn assets(mut self, input: crate::types::Assets) -> Self {
        self.assets = ::std::option::Option::Some(input);
        self
    }
    /// Collection of assets to be tested or used during the pentest
    pub fn set_assets(mut self, input: ::std::option::Option<crate::types::Assets>) -> Self {
        self.assets = input;
        self
    }
    /// Collection of assets to be tested or used during the pentest
    pub fn get_assets(&self) -> &::std::option::Option<crate::types::Assets> {
        &self.assets
    }
    /// Appends an item to `exclude_risk_types`.
    ///
    /// To override the contents of this collection use [`set_exclude_risk_types`](Self::set_exclude_risk_types).
    ///
    /// A list of risk types excluded from the pentest execution
    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
    }
    /// A list of risk types excluded from the pentest execution
    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
    }
    /// A list of risk types excluded from the pentest execution
    pub fn get_exclude_risk_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RiskType>> {
        &self.exclude_risk_types
    }
    /// Service role ARN for accessing customer resources
    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
    }
    /// Service role ARN for accessing customer resources
    pub fn set_service_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.service_role = input;
        self
    }
    /// Service role ARN for accessing customer resources
    pub fn get_service_role(&self) -> &::std::option::Option<::std::string::String> {
        &self.service_role
    }
    /// CloudWatch log group and stream prefix where pentest execution logs are stored
    pub fn log_config(mut self, input: crate::types::CloudWatchLog) -> Self {
        self.log_config = ::std::option::Option::Some(input);
        self
    }
    /// CloudWatch log group and stream prefix where pentest execution logs are stored
    pub fn set_log_config(mut self, input: ::std::option::Option<crate::types::CloudWatchLog>) -> Self {
        self.log_config = input;
        self
    }
    /// CloudWatch log group and stream prefix where pentest execution logs are stored
    pub fn get_log_config(&self) -> &::std::option::Option<crate::types::CloudWatchLog> {
        &self.log_config
    }
    /// VPC configuration that the Security Agent accesses
    pub fn vpc_config(mut self, input: crate::types::VpcConfig) -> Self {
        self.vpc_config = ::std::option::Option::Some(input);
        self
    }
    /// VPC configuration that the Security Agent accesses
    pub fn set_vpc_config(mut self, input: ::std::option::Option<crate::types::VpcConfig>) -> Self {
        self.vpc_config = input;
        self
    }
    /// VPC configuration that the Security Agent accesses
    pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::VpcConfig> {
        &self.vpc_config
    }
    /// Configuration for network traffic filtering
    pub fn network_traffic_config(mut self, input: crate::types::NetworkTrafficConfig) -> Self {
        self.network_traffic_config = ::std::option::Option::Some(input);
        self
    }
    /// Configuration for network traffic filtering
    pub fn set_network_traffic_config(mut self, input: ::std::option::Option<crate::types::NetworkTrafficConfig>) -> Self {
        self.network_traffic_config = input;
        self
    }
    /// Configuration for network traffic filtering
    pub fn get_network_traffic_config(&self) -> &::std::option::Option<crate::types::NetworkTrafficConfig> {
        &self.network_traffic_config
    }
    /// Strategy for code remediation on findings
    pub fn code_remediation_strategy(mut self, input: crate::types::CodeRemediationStrategy) -> Self {
        self.code_remediation_strategy = ::std::option::Option::Some(input);
        self
    }
    /// Strategy for code remediation on findings
    pub fn set_code_remediation_strategy(mut self, input: ::std::option::Option<crate::types::CodeRemediationStrategy>) -> Self {
        self.code_remediation_strategy = input;
        self
    }
    /// Strategy for code remediation on findings
    pub fn get_code_remediation_strategy(&self) -> &::std::option::Option<crate::types::CodeRemediationStrategy> {
        &self.code_remediation_strategy
    }
    /// Timestamp when the pentest was created
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// Timestamp when the pentest was created
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// Timestamp when the pentest was created
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// Timestamp when the pentest was last updated
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// Timestamp when the pentest was last updated
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// Timestamp when the pentest was last updated
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// Consumes the builder and constructs a [`Pentest`](crate::types::Pentest).
    /// This method will fail if any of the following fields are not set:
    /// - [`pentest_id`](crate::types::builders::PentestBuilder::pentest_id)
    /// - [`agent_space_id`](crate::types::builders::PentestBuilder::agent_space_id)
    /// - [`title`](crate::types::builders::PentestBuilder::title)
    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,
        })
    }
}