aws_sdk_codegurusecurity/operation/get_scan/
_get_scan_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetScanOutput {
6 pub scan_name: ::std::string::String,
8 pub run_id: ::std::string::String,
10 pub scan_state: crate::types::ScanState,
12 pub created_at: ::aws_smithy_types::DateTime,
14 pub analysis_type: crate::types::AnalysisType,
16 pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
18 pub number_of_revisions: ::std::option::Option<i64>,
20 pub scan_name_arn: ::std::option::Option<::std::string::String>,
22 pub error_message: ::std::option::Option<::std::string::String>,
24 _request_id: Option<String>,
25}
26impl GetScanOutput {
27 pub fn scan_name(&self) -> &str {
29 use std::ops::Deref;
30 self.scan_name.deref()
31 }
32 pub fn run_id(&self) -> &str {
34 use std::ops::Deref;
35 self.run_id.deref()
36 }
37 pub fn scan_state(&self) -> &crate::types::ScanState {
39 &self.scan_state
40 }
41 pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
43 &self.created_at
44 }
45 pub fn analysis_type(&self) -> &crate::types::AnalysisType {
47 &self.analysis_type
48 }
49 pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
51 self.updated_at.as_ref()
52 }
53 pub fn number_of_revisions(&self) -> ::std::option::Option<i64> {
55 self.number_of_revisions
56 }
57 pub fn scan_name_arn(&self) -> ::std::option::Option<&str> {
59 self.scan_name_arn.as_deref()
60 }
61 pub fn error_message(&self) -> ::std::option::Option<&str> {
63 self.error_message.as_deref()
64 }
65}
66impl ::aws_types::request_id::RequestId for GetScanOutput {
67 fn request_id(&self) -> Option<&str> {
68 self._request_id.as_deref()
69 }
70}
71impl GetScanOutput {
72 pub fn builder() -> crate::operation::get_scan::builders::GetScanOutputBuilder {
74 crate::operation::get_scan::builders::GetScanOutputBuilder::default()
75 }
76}
77
78#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
80#[non_exhaustive]
81pub struct GetScanOutputBuilder {
82 pub(crate) scan_name: ::std::option::Option<::std::string::String>,
83 pub(crate) run_id: ::std::option::Option<::std::string::String>,
84 pub(crate) scan_state: ::std::option::Option<crate::types::ScanState>,
85 pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
86 pub(crate) analysis_type: ::std::option::Option<crate::types::AnalysisType>,
87 pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
88 pub(crate) number_of_revisions: ::std::option::Option<i64>,
89 pub(crate) scan_name_arn: ::std::option::Option<::std::string::String>,
90 pub(crate) error_message: ::std::option::Option<::std::string::String>,
91 _request_id: Option<String>,
92}
93impl GetScanOutputBuilder {
94 pub fn scan_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97 self.scan_name = ::std::option::Option::Some(input.into());
98 self
99 }
100 pub fn set_scan_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102 self.scan_name = input;
103 self
104 }
105 pub fn get_scan_name(&self) -> &::std::option::Option<::std::string::String> {
107 &self.scan_name
108 }
109 pub fn run_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
112 self.run_id = ::std::option::Option::Some(input.into());
113 self
114 }
115 pub fn set_run_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
117 self.run_id = input;
118 self
119 }
120 pub fn get_run_id(&self) -> &::std::option::Option<::std::string::String> {
122 &self.run_id
123 }
124 pub fn scan_state(mut self, input: crate::types::ScanState) -> Self {
127 self.scan_state = ::std::option::Option::Some(input);
128 self
129 }
130 pub fn set_scan_state(mut self, input: ::std::option::Option<crate::types::ScanState>) -> Self {
132 self.scan_state = input;
133 self
134 }
135 pub fn get_scan_state(&self) -> &::std::option::Option<crate::types::ScanState> {
137 &self.scan_state
138 }
139 pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
142 self.created_at = ::std::option::Option::Some(input);
143 self
144 }
145 pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
147 self.created_at = input;
148 self
149 }
150 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
152 &self.created_at
153 }
154 pub fn analysis_type(mut self, input: crate::types::AnalysisType) -> Self {
157 self.analysis_type = ::std::option::Option::Some(input);
158 self
159 }
160 pub fn set_analysis_type(mut self, input: ::std::option::Option<crate::types::AnalysisType>) -> Self {
162 self.analysis_type = input;
163 self
164 }
165 pub fn get_analysis_type(&self) -> &::std::option::Option<crate::types::AnalysisType> {
167 &self.analysis_type
168 }
169 pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
171 self.updated_at = ::std::option::Option::Some(input);
172 self
173 }
174 pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
176 self.updated_at = input;
177 self
178 }
179 pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
181 &self.updated_at
182 }
183 pub fn number_of_revisions(mut self, input: i64) -> Self {
185 self.number_of_revisions = ::std::option::Option::Some(input);
186 self
187 }
188 pub fn set_number_of_revisions(mut self, input: ::std::option::Option<i64>) -> Self {
190 self.number_of_revisions = input;
191 self
192 }
193 pub fn get_number_of_revisions(&self) -> &::std::option::Option<i64> {
195 &self.number_of_revisions
196 }
197 pub fn scan_name_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199 self.scan_name_arn = ::std::option::Option::Some(input.into());
200 self
201 }
202 pub fn set_scan_name_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204 self.scan_name_arn = input;
205 self
206 }
207 pub fn get_scan_name_arn(&self) -> &::std::option::Option<::std::string::String> {
209 &self.scan_name_arn
210 }
211 pub fn error_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213 self.error_message = ::std::option::Option::Some(input.into());
214 self
215 }
216 pub fn set_error_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218 self.error_message = input;
219 self
220 }
221 pub fn get_error_message(&self) -> &::std::option::Option<::std::string::String> {
223 &self.error_message
224 }
225 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
226 self._request_id = Some(request_id.into());
227 self
228 }
229
230 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
231 self._request_id = request_id;
232 self
233 }
234 pub fn build(self) -> ::std::result::Result<crate::operation::get_scan::GetScanOutput, ::aws_smithy_types::error::operation::BuildError> {
242 ::std::result::Result::Ok(crate::operation::get_scan::GetScanOutput {
243 scan_name: self.scan_name.ok_or_else(|| {
244 ::aws_smithy_types::error::operation::BuildError::missing_field(
245 "scan_name",
246 "scan_name was not specified but it is required when building GetScanOutput",
247 )
248 })?,
249 run_id: self.run_id.ok_or_else(|| {
250 ::aws_smithy_types::error::operation::BuildError::missing_field(
251 "run_id",
252 "run_id was not specified but it is required when building GetScanOutput",
253 )
254 })?,
255 scan_state: self.scan_state.ok_or_else(|| {
256 ::aws_smithy_types::error::operation::BuildError::missing_field(
257 "scan_state",
258 "scan_state was not specified but it is required when building GetScanOutput",
259 )
260 })?,
261 created_at: self.created_at.ok_or_else(|| {
262 ::aws_smithy_types::error::operation::BuildError::missing_field(
263 "created_at",
264 "created_at was not specified but it is required when building GetScanOutput",
265 )
266 })?,
267 analysis_type: self.analysis_type.ok_or_else(|| {
268 ::aws_smithy_types::error::operation::BuildError::missing_field(
269 "analysis_type",
270 "analysis_type was not specified but it is required when building GetScanOutput",
271 )
272 })?,
273 updated_at: self.updated_at,
274 number_of_revisions: self.number_of_revisions,
275 scan_name_arn: self.scan_name_arn,
276 error_message: self.error_message,
277 _request_id: self._request_id,
278 })
279 }
280}