Skip to main content

aws_sdk_securityagent/operation/create_pentest/
_create_pentest_output.rs

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