aws_sdk_wellarchitected/types/
_pillar_review_summary.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A pillar review summary of a lens review.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PillarReviewSummary {
7    /// <p>The ID used to identify a pillar, for example, <code>security</code>.</p>
8    /// <p>A pillar is identified by its <code>PillarReviewSummary$PillarId</code>.</p>
9    pub pillar_id: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the pillar.</p>
11    pub pillar_name: ::std::option::Option<::std::string::String>,
12    /// <p>The notes associated with the workload.</p>
13    /// <p>For a review template, these are the notes that will be associated with the workload when the template is applied.</p>
14    pub notes: ::std::option::Option<::std::string::String>,
15    /// <p>A map from risk names to the count of how many questions have that rating.</p>
16    pub risk_counts: ::std::option::Option<::std::collections::HashMap<crate::types::Risk, i32>>,
17    /// <p>A map from risk names to the count of how many questions have that rating.</p>
18    pub prioritized_risk_counts: ::std::option::Option<::std::collections::HashMap<crate::types::Risk, i32>>,
19}
20impl PillarReviewSummary {
21    /// <p>The ID used to identify a pillar, for example, <code>security</code>.</p>
22    /// <p>A pillar is identified by its <code>PillarReviewSummary$PillarId</code>.</p>
23    pub fn pillar_id(&self) -> ::std::option::Option<&str> {
24        self.pillar_id.as_deref()
25    }
26    /// <p>The name of the pillar.</p>
27    pub fn pillar_name(&self) -> ::std::option::Option<&str> {
28        self.pillar_name.as_deref()
29    }
30    /// <p>The notes associated with the workload.</p>
31    /// <p>For a review template, these are the notes that will be associated with the workload when the template is applied.</p>
32    pub fn notes(&self) -> ::std::option::Option<&str> {
33        self.notes.as_deref()
34    }
35    /// <p>A map from risk names to the count of how many questions have that rating.</p>
36    pub fn risk_counts(&self) -> ::std::option::Option<&::std::collections::HashMap<crate::types::Risk, i32>> {
37        self.risk_counts.as_ref()
38    }
39    /// <p>A map from risk names to the count of how many questions have that rating.</p>
40    pub fn prioritized_risk_counts(&self) -> ::std::option::Option<&::std::collections::HashMap<crate::types::Risk, i32>> {
41        self.prioritized_risk_counts.as_ref()
42    }
43}
44impl PillarReviewSummary {
45    /// Creates a new builder-style object to manufacture [`PillarReviewSummary`](crate::types::PillarReviewSummary).
46    pub fn builder() -> crate::types::builders::PillarReviewSummaryBuilder {
47        crate::types::builders::PillarReviewSummaryBuilder::default()
48    }
49}
50
51/// A builder for [`PillarReviewSummary`](crate::types::PillarReviewSummary).
52#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
53#[non_exhaustive]
54pub struct PillarReviewSummaryBuilder {
55    pub(crate) pillar_id: ::std::option::Option<::std::string::String>,
56    pub(crate) pillar_name: ::std::option::Option<::std::string::String>,
57    pub(crate) notes: ::std::option::Option<::std::string::String>,
58    pub(crate) risk_counts: ::std::option::Option<::std::collections::HashMap<crate::types::Risk, i32>>,
59    pub(crate) prioritized_risk_counts: ::std::option::Option<::std::collections::HashMap<crate::types::Risk, i32>>,
60}
61impl PillarReviewSummaryBuilder {
62    /// <p>The ID used to identify a pillar, for example, <code>security</code>.</p>
63    /// <p>A pillar is identified by its <code>PillarReviewSummary$PillarId</code>.</p>
64    pub fn pillar_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
65        self.pillar_id = ::std::option::Option::Some(input.into());
66        self
67    }
68    /// <p>The ID used to identify a pillar, for example, <code>security</code>.</p>
69    /// <p>A pillar is identified by its <code>PillarReviewSummary$PillarId</code>.</p>
70    pub fn set_pillar_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71        self.pillar_id = input;
72        self
73    }
74    /// <p>The ID used to identify a pillar, for example, <code>security</code>.</p>
75    /// <p>A pillar is identified by its <code>PillarReviewSummary$PillarId</code>.</p>
76    pub fn get_pillar_id(&self) -> &::std::option::Option<::std::string::String> {
77        &self.pillar_id
78    }
79    /// <p>The name of the pillar.</p>
80    pub fn pillar_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.pillar_name = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The name of the pillar.</p>
85    pub fn set_pillar_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.pillar_name = input;
87        self
88    }
89    /// <p>The name of the pillar.</p>
90    pub fn get_pillar_name(&self) -> &::std::option::Option<::std::string::String> {
91        &self.pillar_name
92    }
93    /// <p>The notes associated with the workload.</p>
94    /// <p>For a review template, these are the notes that will be associated with the workload when the template is applied.</p>
95    pub fn notes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.notes = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The notes associated with the workload.</p>
100    /// <p>For a review template, these are the notes that will be associated with the workload when the template is applied.</p>
101    pub fn set_notes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.notes = input;
103        self
104    }
105    /// <p>The notes associated with the workload.</p>
106    /// <p>For a review template, these are the notes that will be associated with the workload when the template is applied.</p>
107    pub fn get_notes(&self) -> &::std::option::Option<::std::string::String> {
108        &self.notes
109    }
110    /// Adds a key-value pair to `risk_counts`.
111    ///
112    /// To override the contents of this collection use [`set_risk_counts`](Self::set_risk_counts).
113    ///
114    /// <p>A map from risk names to the count of how many questions have that rating.</p>
115    pub fn risk_counts(mut self, k: crate::types::Risk, v: i32) -> Self {
116        let mut hash_map = self.risk_counts.unwrap_or_default();
117        hash_map.insert(k, v);
118        self.risk_counts = ::std::option::Option::Some(hash_map);
119        self
120    }
121    /// <p>A map from risk names to the count of how many questions have that rating.</p>
122    pub fn set_risk_counts(mut self, input: ::std::option::Option<::std::collections::HashMap<crate::types::Risk, i32>>) -> Self {
123        self.risk_counts = input;
124        self
125    }
126    /// <p>A map from risk names to the count of how many questions have that rating.</p>
127    pub fn get_risk_counts(&self) -> &::std::option::Option<::std::collections::HashMap<crate::types::Risk, i32>> {
128        &self.risk_counts
129    }
130    /// Adds a key-value pair to `prioritized_risk_counts`.
131    ///
132    /// To override the contents of this collection use [`set_prioritized_risk_counts`](Self::set_prioritized_risk_counts).
133    ///
134    /// <p>A map from risk names to the count of how many questions have that rating.</p>
135    pub fn prioritized_risk_counts(mut self, k: crate::types::Risk, v: i32) -> Self {
136        let mut hash_map = self.prioritized_risk_counts.unwrap_or_default();
137        hash_map.insert(k, v);
138        self.prioritized_risk_counts = ::std::option::Option::Some(hash_map);
139        self
140    }
141    /// <p>A map from risk names to the count of how many questions have that rating.</p>
142    pub fn set_prioritized_risk_counts(mut self, input: ::std::option::Option<::std::collections::HashMap<crate::types::Risk, i32>>) -> Self {
143        self.prioritized_risk_counts = input;
144        self
145    }
146    /// <p>A map from risk names to the count of how many questions have that rating.</p>
147    pub fn get_prioritized_risk_counts(&self) -> &::std::option::Option<::std::collections::HashMap<crate::types::Risk, i32>> {
148        &self.prioritized_risk_counts
149    }
150    /// Consumes the builder and constructs a [`PillarReviewSummary`](crate::types::PillarReviewSummary).
151    pub fn build(self) -> crate::types::PillarReviewSummary {
152        crate::types::PillarReviewSummary {
153            pillar_id: self.pillar_id,
154            pillar_name: self.pillar_name,
155            notes: self.notes,
156            risk_counts: self.risk_counts,
157            prioritized_risk_counts: self.prioritized_risk_counts,
158        }
159    }
160}