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
// 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, ::std::fmt::Debug)]
pub struct SubmitFeedbackInput {
/// <p>The identifier of the index that was queried.</p>
pub index_id: ::std::option::Option<::std::string::String>,
/// <p>The identifier of the specific query for which you are submitting feedback. The query ID is returned in the response to the <code>Query</code> API.</p>
pub query_id: ::std::option::Option<::std::string::String>,
/// <p>Tells Amazon Kendra that a particular search result link was chosen by the user.</p>
pub click_feedback_items: ::std::option::Option<::std::vec::Vec<crate::types::ClickFeedback>>,
/// <p>Provides Amazon Kendra with relevant or not relevant feedback for whether a particular item was relevant to the search.</p>
pub relevance_feedback_items: ::std::option::Option<::std::vec::Vec<crate::types::RelevanceFeedback>>,
}
impl SubmitFeedbackInput {
/// <p>The identifier of the index that was queried.</p>
pub fn index_id(&self) -> ::std::option::Option<&str> {
self.index_id.as_deref()
}
/// <p>The identifier of the specific query for which you are submitting feedback. The query ID is returned in the response to the <code>Query</code> API.</p>
pub fn query_id(&self) -> ::std::option::Option<&str> {
self.query_id.as_deref()
}
/// <p>Tells Amazon Kendra that a particular search result link was chosen by the user.</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 `.click_feedback_items.is_none()`.
pub fn click_feedback_items(&self) -> &[crate::types::ClickFeedback] {
self.click_feedback_items.as_deref().unwrap_or_default()
}
/// <p>Provides Amazon Kendra with relevant or not relevant feedback for whether a particular item was relevant to the search.</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 `.relevance_feedback_items.is_none()`.
pub fn relevance_feedback_items(&self) -> &[crate::types::RelevanceFeedback] {
self.relevance_feedback_items.as_deref().unwrap_or_default()
}
}
impl SubmitFeedbackInput {
/// Creates a new builder-style object to manufacture [`SubmitFeedbackInput`](crate::operation::submit_feedback::SubmitFeedbackInput).
pub fn builder() -> crate::operation::submit_feedback::builders::SubmitFeedbackInputBuilder {
crate::operation::submit_feedback::builders::SubmitFeedbackInputBuilder::default()
}
}
/// A builder for [`SubmitFeedbackInput`](crate::operation::submit_feedback::SubmitFeedbackInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SubmitFeedbackInputBuilder {
pub(crate) index_id: ::std::option::Option<::std::string::String>,
pub(crate) query_id: ::std::option::Option<::std::string::String>,
pub(crate) click_feedback_items: ::std::option::Option<::std::vec::Vec<crate::types::ClickFeedback>>,
pub(crate) relevance_feedback_items: ::std::option::Option<::std::vec::Vec<crate::types::RelevanceFeedback>>,
}
impl SubmitFeedbackInputBuilder {
/// <p>The identifier of the index that was queried.</p>
/// This field is required.
pub fn index_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.index_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The identifier of the index that was queried.</p>
pub fn set_index_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.index_id = input;
self
}
/// <p>The identifier of the index that was queried.</p>
pub fn get_index_id(&self) -> &::std::option::Option<::std::string::String> {
&self.index_id
}
/// <p>The identifier of the specific query for which you are submitting feedback. The query ID is returned in the response to the <code>Query</code> API.</p>
/// This field is required.
pub fn query_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.query_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The identifier of the specific query for which you are submitting feedback. The query ID is returned in the response to the <code>Query</code> API.</p>
pub fn set_query_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.query_id = input;
self
}
/// <p>The identifier of the specific query for which you are submitting feedback. The query ID is returned in the response to the <code>Query</code> API.</p>
pub fn get_query_id(&self) -> &::std::option::Option<::std::string::String> {
&self.query_id
}
/// Appends an item to `click_feedback_items`.
///
/// To override the contents of this collection use [`set_click_feedback_items`](Self::set_click_feedback_items).
///
/// <p>Tells Amazon Kendra that a particular search result link was chosen by the user.</p>
pub fn click_feedback_items(mut self, input: crate::types::ClickFeedback) -> Self {
let mut v = self.click_feedback_items.unwrap_or_default();
v.push(input);
self.click_feedback_items = ::std::option::Option::Some(v);
self
}
/// <p>Tells Amazon Kendra that a particular search result link was chosen by the user.</p>
pub fn set_click_feedback_items(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ClickFeedback>>) -> Self {
self.click_feedback_items = input;
self
}
/// <p>Tells Amazon Kendra that a particular search result link was chosen by the user.</p>
pub fn get_click_feedback_items(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ClickFeedback>> {
&self.click_feedback_items
}
/// Appends an item to `relevance_feedback_items`.
///
/// To override the contents of this collection use [`set_relevance_feedback_items`](Self::set_relevance_feedback_items).
///
/// <p>Provides Amazon Kendra with relevant or not relevant feedback for whether a particular item was relevant to the search.</p>
pub fn relevance_feedback_items(mut self, input: crate::types::RelevanceFeedback) -> Self {
let mut v = self.relevance_feedback_items.unwrap_or_default();
v.push(input);
self.relevance_feedback_items = ::std::option::Option::Some(v);
self
}
/// <p>Provides Amazon Kendra with relevant or not relevant feedback for whether a particular item was relevant to the search.</p>
pub fn set_relevance_feedback_items(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RelevanceFeedback>>) -> Self {
self.relevance_feedback_items = input;
self
}
/// <p>Provides Amazon Kendra with relevant or not relevant feedback for whether a particular item was relevant to the search.</p>
pub fn get_relevance_feedback_items(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RelevanceFeedback>> {
&self.relevance_feedback_items
}
/// Consumes the builder and constructs a [`SubmitFeedbackInput`](crate::operation::submit_feedback::SubmitFeedbackInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::submit_feedback::SubmitFeedbackInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::submit_feedback::SubmitFeedbackInput {
index_id: self.index_id,
query_id: self.query_id,
click_feedback_items: self.click_feedback_items,
relevance_feedback_items: self.relevance_feedback_items,
})
}
}