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
// 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 GetProfileRecommendationsInput {
/// <p>The unique name of the domain.</p>
pub domain_name: ::std::option::Option<::std::string::String>,
/// <p>The unique identifier of the profile for which to retrieve recommendations.</p>
pub profile_id: ::std::option::Option<::std::string::String>,
/// <p>The unique name of the recommender.</p>
pub recommender_name: ::std::option::Option<::std::string::String>,
/// <p>The contextual metadata used to provide dynamic runtime information to tailor recommendations.</p>
pub context: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
/// <p>A list of filters to apply to the returned recommendations. Filters define criteria for including or excluding items from the recommendation results.</p>
pub recommender_filters: ::std::option::Option<::std::vec::Vec<crate::types::RecommenderFilter>>,
/// <p>A list of promotional filters to apply to the recommendations. Promotional filters allow you to promote specific items within a configurable subset of recommendation results.</p>
pub recommender_promotional_filters: ::std::option::Option<::std::vec::Vec<crate::types::RecommenderPromotionalFilter>>,
/// <p>A list of item IDs to rank for the user. Use this when you want to re-rank a specific set of items rather than getting recommendations from the full item catalog. Required for personalized-ranking use cases.</p>
pub candidate_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>The maximum number of recommendations to return. The default value is 10.</p>
pub max_results: ::std::option::Option<i32>,
/// <p>Configuration for including item metadata in the recommendation response. Use this to specify which metadata columns to return alongside recommended items.</p>
pub metadata_config: ::std::option::Option<crate::types::MetadataConfig>,
/// <p>Runtime diversity configuration for this request. Enables diversity-aware recommendations and optionally supplies values for placeholder-based diversity caps configured on the recommender.</p>
pub diversity_config: ::std::option::Option<crate::types::RecommendationDiversityConfig>,
}
impl GetProfileRecommendationsInput {
/// <p>The unique name of the domain.</p>
pub fn domain_name(&self) -> ::std::option::Option<&str> {
self.domain_name.as_deref()
}
/// <p>The unique identifier of the profile for which to retrieve recommendations.</p>
pub fn profile_id(&self) -> ::std::option::Option<&str> {
self.profile_id.as_deref()
}
/// <p>The unique name of the recommender.</p>
pub fn recommender_name(&self) -> ::std::option::Option<&str> {
self.recommender_name.as_deref()
}
/// <p>The contextual metadata used to provide dynamic runtime information to tailor recommendations.</p>
pub fn context(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.context.as_ref()
}
/// <p>A list of filters to apply to the returned recommendations. Filters define criteria for including or excluding items from the recommendation results.</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 `.recommender_filters.is_none()`.
pub fn recommender_filters(&self) -> &[crate::types::RecommenderFilter] {
self.recommender_filters.as_deref().unwrap_or_default()
}
/// <p>A list of promotional filters to apply to the recommendations. Promotional filters allow you to promote specific items within a configurable subset of recommendation results.</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 `.recommender_promotional_filters.is_none()`.
pub fn recommender_promotional_filters(&self) -> &[crate::types::RecommenderPromotionalFilter] {
self.recommender_promotional_filters.as_deref().unwrap_or_default()
}
/// <p>A list of item IDs to rank for the user. Use this when you want to re-rank a specific set of items rather than getting recommendations from the full item catalog. Required for personalized-ranking use cases.</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 `.candidate_ids.is_none()`.
pub fn candidate_ids(&self) -> &[::std::string::String] {
self.candidate_ids.as_deref().unwrap_or_default()
}
/// <p>The maximum number of recommendations to return. The default value is 10.</p>
pub fn max_results(&self) -> ::std::option::Option<i32> {
self.max_results
}
/// <p>Configuration for including item metadata in the recommendation response. Use this to specify which metadata columns to return alongside recommended items.</p>
pub fn metadata_config(&self) -> ::std::option::Option<&crate::types::MetadataConfig> {
self.metadata_config.as_ref()
}
/// <p>Runtime diversity configuration for this request. Enables diversity-aware recommendations and optionally supplies values for placeholder-based diversity caps configured on the recommender.</p>
pub fn diversity_config(&self) -> ::std::option::Option<&crate::types::RecommendationDiversityConfig> {
self.diversity_config.as_ref()
}
}
impl ::std::fmt::Debug for GetProfileRecommendationsInput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("GetProfileRecommendationsInput");
formatter.field("domain_name", &self.domain_name);
formatter.field("profile_id", &self.profile_id);
formatter.field("recommender_name", &self.recommender_name);
formatter.field("context", &"*** Sensitive Data Redacted ***");
formatter.field("recommender_filters", &self.recommender_filters);
formatter.field("recommender_promotional_filters", &self.recommender_promotional_filters);
formatter.field("candidate_ids", &self.candidate_ids);
formatter.field("max_results", &self.max_results);
formatter.field("metadata_config", &self.metadata_config);
formatter.field("diversity_config", &self.diversity_config);
formatter.finish()
}
}
impl GetProfileRecommendationsInput {
/// Creates a new builder-style object to manufacture [`GetProfileRecommendationsInput`](crate::operation::get_profile_recommendations::GetProfileRecommendationsInput).
pub fn builder() -> crate::operation::get_profile_recommendations::builders::GetProfileRecommendationsInputBuilder {
crate::operation::get_profile_recommendations::builders::GetProfileRecommendationsInputBuilder::default()
}
}
/// A builder for [`GetProfileRecommendationsInput`](crate::operation::get_profile_recommendations::GetProfileRecommendationsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct GetProfileRecommendationsInputBuilder {
pub(crate) domain_name: ::std::option::Option<::std::string::String>,
pub(crate) profile_id: ::std::option::Option<::std::string::String>,
pub(crate) recommender_name: ::std::option::Option<::std::string::String>,
pub(crate) context: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) recommender_filters: ::std::option::Option<::std::vec::Vec<crate::types::RecommenderFilter>>,
pub(crate) recommender_promotional_filters: ::std::option::Option<::std::vec::Vec<crate::types::RecommenderPromotionalFilter>>,
pub(crate) candidate_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) max_results: ::std::option::Option<i32>,
pub(crate) metadata_config: ::std::option::Option<crate::types::MetadataConfig>,
pub(crate) diversity_config: ::std::option::Option<crate::types::RecommendationDiversityConfig>,
}
impl GetProfileRecommendationsInputBuilder {
/// <p>The unique name of the domain.</p>
/// This field is required.
pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.domain_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique name of the domain.</p>
pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.domain_name = input;
self
}
/// <p>The unique name of the domain.</p>
pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
&self.domain_name
}
/// <p>The unique identifier of the profile for which to retrieve recommendations.</p>
/// This field is required.
pub fn profile_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.profile_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique identifier of the profile for which to retrieve recommendations.</p>
pub fn set_profile_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.profile_id = input;
self
}
/// <p>The unique identifier of the profile for which to retrieve recommendations.</p>
pub fn get_profile_id(&self) -> &::std::option::Option<::std::string::String> {
&self.profile_id
}
/// <p>The unique name of the recommender.</p>
/// This field is required.
pub fn recommender_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.recommender_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique name of the recommender.</p>
pub fn set_recommender_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.recommender_name = input;
self
}
/// <p>The unique name of the recommender.</p>
pub fn get_recommender_name(&self) -> &::std::option::Option<::std::string::String> {
&self.recommender_name
}
/// Adds a key-value pair to `context`.
///
/// To override the contents of this collection use [`set_context`](Self::set_context).
///
/// <p>The contextual metadata used to provide dynamic runtime information to tailor recommendations.</p>
pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.context.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.context = ::std::option::Option::Some(hash_map);
self
}
/// <p>The contextual metadata used to provide dynamic runtime information to tailor recommendations.</p>
pub fn set_context(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.context = input;
self
}
/// <p>The contextual metadata used to provide dynamic runtime information to tailor recommendations.</p>
pub fn get_context(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.context
}
/// Appends an item to `recommender_filters`.
///
/// To override the contents of this collection use [`set_recommender_filters`](Self::set_recommender_filters).
///
/// <p>A list of filters to apply to the returned recommendations. Filters define criteria for including or excluding items from the recommendation results.</p>
pub fn recommender_filters(mut self, input: crate::types::RecommenderFilter) -> Self {
let mut v = self.recommender_filters.unwrap_or_default();
v.push(input);
self.recommender_filters = ::std::option::Option::Some(v);
self
}
/// <p>A list of filters to apply to the returned recommendations. Filters define criteria for including or excluding items from the recommendation results.</p>
pub fn set_recommender_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecommenderFilter>>) -> Self {
self.recommender_filters = input;
self
}
/// <p>A list of filters to apply to the returned recommendations. Filters define criteria for including or excluding items from the recommendation results.</p>
pub fn get_recommender_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecommenderFilter>> {
&self.recommender_filters
}
/// Appends an item to `recommender_promotional_filters`.
///
/// To override the contents of this collection use [`set_recommender_promotional_filters`](Self::set_recommender_promotional_filters).
///
/// <p>A list of promotional filters to apply to the recommendations. Promotional filters allow you to promote specific items within a configurable subset of recommendation results.</p>
pub fn recommender_promotional_filters(mut self, input: crate::types::RecommenderPromotionalFilter) -> Self {
let mut v = self.recommender_promotional_filters.unwrap_or_default();
v.push(input);
self.recommender_promotional_filters = ::std::option::Option::Some(v);
self
}
/// <p>A list of promotional filters to apply to the recommendations. Promotional filters allow you to promote specific items within a configurable subset of recommendation results.</p>
pub fn set_recommender_promotional_filters(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::RecommenderPromotionalFilter>>,
) -> Self {
self.recommender_promotional_filters = input;
self
}
/// <p>A list of promotional filters to apply to the recommendations. Promotional filters allow you to promote specific items within a configurable subset of recommendation results.</p>
pub fn get_recommender_promotional_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecommenderPromotionalFilter>> {
&self.recommender_promotional_filters
}
/// Appends an item to `candidate_ids`.
///
/// To override the contents of this collection use [`set_candidate_ids`](Self::set_candidate_ids).
///
/// <p>A list of item IDs to rank for the user. Use this when you want to re-rank a specific set of items rather than getting recommendations from the full item catalog. Required for personalized-ranking use cases.</p>
pub fn candidate_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.candidate_ids.unwrap_or_default();
v.push(input.into());
self.candidate_ids = ::std::option::Option::Some(v);
self
}
/// <p>A list of item IDs to rank for the user. Use this when you want to re-rank a specific set of items rather than getting recommendations from the full item catalog. Required for personalized-ranking use cases.</p>
pub fn set_candidate_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.candidate_ids = input;
self
}
/// <p>A list of item IDs to rank for the user. Use this when you want to re-rank a specific set of items rather than getting recommendations from the full item catalog. Required for personalized-ranking use cases.</p>
pub fn get_candidate_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.candidate_ids
}
/// <p>The maximum number of recommendations to return. The default value is 10.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = ::std::option::Option::Some(input);
self
}
/// <p>The maximum number of recommendations to return. The default value is 10.</p>
pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
/// <p>The maximum number of recommendations to return. The default value is 10.</p>
pub fn get_max_results(&self) -> &::std::option::Option<i32> {
&self.max_results
}
/// <p>Configuration for including item metadata in the recommendation response. Use this to specify which metadata columns to return alongside recommended items.</p>
pub fn metadata_config(mut self, input: crate::types::MetadataConfig) -> Self {
self.metadata_config = ::std::option::Option::Some(input);
self
}
/// <p>Configuration for including item metadata in the recommendation response. Use this to specify which metadata columns to return alongside recommended items.</p>
pub fn set_metadata_config(mut self, input: ::std::option::Option<crate::types::MetadataConfig>) -> Self {
self.metadata_config = input;
self
}
/// <p>Configuration for including item metadata in the recommendation response. Use this to specify which metadata columns to return alongside recommended items.</p>
pub fn get_metadata_config(&self) -> &::std::option::Option<crate::types::MetadataConfig> {
&self.metadata_config
}
/// <p>Runtime diversity configuration for this request. Enables diversity-aware recommendations and optionally supplies values for placeholder-based diversity caps configured on the recommender.</p>
pub fn diversity_config(mut self, input: crate::types::RecommendationDiversityConfig) -> Self {
self.diversity_config = ::std::option::Option::Some(input);
self
}
/// <p>Runtime diversity configuration for this request. Enables diversity-aware recommendations and optionally supplies values for placeholder-based diversity caps configured on the recommender.</p>
pub fn set_diversity_config(mut self, input: ::std::option::Option<crate::types::RecommendationDiversityConfig>) -> Self {
self.diversity_config = input;
self
}
/// <p>Runtime diversity configuration for this request. Enables diversity-aware recommendations and optionally supplies values for placeholder-based diversity caps configured on the recommender.</p>
pub fn get_diversity_config(&self) -> &::std::option::Option<crate::types::RecommendationDiversityConfig> {
&self.diversity_config
}
/// Consumes the builder and constructs a [`GetProfileRecommendationsInput`](crate::operation::get_profile_recommendations::GetProfileRecommendationsInput).
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::get_profile_recommendations::GetProfileRecommendationsInput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::get_profile_recommendations::GetProfileRecommendationsInput {
domain_name: self.domain_name,
profile_id: self.profile_id,
recommender_name: self.recommender_name,
context: self.context,
recommender_filters: self.recommender_filters,
recommender_promotional_filters: self.recommender_promotional_filters,
candidate_ids: self.candidate_ids,
max_results: self.max_results,
metadata_config: self.metadata_config,
diversity_config: self.diversity_config,
})
}
}
impl ::std::fmt::Debug for GetProfileRecommendationsInputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("GetProfileRecommendationsInputBuilder");
formatter.field("domain_name", &self.domain_name);
formatter.field("profile_id", &self.profile_id);
formatter.field("recommender_name", &self.recommender_name);
formatter.field("context", &"*** Sensitive Data Redacted ***");
formatter.field("recommender_filters", &self.recommender_filters);
formatter.field("recommender_promotional_filters", &self.recommender_promotional_filters);
formatter.field("candidate_ids", &self.candidate_ids);
formatter.field("max_results", &self.max_results);
formatter.field("metadata_config", &self.metadata_config);
formatter.field("diversity_config", &self.diversity_config);
formatter.finish()
}
}