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    /// <p>A list of managed skills to disable for this pentest. Valid values include FINDING_PERSONALIZATION and LOGIN_OPTIMIZATION.</p>
26    pub disable_managed_skills: ::std::option::Option<::std::vec::Vec<crate::types::SkillType>>,
27}
28impl CreatePentestInput {
29    /// <p>The title of the pentest.</p>
30    pub fn title(&self) -> ::std::option::Option<&str> {
31        self.title.as_deref()
32    }
33    /// <p>The unique identifier of the agent space to create the pentest in.</p>
34    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
35        self.agent_space_id.as_deref()
36    }
37    /// <p>The assets to include in the pentest, such as endpoints, actors, documents, and source code.</p>
38    pub fn assets(&self) -> ::std::option::Option<&crate::types::Assets> {
39        self.assets.as_ref()
40    }
41    /// <p>The list of risk types to exclude from the pentest.</p>
42    ///
43    /// 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()`.
44    pub fn exclude_risk_types(&self) -> &[crate::types::RiskType] {
45        self.exclude_risk_types.as_deref().unwrap_or_default()
46    }
47    /// <p>The IAM service role to use for the pentest.</p>
48    pub fn service_role(&self) -> ::std::option::Option<&str> {
49        self.service_role.as_deref()
50    }
51    /// <p>The CloudWatch Logs configuration for the pentest.</p>
52    pub fn log_config(&self) -> ::std::option::Option<&crate::types::CloudWatchLog> {
53        self.log_config.as_ref()
54    }
55    /// <p>The VPC configuration for the pentest.</p>
56    pub fn vpc_config(&self) -> ::std::option::Option<&crate::types::VpcConfig> {
57        self.vpc_config.as_ref()
58    }
59    /// <p>The network traffic configuration for the pentest, including custom headers and traffic rules.</p>
60    pub fn network_traffic_config(&self) -> ::std::option::Option<&crate::types::NetworkTrafficConfig> {
61        self.network_traffic_config.as_ref()
62    }
63    /// <p>The code remediation strategy for the pentest. Valid values are AUTOMATIC and DISABLED.</p>
64    pub fn code_remediation_strategy(&self) -> ::std::option::Option<&crate::types::CodeRemediationStrategy> {
65        self.code_remediation_strategy.as_ref()
66    }
67    /// <p>A list of managed skills to disable for this pentest. Valid values include FINDING_PERSONALIZATION and LOGIN_OPTIMIZATION.</p>
68    ///
69    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.disable_managed_skills.is_none()`.
70    pub fn disable_managed_skills(&self) -> &[crate::types::SkillType] {
71        self.disable_managed_skills.as_deref().unwrap_or_default()
72    }
73}
74impl CreatePentestInput {
75    /// Creates a new builder-style object to manufacture [`CreatePentestInput`](crate::operation::create_pentest::CreatePentestInput).
76    pub fn builder() -> crate::operation::create_pentest::builders::CreatePentestInputBuilder {
77        crate::operation::create_pentest::builders::CreatePentestInputBuilder::default()
78    }
79}
80
81/// A builder for [`CreatePentestInput`](crate::operation::create_pentest::CreatePentestInput).
82#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
83#[non_exhaustive]
84pub struct CreatePentestInputBuilder {
85    pub(crate) title: ::std::option::Option<::std::string::String>,
86    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
87    pub(crate) assets: ::std::option::Option<crate::types::Assets>,
88    pub(crate) exclude_risk_types: ::std::option::Option<::std::vec::Vec<crate::types::RiskType>>,
89    pub(crate) service_role: ::std::option::Option<::std::string::String>,
90    pub(crate) log_config: ::std::option::Option<crate::types::CloudWatchLog>,
91    pub(crate) vpc_config: ::std::option::Option<crate::types::VpcConfig>,
92    pub(crate) network_traffic_config: ::std::option::Option<crate::types::NetworkTrafficConfig>,
93    pub(crate) code_remediation_strategy: ::std::option::Option<crate::types::CodeRemediationStrategy>,
94    pub(crate) disable_managed_skills: ::std::option::Option<::std::vec::Vec<crate::types::SkillType>>,
95}
96impl CreatePentestInputBuilder {
97    /// <p>The title of the pentest.</p>
98    /// This field is required.
99    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
100        self.title = ::std::option::Option::Some(input.into());
101        self
102    }
103    /// <p>The title of the pentest.</p>
104    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105        self.title = input;
106        self
107    }
108    /// <p>The title of the pentest.</p>
109    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
110        &self.title
111    }
112    /// <p>The unique identifier of the agent space to create the pentest in.</p>
113    /// This field is required.
114    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.agent_space_id = ::std::option::Option::Some(input.into());
116        self
117    }
118    /// <p>The unique identifier of the agent space to create the pentest in.</p>
119    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.agent_space_id = input;
121        self
122    }
123    /// <p>The unique identifier of the agent space to create the pentest in.</p>
124    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
125        &self.agent_space_id
126    }
127    /// <p>The assets to include in the pentest, such as endpoints, actors, documents, and source code.</p>
128    pub fn assets(mut self, input: crate::types::Assets) -> Self {
129        self.assets = ::std::option::Option::Some(input);
130        self
131    }
132    /// <p>The assets to include in the pentest, such as endpoints, actors, documents, and source code.</p>
133    pub fn set_assets(mut self, input: ::std::option::Option<crate::types::Assets>) -> Self {
134        self.assets = input;
135        self
136    }
137    /// <p>The assets to include in the pentest, such as endpoints, actors, documents, and source code.</p>
138    pub fn get_assets(&self) -> &::std::option::Option<crate::types::Assets> {
139        &self.assets
140    }
141    /// Appends an item to `exclude_risk_types`.
142    ///
143    /// To override the contents of this collection use [`set_exclude_risk_types`](Self::set_exclude_risk_types).
144    ///
145    /// <p>The list of risk types to exclude from the pentest.</p>
146    pub fn exclude_risk_types(mut self, input: crate::types::RiskType) -> Self {
147        let mut v = self.exclude_risk_types.unwrap_or_default();
148        v.push(input);
149        self.exclude_risk_types = ::std::option::Option::Some(v);
150        self
151    }
152    /// <p>The list of risk types to exclude from the pentest.</p>
153    pub fn set_exclude_risk_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RiskType>>) -> Self {
154        self.exclude_risk_types = input;
155        self
156    }
157    /// <p>The list of risk types to exclude from the pentest.</p>
158    pub fn get_exclude_risk_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RiskType>> {
159        &self.exclude_risk_types
160    }
161    /// <p>The IAM service role to use for the pentest.</p>
162    pub fn service_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.service_role = ::std::option::Option::Some(input.into());
164        self
165    }
166    /// <p>The IAM service role to use for the pentest.</p>
167    pub fn set_service_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.service_role = input;
169        self
170    }
171    /// <p>The IAM service role to use for the pentest.</p>
172    pub fn get_service_role(&self) -> &::std::option::Option<::std::string::String> {
173        &self.service_role
174    }
175    /// <p>The CloudWatch Logs configuration for the pentest.</p>
176    pub fn log_config(mut self, input: crate::types::CloudWatchLog) -> Self {
177        self.log_config = ::std::option::Option::Some(input);
178        self
179    }
180    /// <p>The CloudWatch Logs configuration for the pentest.</p>
181    pub fn set_log_config(mut self, input: ::std::option::Option<crate::types::CloudWatchLog>) -> Self {
182        self.log_config = input;
183        self
184    }
185    /// <p>The CloudWatch Logs configuration for the pentest.</p>
186    pub fn get_log_config(&self) -> &::std::option::Option<crate::types::CloudWatchLog> {
187        &self.log_config
188    }
189    /// <p>The VPC configuration for the pentest.</p>
190    pub fn vpc_config(mut self, input: crate::types::VpcConfig) -> Self {
191        self.vpc_config = ::std::option::Option::Some(input);
192        self
193    }
194    /// <p>The VPC configuration for the pentest.</p>
195    pub fn set_vpc_config(mut self, input: ::std::option::Option<crate::types::VpcConfig>) -> Self {
196        self.vpc_config = input;
197        self
198    }
199    /// <p>The VPC configuration for the pentest.</p>
200    pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::VpcConfig> {
201        &self.vpc_config
202    }
203    /// <p>The network traffic configuration for the pentest, including custom headers and traffic rules.</p>
204    pub fn network_traffic_config(mut self, input: crate::types::NetworkTrafficConfig) -> Self {
205        self.network_traffic_config = ::std::option::Option::Some(input);
206        self
207    }
208    /// <p>The network traffic configuration for the pentest, including custom headers and traffic rules.</p>
209    pub fn set_network_traffic_config(mut self, input: ::std::option::Option<crate::types::NetworkTrafficConfig>) -> Self {
210        self.network_traffic_config = input;
211        self
212    }
213    /// <p>The network traffic configuration for the pentest, including custom headers and traffic rules.</p>
214    pub fn get_network_traffic_config(&self) -> &::std::option::Option<crate::types::NetworkTrafficConfig> {
215        &self.network_traffic_config
216    }
217    /// <p>The code remediation strategy for the pentest. Valid values are AUTOMATIC and DISABLED.</p>
218    pub fn code_remediation_strategy(mut self, input: crate::types::CodeRemediationStrategy) -> Self {
219        self.code_remediation_strategy = ::std::option::Option::Some(input);
220        self
221    }
222    /// <p>The code remediation strategy for the pentest. Valid values are AUTOMATIC and DISABLED.</p>
223    pub fn set_code_remediation_strategy(mut self, input: ::std::option::Option<crate::types::CodeRemediationStrategy>) -> Self {
224        self.code_remediation_strategy = input;
225        self
226    }
227    /// <p>The code remediation strategy for the pentest. Valid values are AUTOMATIC and DISABLED.</p>
228    pub fn get_code_remediation_strategy(&self) -> &::std::option::Option<crate::types::CodeRemediationStrategy> {
229        &self.code_remediation_strategy
230    }
231    /// Appends an item to `disable_managed_skills`.
232    ///
233    /// To override the contents of this collection use [`set_disable_managed_skills`](Self::set_disable_managed_skills).
234    ///
235    /// <p>A list of managed skills to disable for this pentest. Valid values include FINDING_PERSONALIZATION and LOGIN_OPTIMIZATION.</p>
236    pub fn disable_managed_skills(mut self, input: crate::types::SkillType) -> Self {
237        let mut v = self.disable_managed_skills.unwrap_or_default();
238        v.push(input);
239        self.disable_managed_skills = ::std::option::Option::Some(v);
240        self
241    }
242    /// <p>A list of managed skills to disable for this pentest. Valid values include FINDING_PERSONALIZATION and LOGIN_OPTIMIZATION.</p>
243    pub fn set_disable_managed_skills(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SkillType>>) -> Self {
244        self.disable_managed_skills = input;
245        self
246    }
247    /// <p>A list of managed skills to disable for this pentest. Valid values include FINDING_PERSONALIZATION and LOGIN_OPTIMIZATION.</p>
248    pub fn get_disable_managed_skills(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SkillType>> {
249        &self.disable_managed_skills
250    }
251    /// Consumes the builder and constructs a [`CreatePentestInput`](crate::operation::create_pentest::CreatePentestInput).
252    pub fn build(
253        self,
254    ) -> ::std::result::Result<crate::operation::create_pentest::CreatePentestInput, ::aws_smithy_types::error::operation::BuildError> {
255        ::std::result::Result::Ok(crate::operation::create_pentest::CreatePentestInput {
256            title: self.title,
257            agent_space_id: self.agent_space_id,
258            assets: self.assets,
259            exclude_risk_types: self.exclude_risk_types,
260            service_role: self.service_role,
261            log_config: self.log_config,
262            vpc_config: self.vpc_config,
263            network_traffic_config: self.network_traffic_config,
264            code_remediation_strategy: self.code_remediation_strategy,
265            disable_managed_skills: self.disable_managed_skills,
266        })
267    }
268}