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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Provides the numerical and qualitative representations of a finding's severity.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Severity {
/// <p>The qualitative representation of the finding's severity, ranging from Low (least severe) to High (most severe).</p>
pub description: ::std::option::Option<crate::types::SeverityDescription>,
/// <p>The numerical representation of the finding's severity, ranging from 1 (least severe) to 3 (most severe).</p>
pub score: ::std::option::Option<i64>,
}
impl Severity {
/// <p>The qualitative representation of the finding's severity, ranging from Low (least severe) to High (most severe).</p>
pub fn description(&self) -> ::std::option::Option<&crate::types::SeverityDescription> {
self.description.as_ref()
}
/// <p>The numerical representation of the finding's severity, ranging from 1 (least severe) to 3 (most severe).</p>
pub fn score(&self) -> ::std::option::Option<i64> {
self.score
}
}
impl Severity {
/// Creates a new builder-style object to manufacture [`Severity`](crate::types::Severity).
pub fn builder() -> crate::types::builders::SeverityBuilder {
crate::types::builders::SeverityBuilder::default()
}
}
/// A builder for [`Severity`](crate::types::Severity).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SeverityBuilder {
pub(crate) description: ::std::option::Option<crate::types::SeverityDescription>,
pub(crate) score: ::std::option::Option<i64>,
}
impl SeverityBuilder {
/// <p>The qualitative representation of the finding's severity, ranging from Low (least severe) to High (most severe).</p>
pub fn description(mut self, input: crate::types::SeverityDescription) -> Self {
self.description = ::std::option::Option::Some(input);
self
}
/// <p>The qualitative representation of the finding's severity, ranging from Low (least severe) to High (most severe).</p>
pub fn set_description(mut self, input: ::std::option::Option<crate::types::SeverityDescription>) -> Self {
self.description = input;
self
}
/// <p>The qualitative representation of the finding's severity, ranging from Low (least severe) to High (most severe).</p>
pub fn get_description(&self) -> &::std::option::Option<crate::types::SeverityDescription> {
&self.description
}
/// <p>The numerical representation of the finding's severity, ranging from 1 (least severe) to 3 (most severe).</p>
pub fn score(mut self, input: i64) -> Self {
self.score = ::std::option::Option::Some(input);
self
}
/// <p>The numerical representation of the finding's severity, ranging from 1 (least severe) to 3 (most severe).</p>
pub fn set_score(mut self, input: ::std::option::Option<i64>) -> Self {
self.score = input;
self
}
/// <p>The numerical representation of the finding's severity, ranging from 1 (least severe) to 3 (most severe).</p>
pub fn get_score(&self) -> &::std::option::Option<i64> {
&self.score
}
/// Consumes the builder and constructs a [`Severity`](crate::types::Severity).
pub fn build(self) -> crate::types::Severity {
crate::types::Severity {
description: self.description,
score: self.score,
}
}
}