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/// <p>Input for creating a new pentest.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreatePentestInput {
7    /// <p>The title of the pentest.</p>
8    pub title: ::std::option::Option<::std::string::String>,
9    /// <p>The unique identifier of the agent space to create the pentest in.</p>
10    pub agent_space_id: ::std::option::Option<::std::string::String>,
11    /// <p>The assets to include in the pentest, such as endpoints, actors, documents, and source code.</p>
12    pub assets: ::std::option::Option<crate::types::Assets>,
13    /// <p>The list of risk types to exclude from the pentest.</p>
14    pub exclude_risk_types: ::std::option::Option<::std::vec::Vec<crate::types::RiskType>>,
15    /// <p>The IAM service role to use for the pentest.</p>
16    pub service_role: ::std::option::Option<::std::string::String>,
17    /// <p>The CloudWatch Logs configuration for the pentest.</p>
18    pub log_config: ::std::option::Option<crate::types::CloudWatchLog>,
19    /// <p>The VPC configuration for the pentest.</p>
20    pub vpc_config: ::std::option::Option<crate::types::VpcConfig>,
21    /// <p>The network traffic configuration for the pentest, including custom headers and traffic rules.</p>
22    pub network_traffic_config: ::std::option::Option<crate::types::NetworkTrafficConfig>,
23    /// <p>The code remediation strategy for the pentest. Valid values are AUTOMATIC and DISABLED.</p>
24    pub code_remediation_strategy: ::std::option::Option<crate::types::CodeRemediationStrategy>,
25}
26impl CreatePentestInput {
27    /// <p>The title of the pentest.</p>
28    pub fn title(&self) -> ::std::option::Option<&str> {
29        self.title.as_deref()
30    }
31    /// <p>The unique identifier of the agent space to create the pentest in.</p>
32    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
33        self.agent_space_id.as_deref()
34    }
35    /// <p>The assets to include in the pentest, such as endpoints, actors, documents, and source code.</p>
36    pub fn assets(&self) -> ::std::option::Option<&crate::types::Assets> {
37        self.assets.as_ref()
38    }
39    /// <p>The list of risk types to exclude from the pentest.</p>
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    /// <p>The IAM service role to use for the pentest.</p>
46    pub fn service_role(&self) -> ::std::option::Option<&str> {
47        self.service_role.as_deref()
48    }
49    /// <p>The CloudWatch Logs configuration for the pentest.</p>
50    pub fn log_config(&self) -> ::std::option::Option<&crate::types::CloudWatchLog> {
51        self.log_config.as_ref()
52    }
53    /// <p>The VPC configuration for the pentest.</p>
54    pub fn vpc_config(&self) -> ::std::option::Option<&crate::types::VpcConfig> {
55        self.vpc_config.as_ref()
56    }
57    /// <p>The network traffic configuration for the pentest, including custom headers and traffic rules.</p>
58    pub fn network_traffic_config(&self) -> ::std::option::Option<&crate::types::NetworkTrafficConfig> {
59        self.network_traffic_config.as_ref()
60    }
61    /// <p>The code remediation strategy for the pentest. Valid values are AUTOMATIC and DISABLED.</p>
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    /// <p>The title of the pentest.</p>
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    /// <p>The title of the pentest.</p>
95    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.title = input;
97        self
98    }
99    /// <p>The title of the pentest.</p>
100    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
101        &self.title
102    }
103    /// <p>The unique identifier of the agent space to create the pentest in.</p>
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    /// <p>The unique identifier of the agent space to create the pentest in.</p>
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    /// <p>The unique identifier of the agent space to create the pentest in.</p>
115    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
116        &self.agent_space_id
117    }
118    /// <p>The assets to include in the pentest, such as endpoints, actors, documents, and source code.</p>
119    pub fn assets(mut self, input: crate::types::Assets) -> Self {
120        self.assets = ::std::option::Option::Some(input);
121        self
122    }
123    /// <p>The assets to include in the pentest, such as endpoints, actors, documents, and source code.</p>
124    pub fn set_assets(mut self, input: ::std::option::Option<crate::types::Assets>) -> Self {
125        self.assets = input;
126        self
127    }
128    /// <p>The assets to include in the pentest, such as endpoints, actors, documents, and source code.</p>
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    /// <p>The list of risk types to exclude from the pentest.</p>
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    /// <p>The list of risk types to exclude from the pentest.</p>
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    /// <p>The list of risk types to exclude from the pentest.</p>
149    pub fn get_exclude_risk_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RiskType>> {
150        &self.exclude_risk_types
151    }
152    /// <p>The IAM service role to use for the pentest.</p>
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    /// <p>The IAM service role to use for the pentest.</p>
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    /// <p>The IAM service role to use for the pentest.</p>
163    pub fn get_service_role(&self) -> &::std::option::Option<::std::string::String> {
164        &self.service_role
165    }
166    /// <p>The CloudWatch Logs configuration for the pentest.</p>
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    /// <p>The CloudWatch Logs configuration for the pentest.</p>
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    /// <p>The CloudWatch Logs configuration for the pentest.</p>
177    pub fn get_log_config(&self) -> &::std::option::Option<crate::types::CloudWatchLog> {
178        &self.log_config
179    }
180    /// <p>The VPC configuration for the pentest.</p>
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    /// <p>The VPC configuration for the pentest.</p>
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    /// <p>The VPC configuration for the pentest.</p>
191    pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::VpcConfig> {
192        &self.vpc_config
193    }
194    /// <p>The network traffic configuration for the pentest, including custom headers and traffic rules.</p>
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    /// <p>The network traffic configuration for the pentest, including custom headers and traffic rules.</p>
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    /// <p>The network traffic configuration for the pentest, including custom headers and traffic rules.</p>
205    pub fn get_network_traffic_config(&self) -> &::std::option::Option<crate::types::NetworkTrafficConfig> {
206        &self.network_traffic_config
207    }
208    /// <p>The code remediation strategy for the pentest. Valid values are AUTOMATIC and DISABLED.</p>
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    /// <p>The code remediation strategy for the pentest. Valid values are AUTOMATIC and DISABLED.</p>
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    /// <p>The code remediation strategy for the pentest. Valid values are AUTOMATIC and DISABLED.</p>
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}