1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// Contains the identifier, ARN, title, and initial status of the newly ingested finding.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateCodeFindingOutput {
/// The unique identifier assigned to the finding.
pub finding_id: ::std::string::String,
/// The ARN of the ingested finding.
pub finding_arn: ::std::string::String,
/// The title extracted from the submitted document. Always populated at ingestion.
pub title: ::std::string::String,
/// The finding's current lifecycle status -- SUBMITTED for a newly ingested finding, or the finding's present status when an idempotent retry replays an already-processed finding.
pub status: crate::types::FindingStatus,
/// The timestamp when the finding was ingested.
pub created_at: ::aws_smithy_types::DateTime,
_request_id: Option<String>,
}
impl CreateCodeFindingOutput {
/// The unique identifier assigned to the finding.
pub fn finding_id(&self) -> &str {
use std::ops::Deref;
self.finding_id.deref()
}
/// The ARN of the ingested finding.
pub fn finding_arn(&self) -> &str {
use std::ops::Deref;
self.finding_arn.deref()
}
/// The title extracted from the submitted document. Always populated at ingestion.
pub fn title(&self) -> &str {
use std::ops::Deref;
self.title.deref()
}
/// The finding's current lifecycle status -- SUBMITTED for a newly ingested finding, or the finding's present status when an idempotent retry replays an already-processed finding.
pub fn status(&self) -> &crate::types::FindingStatus {
&self.status
}
/// The timestamp when the finding was ingested.
pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
&self.created_at
}
}
impl ::aws_types::request_id::RequestId for CreateCodeFindingOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl CreateCodeFindingOutput {
/// Creates a new builder-style object to manufacture [`CreateCodeFindingOutput`](crate::operation::create_code_finding::CreateCodeFindingOutput).
pub fn builder() -> crate::operation::create_code_finding::builders::CreateCodeFindingOutputBuilder {
crate::operation::create_code_finding::builders::CreateCodeFindingOutputBuilder::default()
}
}
/// A builder for [`CreateCodeFindingOutput`](crate::operation::create_code_finding::CreateCodeFindingOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateCodeFindingOutputBuilder {
pub(crate) finding_id: ::std::option::Option<::std::string::String>,
pub(crate) finding_arn: ::std::option::Option<::std::string::String>,
pub(crate) title: ::std::option::Option<::std::string::String>,
pub(crate) status: ::std::option::Option<crate::types::FindingStatus>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
_request_id: Option<String>,
}
impl CreateCodeFindingOutputBuilder {
/// The unique identifier assigned to the finding.
/// This field is required.
pub fn finding_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.finding_id = ::std::option::Option::Some(input.into());
self
}
/// The unique identifier assigned to the finding.
pub fn set_finding_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.finding_id = input;
self
}
/// The unique identifier assigned to the finding.
pub fn get_finding_id(&self) -> &::std::option::Option<::std::string::String> {
&self.finding_id
}
/// The ARN of the ingested finding.
/// This field is required.
pub fn finding_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.finding_arn = ::std::option::Option::Some(input.into());
self
}
/// The ARN of the ingested finding.
pub fn set_finding_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.finding_arn = input;
self
}
/// The ARN of the ingested finding.
pub fn get_finding_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.finding_arn
}
/// The title extracted from the submitted document. Always populated at ingestion.
/// This field is required.
pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.title = ::std::option::Option::Some(input.into());
self
}
/// The title extracted from the submitted document. Always populated at ingestion.
pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.title = input;
self
}
/// The title extracted from the submitted document. Always populated at ingestion.
pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
&self.title
}
/// The finding's current lifecycle status -- SUBMITTED for a newly ingested finding, or the finding's present status when an idempotent retry replays an already-processed finding.
/// This field is required.
pub fn status(mut self, input: crate::types::FindingStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// The finding's current lifecycle status -- SUBMITTED for a newly ingested finding, or the finding's present status when an idempotent retry replays an already-processed finding.
pub fn set_status(mut self, input: ::std::option::Option<crate::types::FindingStatus>) -> Self {
self.status = input;
self
}
/// The finding's current lifecycle status -- SUBMITTED for a newly ingested finding, or the finding's present status when an idempotent retry replays an already-processed finding.
pub fn get_status(&self) -> &::std::option::Option<crate::types::FindingStatus> {
&self.status
}
/// The timestamp when the finding was ingested.
/// This field is required.
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
/// The timestamp when the finding was ingested.
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
/// The timestamp when the finding was ingested.
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`CreateCodeFindingOutput`](crate::operation::create_code_finding::CreateCodeFindingOutput).
/// This method will fail if any of the following fields are not set:
/// - [`finding_id`](crate::operation::create_code_finding::builders::CreateCodeFindingOutputBuilder::finding_id)
/// - [`finding_arn`](crate::operation::create_code_finding::builders::CreateCodeFindingOutputBuilder::finding_arn)
/// - [`title`](crate::operation::create_code_finding::builders::CreateCodeFindingOutputBuilder::title)
/// - [`status`](crate::operation::create_code_finding::builders::CreateCodeFindingOutputBuilder::status)
/// - [`created_at`](crate::operation::create_code_finding::builders::CreateCodeFindingOutputBuilder::created_at)
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_code_finding::CreateCodeFindingOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_code_finding::CreateCodeFindingOutput {
finding_id: self.finding_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"finding_id",
"finding_id was not specified but it is required when building CreateCodeFindingOutput",
)
})?,
finding_arn: self.finding_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"finding_arn",
"finding_arn was not specified but it is required when building CreateCodeFindingOutput",
)
})?,
title: self.title.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"title",
"title was not specified but it is required when building CreateCodeFindingOutput",
)
})?,
status: self.status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"status",
"status was not specified but it is required when building CreateCodeFindingOutput",
)
})?,
created_at: self.created_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"created_at",
"created_at was not specified but it is required when building CreateCodeFindingOutput",
)
})?,
_request_id: self._request_id,
})
}
}