Skip to main content

aws_sdk_securityagent/operation/create_pentest/
_create_pentest_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Input for creating a new pentest
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreatePentestInput {
7    /// Title of the pentest
8    pub title: ::std::option::Option<::std::string::String>,
9    /// ID of the agent space where the pentest should be created
10    pub agent_space_id: ::std::option::Option<::std::string::String>,
11    /// Assets to be tested during the pentest
12    pub assets: ::std::option::Option<crate::types::Assets>,
13    /// A list of risk types excluded from the pentest execution
14    pub exclude_risk_types: ::std::option::Option<::std::vec::Vec<crate::types::RiskType>>,
15    /// Service role ARN for accessing customer resources
16    pub service_role: ::std::option::Option<::std::string::String>,
17    /// CloudWatch log group and stream prefix where pentest execution logs are stored
18    pub log_config: ::std::option::Option<crate::types::CloudWatchLog>,
19    /// VPC configuration that the Security Agent accesses
20    pub vpc_config: ::std::option::Option<crate::types::VpcConfig>,
21    /// Configuration for network traffic filtering
22    pub network_traffic_config: ::std::option::Option<crate::types::NetworkTrafficConfig>,
23    /// Strategy for code remediation on findings
24    pub code_remediation_strategy: ::std::option::Option<crate::types::CodeRemediationStrategy>,
25}
26impl CreatePentestInput {
27    /// Title of the pentest
28    pub fn title(&self) -> ::std::option::Option<&str> {
29        self.title.as_deref()
30    }
31    /// ID of the agent space where the pentest should be created
32    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
33        self.agent_space_id.as_deref()
34    }
35    /// Assets to be tested during the pentest
36    pub fn assets(&self) -> ::std::option::Option<&crate::types::Assets> {
37        self.assets.as_ref()
38    }
39    /// A list of risk types excluded from the pentest execution
40    ///
41    /// 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()`.
42    pub fn exclude_risk_types(&self) -> &[crate::types::RiskType] {
43        self.exclude_risk_types.as_deref().unwrap_or_default()
44    }
45    /// Service role ARN for accessing customer resources
46    pub fn service_role(&self) -> ::std::option::Option<&str> {
47        self.service_role.as_deref()
48    }
49    /// CloudWatch log group and stream prefix where pentest execution logs are stored
50    pub fn log_config(&self) -> ::std::option::Option<&crate::types::CloudWatchLog> {
51        self.log_config.as_ref()
52    }
53    /// VPC configuration that the Security Agent accesses
54    pub fn vpc_config(&self) -> ::std::option::Option<&crate::types::VpcConfig> {
55        self.vpc_config.as_ref()
56    }
57    /// Configuration for network traffic filtering
58    pub fn network_traffic_config(&self) -> ::std::option::Option<&crate::types::NetworkTrafficConfig> {
59        self.network_traffic_config.as_ref()
60    }
61    /// Strategy for code remediation on findings
62    pub fn code_remediation_strategy(&self) -> ::std::option::Option<&crate::types::CodeRemediationStrategy> {
63        self.code_remediation_strategy.as_ref()
64    }
65}
66impl CreatePentestInput {
67    /// Creates a new builder-style object to manufacture [`CreatePentestInput`](crate::operation::create_pentest::CreatePentestInput).
68    pub fn builder() -> crate::operation::create_pentest::builders::CreatePentestInputBuilder {
69        crate::operation::create_pentest::builders::CreatePentestInputBuilder::default()
70    }
71}
72
73/// A builder for [`CreatePentestInput`](crate::operation::create_pentest::CreatePentestInput).
74#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
75#[non_exhaustive]
76pub struct CreatePentestInputBuilder {
77    pub(crate) title: ::std::option::Option<::std::string::String>,
78    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
79    pub(crate) assets: ::std::option::Option<crate::types::Assets>,
80    pub(crate) exclude_risk_types: ::std::option::Option<::std::vec::Vec<crate::types::RiskType>>,
81    pub(crate) service_role: ::std::option::Option<::std::string::String>,
82    pub(crate) log_config: ::std::option::Option<crate::types::CloudWatchLog>,
83    pub(crate) vpc_config: ::std::option::Option<crate::types::VpcConfig>,
84    pub(crate) network_traffic_config: ::std::option::Option<crate::types::NetworkTrafficConfig>,
85    pub(crate) code_remediation_strategy: ::std::option::Option<crate::types::CodeRemediationStrategy>,
86}
87impl CreatePentestInputBuilder {
88    /// Title of the pentest
89    /// This field is required.
90    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.title = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// Title of the pentest
95    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.title = input;
97        self
98    }
99    /// Title of the pentest
100    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
101        &self.title
102    }
103    /// ID of the agent space where the pentest should be created
104    /// This field is required.
105    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.agent_space_id = ::std::option::Option::Some(input.into());
107        self
108    }
109    /// ID of the agent space where the pentest should be created
110    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.agent_space_id = input;
112        self
113    }
114    /// ID of the agent space where the pentest should be created
115    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
116        &self.agent_space_id
117    }
118    /// Assets to be tested during the pentest
119    pub fn assets(mut self, input: crate::types::Assets) -> Self {
120        self.assets = ::std::option::Option::Some(input);
121        self
122    }
123    /// Assets to be tested during the pentest
124    pub fn set_assets(mut self, input: ::std::option::Option<crate::types::Assets>) -> Self {
125        self.assets = input;
126        self
127    }
128    /// Assets to be tested during the pentest
129    pub fn get_assets(&self) -> &::std::option::Option<crate::types::Assets> {
130        &self.assets
131    }
132    /// Appends an item to `exclude_risk_types`.
133    ///
134    /// To override the contents of this collection use [`set_exclude_risk_types`](Self::set_exclude_risk_types).
135    ///
136    /// A list of risk types excluded from the pentest execution
137    pub fn exclude_risk_types(mut self, input: crate::types::RiskType) -> Self {
138        let mut v = self.exclude_risk_types.unwrap_or_default();
139        v.push(input);
140        self.exclude_risk_types = ::std::option::Option::Some(v);
141        self
142    }
143    /// A list of risk types excluded from the pentest execution
144    pub fn set_exclude_risk_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RiskType>>) -> Self {
145        self.exclude_risk_types = input;
146        self
147    }
148    /// A list of risk types excluded from the pentest execution
149    pub fn get_exclude_risk_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RiskType>> {
150        &self.exclude_risk_types
151    }
152    /// Service role ARN for accessing customer resources
153    pub fn service_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.service_role = ::std::option::Option::Some(input.into());
155        self
156    }
157    /// Service role ARN for accessing customer resources
158    pub fn set_service_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.service_role = input;
160        self
161    }
162    /// Service role ARN for accessing customer resources
163    pub fn get_service_role(&self) -> &::std::option::Option<::std::string::String> {
164        &self.service_role
165    }
166    /// CloudWatch log group and stream prefix where pentest execution logs are stored
167    pub fn log_config(mut self, input: crate::types::CloudWatchLog) -> Self {
168        self.log_config = ::std::option::Option::Some(input);
169        self
170    }
171    /// CloudWatch log group and stream prefix where pentest execution logs are stored
172    pub fn set_log_config(mut self, input: ::std::option::Option<crate::types::CloudWatchLog>) -> Self {
173        self.log_config = input;
174        self
175    }
176    /// CloudWatch log group and stream prefix where pentest execution logs are stored
177    pub fn get_log_config(&self) -> &::std::option::Option<crate::types::CloudWatchLog> {
178        &self.log_config
179    }
180    /// VPC configuration that the Security Agent accesses
181    pub fn vpc_config(mut self, input: crate::types::VpcConfig) -> Self {
182        self.vpc_config = ::std::option::Option::Some(input);
183        self
184    }
185    /// VPC configuration that the Security Agent accesses
186    pub fn set_vpc_config(mut self, input: ::std::option::Option<crate::types::VpcConfig>) -> Self {
187        self.vpc_config = input;
188        self
189    }
190    /// VPC configuration that the Security Agent accesses
191    pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::VpcConfig> {
192        &self.vpc_config
193    }
194    /// Configuration for network traffic filtering
195    pub fn network_traffic_config(mut self, input: crate::types::NetworkTrafficConfig) -> Self {
196        self.network_traffic_config = ::std::option::Option::Some(input);
197        self
198    }
199    /// Configuration for network traffic filtering
200    pub fn set_network_traffic_config(mut self, input: ::std::option::Option<crate::types::NetworkTrafficConfig>) -> Self {
201        self.network_traffic_config = input;
202        self
203    }
204    /// Configuration for network traffic filtering
205    pub fn get_network_traffic_config(&self) -> &::std::option::Option<crate::types::NetworkTrafficConfig> {
206        &self.network_traffic_config
207    }
208    /// Strategy for code remediation on findings
209    pub fn code_remediation_strategy(mut self, input: crate::types::CodeRemediationStrategy) -> Self {
210        self.code_remediation_strategy = ::std::option::Option::Some(input);
211        self
212    }
213    /// Strategy for code remediation on findings
214    pub fn set_code_remediation_strategy(mut self, input: ::std::option::Option<crate::types::CodeRemediationStrategy>) -> Self {
215        self.code_remediation_strategy = input;
216        self
217    }
218    /// Strategy for code remediation on findings
219    pub fn get_code_remediation_strategy(&self) -> &::std::option::Option<crate::types::CodeRemediationStrategy> {
220        &self.code_remediation_strategy
221    }
222    /// Consumes the builder and constructs a [`CreatePentestInput`](crate::operation::create_pentest::CreatePentestInput).
223    pub fn build(
224        self,
225    ) -> ::std::result::Result<crate::operation::create_pentest::CreatePentestInput, ::aws_smithy_types::error::operation::BuildError> {
226        ::std::result::Result::Ok(crate::operation::create_pentest::CreatePentestInput {
227            title: self.title,
228            agent_space_id: self.agent_space_id,
229            assets: self.assets,
230            exclude_risk_types: self.exclude_risk_types,
231            service_role: self.service_role,
232            log_config: self.log_config,
233            vpc_config: self.vpc_config,
234            network_traffic_config: self.network_traffic_config,
235            code_remediation_strategy: self.code_remediation_strategy,
236        })
237    }
238}