aws-sdk-assurance 1.0.0

AWS SDK for AWS Assurance
Documentation
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct GetEvidenceOutput {
    /// <p>The unique identifier of the evidence item.</p>
    pub evidence_id: ::std::string::String,
    /// <p>The version number of the evidence.</p>
    pub version: i32,
    /// <p>The human-readable title of the evidence.</p>
    pub title: ::std::string::String,
    /// <p>The optional description of the evidence.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The timestamp when the evidence was created.</p>
    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The timestamp when the evidence was last updated.</p>
    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The lifecycle status of the evidence.</p>
    pub status: ::std::option::Option<crate::types::EvidenceStatus>,
    /// <p>The checksum of the evidence content. Uploaded and Amazon S3 evidence use SHA-256. GitHub evidence uses SHA-1, because GitHub reports content hashes only in SHA-1.</p>
    pub checksum: ::std::option::Option<::std::string::String>,
    /// <p>The external reference URI if this is reference-based evidence.</p>
    pub reference: ::std::option::Option<::std::string::String>,
    /// <p>The controls this evidence is linked to.</p>
    pub linked_controls: ::std::option::Option<::std::vec::Vec<crate::types::ControlReferenceDetail>>,
    /// <p>The principal that supplied this evidence.</p>
    pub uploaded_by: ::std::option::Option<::std::string::String>,
    /// <p>The auto-linking mode in effect for the evidence. AWS Assurance sets it when you add the evidence, or sets it to <code>AUTO</code> when you start a new analysis with <code>UpdateEvidence</code>.</p>
    pub link_mode: ::std::option::Option<crate::types::LinkMode>,
    /// <p>What the evidence is for. AWS Assurance sets the purpose when you add the evidence.</p>
    pub purpose: ::std::option::Option<crate::types::EvidencePurpose>,
    /// <p>The time when the most recent automatic linking analysis of this evidence version started. For the result, see <code>status</code>. This field is absent if no analysis of this version has started.</p>
    pub last_auto_analysis_started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetEvidenceOutput {
    /// <p>The unique identifier of the evidence item.</p>
    pub fn evidence_id(&self) -> &str {
        use std::ops::Deref;
        self.evidence_id.deref()
    }
    /// <p>The version number of the evidence.</p>
    pub fn version(&self) -> i32 {
        self.version
    }
    /// <p>The human-readable title of the evidence.</p>
    pub fn title(&self) -> &str {
        use std::ops::Deref;
        self.title.deref()
    }
    /// <p>The optional description of the evidence.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The timestamp when the evidence was created.</p>
    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_at.as_ref()
    }
    /// <p>The timestamp when the evidence was last updated.</p>
    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.updated_at.as_ref()
    }
    /// <p>The lifecycle status of the evidence.</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::EvidenceStatus> {
        self.status.as_ref()
    }
    /// <p>The checksum of the evidence content. Uploaded and Amazon S3 evidence use SHA-256. GitHub evidence uses SHA-1, because GitHub reports content hashes only in SHA-1.</p>
    pub fn checksum(&self) -> ::std::option::Option<&str> {
        self.checksum.as_deref()
    }
    /// <p>The external reference URI if this is reference-based evidence.</p>
    pub fn reference(&self) -> ::std::option::Option<&str> {
        self.reference.as_deref()
    }
    /// <p>The controls this evidence is linked to.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.linked_controls.is_none()`.
    pub fn linked_controls(&self) -> &[crate::types::ControlReferenceDetail] {
        self.linked_controls.as_deref().unwrap_or_default()
    }
    /// <p>The principal that supplied this evidence.</p>
    pub fn uploaded_by(&self) -> ::std::option::Option<&str> {
        self.uploaded_by.as_deref()
    }
    /// <p>The auto-linking mode in effect for the evidence. AWS Assurance sets it when you add the evidence, or sets it to <code>AUTO</code> when you start a new analysis with <code>UpdateEvidence</code>.</p>
    pub fn link_mode(&self) -> ::std::option::Option<&crate::types::LinkMode> {
        self.link_mode.as_ref()
    }
    /// <p>What the evidence is for. AWS Assurance sets the purpose when you add the evidence.</p>
    pub fn purpose(&self) -> ::std::option::Option<&crate::types::EvidencePurpose> {
        self.purpose.as_ref()
    }
    /// <p>The time when the most recent automatic linking analysis of this evidence version started. For the result, see <code>status</code>. This field is absent if no analysis of this version has started.</p>
    pub fn last_auto_analysis_started_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_auto_analysis_started_at.as_ref()
    }
}
impl ::std::fmt::Debug for GetEvidenceOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetEvidenceOutput");
        formatter.field("evidence_id", &self.evidence_id);
        formatter.field("version", &self.version);
        formatter.field("title", &"*** Sensitive Data Redacted ***");
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("created_at", &self.created_at);
        formatter.field("updated_at", &self.updated_at);
        formatter.field("status", &self.status);
        formatter.field("checksum", &self.checksum);
        formatter.field("reference", &"*** Sensitive Data Redacted ***");
        formatter.field("linked_controls", &self.linked_controls);
        formatter.field("uploaded_by", &self.uploaded_by);
        formatter.field("link_mode", &self.link_mode);
        formatter.field("purpose", &self.purpose);
        formatter.field("last_auto_analysis_started_at", &self.last_auto_analysis_started_at);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for GetEvidenceOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetEvidenceOutput {
    /// Creates a new builder-style object to manufacture [`GetEvidenceOutput`](crate::operation::get_evidence::GetEvidenceOutput).
    pub fn builder() -> crate::operation::get_evidence::builders::GetEvidenceOutputBuilder {
        crate::operation::get_evidence::builders::GetEvidenceOutputBuilder::default()
    }
}

/// A builder for [`GetEvidenceOutput`](crate::operation::get_evidence::GetEvidenceOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct GetEvidenceOutputBuilder {
    pub(crate) evidence_id: ::std::option::Option<::std::string::String>,
    pub(crate) version: ::std::option::Option<i32>,
    pub(crate) title: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) status: ::std::option::Option<crate::types::EvidenceStatus>,
    pub(crate) checksum: ::std::option::Option<::std::string::String>,
    pub(crate) reference: ::std::option::Option<::std::string::String>,
    pub(crate) linked_controls: ::std::option::Option<::std::vec::Vec<crate::types::ControlReferenceDetail>>,
    pub(crate) uploaded_by: ::std::option::Option<::std::string::String>,
    pub(crate) link_mode: ::std::option::Option<crate::types::LinkMode>,
    pub(crate) purpose: ::std::option::Option<crate::types::EvidencePurpose>,
    pub(crate) last_auto_analysis_started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetEvidenceOutputBuilder {
    /// <p>The unique identifier of the evidence item.</p>
    /// This field is required.
    pub fn evidence_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.evidence_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the evidence item.</p>
    pub fn set_evidence_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.evidence_id = input;
        self
    }
    /// <p>The unique identifier of the evidence item.</p>
    pub fn get_evidence_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.evidence_id
    }
    /// <p>The version number of the evidence.</p>
    /// This field is required.
    pub fn version(mut self, input: i32) -> Self {
        self.version = ::std::option::Option::Some(input);
        self
    }
    /// <p>The version number of the evidence.</p>
    pub fn set_version(mut self, input: ::std::option::Option<i32>) -> Self {
        self.version = input;
        self
    }
    /// <p>The version number of the evidence.</p>
    pub fn get_version(&self) -> &::std::option::Option<i32> {
        &self.version
    }
    /// <p>The human-readable title of the evidence.</p>
    /// 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
    }
    /// <p>The human-readable title of the evidence.</p>
    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.title = input;
        self
    }
    /// <p>The human-readable title of the evidence.</p>
    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
        &self.title
    }
    /// <p>The optional description of the evidence.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The optional description of the evidence.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The optional description of the evidence.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The timestamp when the evidence was created.</p>
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp when the evidence was created.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The timestamp when the evidence was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The timestamp when the evidence was last updated.</p>
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp when the evidence was last updated.</p>
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// <p>The timestamp when the evidence was last updated.</p>
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// <p>The lifecycle status of the evidence.</p>
    pub fn status(mut self, input: crate::types::EvidenceStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The lifecycle status of the evidence.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::EvidenceStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The lifecycle status of the evidence.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::EvidenceStatus> {
        &self.status
    }
    /// <p>The checksum of the evidence content. Uploaded and Amazon S3 evidence use SHA-256. GitHub evidence uses SHA-1, because GitHub reports content hashes only in SHA-1.</p>
    pub fn checksum(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.checksum = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The checksum of the evidence content. Uploaded and Amazon S3 evidence use SHA-256. GitHub evidence uses SHA-1, because GitHub reports content hashes only in SHA-1.</p>
    pub fn set_checksum(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.checksum = input;
        self
    }
    /// <p>The checksum of the evidence content. Uploaded and Amazon S3 evidence use SHA-256. GitHub evidence uses SHA-1, because GitHub reports content hashes only in SHA-1.</p>
    pub fn get_checksum(&self) -> &::std::option::Option<::std::string::String> {
        &self.checksum
    }
    /// <p>The external reference URI if this is reference-based evidence.</p>
    pub fn reference(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.reference = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The external reference URI if this is reference-based evidence.</p>
    pub fn set_reference(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.reference = input;
        self
    }
    /// <p>The external reference URI if this is reference-based evidence.</p>
    pub fn get_reference(&self) -> &::std::option::Option<::std::string::String> {
        &self.reference
    }
    /// Appends an item to `linked_controls`.
    ///
    /// To override the contents of this collection use [`set_linked_controls`](Self::set_linked_controls).
    ///
    /// <p>The controls this evidence is linked to.</p>
    pub fn linked_controls(mut self, input: crate::types::ControlReferenceDetail) -> Self {
        let mut v = self.linked_controls.unwrap_or_default();
        v.push(input);
        self.linked_controls = ::std::option::Option::Some(v);
        self
    }
    /// <p>The controls this evidence is linked to.</p>
    pub fn set_linked_controls(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ControlReferenceDetail>>) -> Self {
        self.linked_controls = input;
        self
    }
    /// <p>The controls this evidence is linked to.</p>
    pub fn get_linked_controls(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ControlReferenceDetail>> {
        &self.linked_controls
    }
    /// <p>The principal that supplied this evidence.</p>
    pub fn uploaded_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.uploaded_by = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The principal that supplied this evidence.</p>
    pub fn set_uploaded_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.uploaded_by = input;
        self
    }
    /// <p>The principal that supplied this evidence.</p>
    pub fn get_uploaded_by(&self) -> &::std::option::Option<::std::string::String> {
        &self.uploaded_by
    }
    /// <p>The auto-linking mode in effect for the evidence. AWS Assurance sets it when you add the evidence, or sets it to <code>AUTO</code> when you start a new analysis with <code>UpdateEvidence</code>.</p>
    pub fn link_mode(mut self, input: crate::types::LinkMode) -> Self {
        self.link_mode = ::std::option::Option::Some(input);
        self
    }
    /// <p>The auto-linking mode in effect for the evidence. AWS Assurance sets it when you add the evidence, or sets it to <code>AUTO</code> when you start a new analysis with <code>UpdateEvidence</code>.</p>
    pub fn set_link_mode(mut self, input: ::std::option::Option<crate::types::LinkMode>) -> Self {
        self.link_mode = input;
        self
    }
    /// <p>The auto-linking mode in effect for the evidence. AWS Assurance sets it when you add the evidence, or sets it to <code>AUTO</code> when you start a new analysis with <code>UpdateEvidence</code>.</p>
    pub fn get_link_mode(&self) -> &::std::option::Option<crate::types::LinkMode> {
        &self.link_mode
    }
    /// <p>What the evidence is for. AWS Assurance sets the purpose when you add the evidence.</p>
    pub fn purpose(mut self, input: crate::types::EvidencePurpose) -> Self {
        self.purpose = ::std::option::Option::Some(input);
        self
    }
    /// <p>What the evidence is for. AWS Assurance sets the purpose when you add the evidence.</p>
    pub fn set_purpose(mut self, input: ::std::option::Option<crate::types::EvidencePurpose>) -> Self {
        self.purpose = input;
        self
    }
    /// <p>What the evidence is for. AWS Assurance sets the purpose when you add the evidence.</p>
    pub fn get_purpose(&self) -> &::std::option::Option<crate::types::EvidencePurpose> {
        &self.purpose
    }
    /// <p>The time when the most recent automatic linking analysis of this evidence version started. For the result, see <code>status</code>. This field is absent if no analysis of this version has started.</p>
    pub fn last_auto_analysis_started_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_auto_analysis_started_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when the most recent automatic linking analysis of this evidence version started. For the result, see <code>status</code>. This field is absent if no analysis of this version has started.</p>
    pub fn set_last_auto_analysis_started_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_auto_analysis_started_at = input;
        self
    }
    /// <p>The time when the most recent automatic linking analysis of this evidence version started. For the result, see <code>status</code>. This field is absent if no analysis of this version has started.</p>
    pub fn get_last_auto_analysis_started_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_auto_analysis_started_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 [`GetEvidenceOutput`](crate::operation::get_evidence::GetEvidenceOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`evidence_id`](crate::operation::get_evidence::builders::GetEvidenceOutputBuilder::evidence_id)
    /// - [`version`](crate::operation::get_evidence::builders::GetEvidenceOutputBuilder::version)
    /// - [`title`](crate::operation::get_evidence::builders::GetEvidenceOutputBuilder::title)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_evidence::GetEvidenceOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_evidence::GetEvidenceOutput {
            evidence_id: self.evidence_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "evidence_id",
                    "evidence_id was not specified but it is required when building GetEvidenceOutput",
                )
            })?,
            version: self.version.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "version",
                    "version was not specified but it is required when building GetEvidenceOutput",
                )
            })?,
            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 GetEvidenceOutput",
                )
            })?,
            description: self.description,
            created_at: self.created_at,
            updated_at: self.updated_at,
            status: self.status,
            checksum: self.checksum,
            reference: self.reference,
            linked_controls: self.linked_controls,
            uploaded_by: self.uploaded_by,
            link_mode: self.link_mode,
            purpose: self.purpose,
            last_auto_analysis_started_at: self.last_auto_analysis_started_at,
            _request_id: self._request_id,
        })
    }
}
impl ::std::fmt::Debug for GetEvidenceOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetEvidenceOutputBuilder");
        formatter.field("evidence_id", &self.evidence_id);
        formatter.field("version", &self.version);
        formatter.field("title", &"*** Sensitive Data Redacted ***");
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("created_at", &self.created_at);
        formatter.field("updated_at", &self.updated_at);
        formatter.field("status", &self.status);
        formatter.field("checksum", &self.checksum);
        formatter.field("reference", &"*** Sensitive Data Redacted ***");
        formatter.field("linked_controls", &self.linked_controls);
        formatter.field("uploaded_by", &self.uploaded_by);
        formatter.field("link_mode", &self.link_mode);
        formatter.field("purpose", &self.purpose);
        formatter.field("last_auto_analysis_started_at", &self.last_auto_analysis_started_at);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}