-
Notifications
You must be signed in to change notification settings - Fork 244
/
output.rs
171 lines (170 loc) · 7.89 KB
/
output.rs
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
// 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 GetRecommendationsOutput {
/// <p>A list of recommendations sorted in descending order by prediction score. There can be a maximum of 500 items in the list.</p>
pub item_list: std::option::Option<std::vec::Vec<crate::model::PredictedItem>>,
/// <p>The ID of the recommendation.</p>
pub recommendation_id: std::option::Option<std::string::String>,
}
impl GetRecommendationsOutput {
/// <p>A list of recommendations sorted in descending order by prediction score. There can be a maximum of 500 items in the list.</p>
pub fn item_list(&self) -> std::option::Option<&[crate::model::PredictedItem]> {
self.item_list.as_deref()
}
/// <p>The ID of the recommendation.</p>
pub fn recommendation_id(&self) -> std::option::Option<&str> {
self.recommendation_id.as_deref()
}
}
impl std::fmt::Debug for GetRecommendationsOutput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetRecommendationsOutput");
formatter.field("item_list", &self.item_list);
formatter.field("recommendation_id", &self.recommendation_id);
formatter.finish()
}
}
/// See [`GetRecommendationsOutput`](crate::output::GetRecommendationsOutput)
pub mod get_recommendations_output {
/// A builder for [`GetRecommendationsOutput`](crate::output::GetRecommendationsOutput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) item_list: std::option::Option<std::vec::Vec<crate::model::PredictedItem>>,
pub(crate) recommendation_id: std::option::Option<std::string::String>,
}
impl Builder {
/// Appends an item to `item_list`.
///
/// To override the contents of this collection use [`set_item_list`](Self::set_item_list).
///
/// <p>A list of recommendations sorted in descending order by prediction score. There can be a maximum of 500 items in the list.</p>
pub fn item_list(mut self, input: crate::model::PredictedItem) -> Self {
let mut v = self.item_list.unwrap_or_default();
v.push(input);
self.item_list = Some(v);
self
}
/// <p>A list of recommendations sorted in descending order by prediction score. There can be a maximum of 500 items in the list.</p>
pub fn set_item_list(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::PredictedItem>>,
) -> Self {
self.item_list = input;
self
}
/// <p>The ID of the recommendation.</p>
pub fn recommendation_id(mut self, input: impl Into<std::string::String>) -> Self {
self.recommendation_id = Some(input.into());
self
}
/// <p>The ID of the recommendation.</p>
pub fn set_recommendation_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.recommendation_id = input;
self
}
/// Consumes the builder and constructs a [`GetRecommendationsOutput`](crate::output::GetRecommendationsOutput)
pub fn build(self) -> crate::output::GetRecommendationsOutput {
crate::output::GetRecommendationsOutput {
item_list: self.item_list,
recommendation_id: self.recommendation_id,
}
}
}
}
impl GetRecommendationsOutput {
/// Creates a new builder-style object to manufacture [`GetRecommendationsOutput`](crate::output::GetRecommendationsOutput)
pub fn builder() -> crate::output::get_recommendations_output::Builder {
crate::output::get_recommendations_output::Builder::default()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetPersonalizedRankingOutput {
/// <p>A list of items in order of most likely interest to the user. The maximum is 500.</p>
pub personalized_ranking: std::option::Option<std::vec::Vec<crate::model::PredictedItem>>,
/// <p>The ID of the recommendation.</p>
pub recommendation_id: std::option::Option<std::string::String>,
}
impl GetPersonalizedRankingOutput {
/// <p>A list of items in order of most likely interest to the user. The maximum is 500.</p>
pub fn personalized_ranking(&self) -> std::option::Option<&[crate::model::PredictedItem]> {
self.personalized_ranking.as_deref()
}
/// <p>The ID of the recommendation.</p>
pub fn recommendation_id(&self) -> std::option::Option<&str> {
self.recommendation_id.as_deref()
}
}
impl std::fmt::Debug for GetPersonalizedRankingOutput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetPersonalizedRankingOutput");
formatter.field("personalized_ranking", &self.personalized_ranking);
formatter.field("recommendation_id", &self.recommendation_id);
formatter.finish()
}
}
/// See [`GetPersonalizedRankingOutput`](crate::output::GetPersonalizedRankingOutput)
pub mod get_personalized_ranking_output {
/// A builder for [`GetPersonalizedRankingOutput`](crate::output::GetPersonalizedRankingOutput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) personalized_ranking:
std::option::Option<std::vec::Vec<crate::model::PredictedItem>>,
pub(crate) recommendation_id: std::option::Option<std::string::String>,
}
impl Builder {
/// Appends an item to `personalized_ranking`.
///
/// To override the contents of this collection use [`set_personalized_ranking`](Self::set_personalized_ranking).
///
/// <p>A list of items in order of most likely interest to the user. The maximum is 500.</p>
pub fn personalized_ranking(mut self, input: crate::model::PredictedItem) -> Self {
let mut v = self.personalized_ranking.unwrap_or_default();
v.push(input);
self.personalized_ranking = Some(v);
self
}
/// <p>A list of items in order of most likely interest to the user. The maximum is 500.</p>
pub fn set_personalized_ranking(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::PredictedItem>>,
) -> Self {
self.personalized_ranking = input;
self
}
/// <p>The ID of the recommendation.</p>
pub fn recommendation_id(mut self, input: impl Into<std::string::String>) -> Self {
self.recommendation_id = Some(input.into());
self
}
/// <p>The ID of the recommendation.</p>
pub fn set_recommendation_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.recommendation_id = input;
self
}
/// Consumes the builder and constructs a [`GetPersonalizedRankingOutput`](crate::output::GetPersonalizedRankingOutput)
pub fn build(self) -> crate::output::GetPersonalizedRankingOutput {
crate::output::GetPersonalizedRankingOutput {
personalized_ranking: self.personalized_ranking,
recommendation_id: self.recommendation_id,
}
}
}
}
impl GetPersonalizedRankingOutput {
/// Creates a new builder-style object to manufacture [`GetPersonalizedRankingOutput`](crate::output::GetPersonalizedRankingOutput)
pub fn builder() -> crate::output::get_personalized_ranking_output::Builder {
crate::output::get_personalized_ranking_output::Builder::default()
}
}