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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A choice available to answer question.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Choice {
/// <p>The ID of a choice.</p>
pub choice_id: ::std::option::Option<::std::string::String>,
/// <p>The title of a choice.</p>
pub title: ::std::option::Option<::std::string::String>,
/// <p>The description of a choice.</p>
pub description: ::std::option::Option<::std::string::String>,
/// <p>The helpful resource (both text and URL) for a particular choice.</p>
/// <p>This field only applies to custom lenses. Each choice can have only one helpful resource.</p>
pub helpful_resource: ::std::option::Option<crate::types::ChoiceContent>,
/// <p>The improvement plan (both text and URL) for a particular choice.</p>
/// <p>This field only applies to custom lenses. Each choice can have only one improvement plan.</p>
pub improvement_plan: ::std::option::Option<crate::types::ChoiceContent>,
/// <p>The additional resources for a choice in a custom lens.</p>
/// <p>A choice can have up to two additional resources: one of type <code>HELPFUL_RESOURCE</code>, one of type <code>IMPROVEMENT_PLAN</code>, or both.</p>
pub additional_resources: ::std::option::Option<::std::vec::Vec<crate::types::AdditionalResources>>,
}
impl Choice {
/// <p>The ID of a choice.</p>
pub fn choice_id(&self) -> ::std::option::Option<&str> {
self.choice_id.as_deref()
}
/// <p>The title of a choice.</p>
pub fn title(&self) -> ::std::option::Option<&str> {
self.title.as_deref()
}
/// <p>The description of a choice.</p>
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The helpful resource (both text and URL) for a particular choice.</p>
/// <p>This field only applies to custom lenses. Each choice can have only one helpful resource.</p>
pub fn helpful_resource(&self) -> ::std::option::Option<&crate::types::ChoiceContent> {
self.helpful_resource.as_ref()
}
/// <p>The improvement plan (both text and URL) for a particular choice.</p>
/// <p>This field only applies to custom lenses. Each choice can have only one improvement plan.</p>
pub fn improvement_plan(&self) -> ::std::option::Option<&crate::types::ChoiceContent> {
self.improvement_plan.as_ref()
}
/// <p>The additional resources for a choice in a custom lens.</p>
/// <p>A choice can have up to two additional resources: one of type <code>HELPFUL_RESOURCE</code>, one of type <code>IMPROVEMENT_PLAN</code>, or both.</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 `.additional_resources.is_none()`.
pub fn additional_resources(&self) -> &[crate::types::AdditionalResources] {
self.additional_resources.as_deref().unwrap_or_default()
}
}
impl Choice {
/// Creates a new builder-style object to manufacture [`Choice`](crate::types::Choice).
pub fn builder() -> crate::types::builders::ChoiceBuilder {
crate::types::builders::ChoiceBuilder::default()
}
}
/// A builder for [`Choice`](crate::types::Choice).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ChoiceBuilder {
pub(crate) choice_id: ::std::option::Option<::std::string::String>,
pub(crate) title: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) helpful_resource: ::std::option::Option<crate::types::ChoiceContent>,
pub(crate) improvement_plan: ::std::option::Option<crate::types::ChoiceContent>,
pub(crate) additional_resources: ::std::option::Option<::std::vec::Vec<crate::types::AdditionalResources>>,
}
impl ChoiceBuilder {
/// <p>The ID of a choice.</p>
pub fn choice_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.choice_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of a choice.</p>
pub fn set_choice_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.choice_id = input;
self
}
/// <p>The ID of a choice.</p>
pub fn get_choice_id(&self) -> &::std::option::Option<::std::string::String> {
&self.choice_id
}
/// <p>The title of a choice.</p>
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 title of a choice.</p>
pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.title = input;
self
}
/// <p>The title of a choice.</p>
pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
&self.title
}
/// <p>The description of a choice.</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 description of a choice.</p>
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
/// <p>The description of a choice.</p>
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
/// <p>The helpful resource (both text and URL) for a particular choice.</p>
/// <p>This field only applies to custom lenses. Each choice can have only one helpful resource.</p>
pub fn helpful_resource(mut self, input: crate::types::ChoiceContent) -> Self {
self.helpful_resource = ::std::option::Option::Some(input);
self
}
/// <p>The helpful resource (both text and URL) for a particular choice.</p>
/// <p>This field only applies to custom lenses. Each choice can have only one helpful resource.</p>
pub fn set_helpful_resource(mut self, input: ::std::option::Option<crate::types::ChoiceContent>) -> Self {
self.helpful_resource = input;
self
}
/// <p>The helpful resource (both text and URL) for a particular choice.</p>
/// <p>This field only applies to custom lenses. Each choice can have only one helpful resource.</p>
pub fn get_helpful_resource(&self) -> &::std::option::Option<crate::types::ChoiceContent> {
&self.helpful_resource
}
/// <p>The improvement plan (both text and URL) for a particular choice.</p>
/// <p>This field only applies to custom lenses. Each choice can have only one improvement plan.</p>
pub fn improvement_plan(mut self, input: crate::types::ChoiceContent) -> Self {
self.improvement_plan = ::std::option::Option::Some(input);
self
}
/// <p>The improvement plan (both text and URL) for a particular choice.</p>
/// <p>This field only applies to custom lenses. Each choice can have only one improvement plan.</p>
pub fn set_improvement_plan(mut self, input: ::std::option::Option<crate::types::ChoiceContent>) -> Self {
self.improvement_plan = input;
self
}
/// <p>The improvement plan (both text and URL) for a particular choice.</p>
/// <p>This field only applies to custom lenses. Each choice can have only one improvement plan.</p>
pub fn get_improvement_plan(&self) -> &::std::option::Option<crate::types::ChoiceContent> {
&self.improvement_plan
}
/// Appends an item to `additional_resources`.
///
/// To override the contents of this collection use [`set_additional_resources`](Self::set_additional_resources).
///
/// <p>The additional resources for a choice in a custom lens.</p>
/// <p>A choice can have up to two additional resources: one of type <code>HELPFUL_RESOURCE</code>, one of type <code>IMPROVEMENT_PLAN</code>, or both.</p>
pub fn additional_resources(mut self, input: crate::types::AdditionalResources) -> Self {
let mut v = self.additional_resources.unwrap_or_default();
v.push(input);
self.additional_resources = ::std::option::Option::Some(v);
self
}
/// <p>The additional resources for a choice in a custom lens.</p>
/// <p>A choice can have up to two additional resources: one of type <code>HELPFUL_RESOURCE</code>, one of type <code>IMPROVEMENT_PLAN</code>, or both.</p>
pub fn set_additional_resources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AdditionalResources>>) -> Self {
self.additional_resources = input;
self
}
/// <p>The additional resources for a choice in a custom lens.</p>
/// <p>A choice can have up to two additional resources: one of type <code>HELPFUL_RESOURCE</code>, one of type <code>IMPROVEMENT_PLAN</code>, or both.</p>
pub fn get_additional_resources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AdditionalResources>> {
&self.additional_resources
}
/// Consumes the builder and constructs a [`Choice`](crate::types::Choice).
pub fn build(self) -> crate::types::Choice {
crate::types::Choice {
choice_id: self.choice_id,
title: self.title,
description: self.description,
helpful_resource: self.helpful_resource,
improvement_plan: self.improvement_plan,
additional_resources: self.additional_resources,
}
}
}