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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Defines the scope for recommendation generation, specifying which pillars and goals to focus on.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Scope {
/// <p>The Well-Architected Tool Framework pillars to include in the generation scope.</p>
pub pillars: ::std::vec::Vec<crate::types::Pillar>,
/// <p>Specific goal IDs to focus on during recommendation generation.</p>
pub goal_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>Optional per-pillar item filtering configuration.</p>
pub items: ::std::option::Option<::std::vec::Vec<crate::types::PillarItem>>,
}
impl Scope {
/// <p>The Well-Architected Tool Framework pillars to include in the generation scope.</p>
pub fn pillars(&self) -> &[crate::types::Pillar] {
use std::ops::Deref;
self.pillars.deref()
}
/// <p>Specific goal IDs to focus on during recommendation generation.</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 `.goal_ids.is_none()`.
pub fn goal_ids(&self) -> &[::std::string::String] {
self.goal_ids.as_deref().unwrap_or_default()
}
/// <p>Optional per-pillar item filtering configuration.</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 `.items.is_none()`.
pub fn items(&self) -> &[crate::types::PillarItem] {
self.items.as_deref().unwrap_or_default()
}
}
impl Scope {
/// Creates a new builder-style object to manufacture [`Scope`](crate::types::Scope).
pub fn builder() -> crate::types::builders::ScopeBuilder {
crate::types::builders::ScopeBuilder::default()
}
}
/// A builder for [`Scope`](crate::types::Scope).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ScopeBuilder {
pub(crate) pillars: ::std::option::Option<::std::vec::Vec<crate::types::Pillar>>,
pub(crate) goal_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) items: ::std::option::Option<::std::vec::Vec<crate::types::PillarItem>>,
}
impl ScopeBuilder {
/// Appends an item to `pillars`.
///
/// To override the contents of this collection use [`set_pillars`](Self::set_pillars).
///
/// <p>The Well-Architected Tool Framework pillars to include in the generation scope.</p>
pub fn pillars(mut self, input: crate::types::Pillar) -> Self {
let mut v = self.pillars.unwrap_or_default();
v.push(input);
self.pillars = ::std::option::Option::Some(v);
self
}
/// <p>The Well-Architected Tool Framework pillars to include in the generation scope.</p>
pub fn set_pillars(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Pillar>>) -> Self {
self.pillars = input;
self
}
/// <p>The Well-Architected Tool Framework pillars to include in the generation scope.</p>
pub fn get_pillars(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Pillar>> {
&self.pillars
}
/// Appends an item to `goal_ids`.
///
/// To override the contents of this collection use [`set_goal_ids`](Self::set_goal_ids).
///
/// <p>Specific goal IDs to focus on during recommendation generation.</p>
pub fn goal_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.goal_ids.unwrap_or_default();
v.push(input.into());
self.goal_ids = ::std::option::Option::Some(v);
self
}
/// <p>Specific goal IDs to focus on during recommendation generation.</p>
pub fn set_goal_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.goal_ids = input;
self
}
/// <p>Specific goal IDs to focus on during recommendation generation.</p>
pub fn get_goal_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.goal_ids
}
/// Appends an item to `items`.
///
/// To override the contents of this collection use [`set_items`](Self::set_items).
///
/// <p>Optional per-pillar item filtering configuration.</p>
pub fn items(mut self, input: crate::types::PillarItem) -> Self {
let mut v = self.items.unwrap_or_default();
v.push(input);
self.items = ::std::option::Option::Some(v);
self
}
/// <p>Optional per-pillar item filtering configuration.</p>
pub fn set_items(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PillarItem>>) -> Self {
self.items = input;
self
}
/// <p>Optional per-pillar item filtering configuration.</p>
pub fn get_items(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PillarItem>> {
&self.items
}
/// Consumes the builder and constructs a [`Scope`](crate::types::Scope).
/// This method will fail if any of the following fields are not set:
/// - [`pillars`](crate::types::builders::ScopeBuilder::pillars)
pub fn build(self) -> ::std::result::Result<crate::types::Scope, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Scope {
pillars: self.pillars.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"pillars",
"pillars was not specified but it is required when building Scope",
)
})?,
goal_ids: self.goal_ids,
items: self.items,
})
}
}