aws_sdk_bedrockagentruntime/operation/rerank/
_rerank_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct RerankInput {
6 pub queries: ::std::option::Option<::std::vec::Vec<crate::types::RerankQuery>>,
8 pub sources: ::std::option::Option<::std::vec::Vec<crate::types::RerankSource>>,
10 pub reranking_configuration: ::std::option::Option<crate::types::RerankingConfiguration>,
12 pub next_token: ::std::option::Option<::std::string::String>,
14}
15impl RerankInput {
16 pub fn queries(&self) -> &[crate::types::RerankQuery] {
20 self.queries.as_deref().unwrap_or_default()
21 }
22 pub fn sources(&self) -> &[crate::types::RerankSource] {
26 self.sources.as_deref().unwrap_or_default()
27 }
28 pub fn reranking_configuration(&self) -> ::std::option::Option<&crate::types::RerankingConfiguration> {
30 self.reranking_configuration.as_ref()
31 }
32 pub fn next_token(&self) -> ::std::option::Option<&str> {
34 self.next_token.as_deref()
35 }
36}
37impl ::std::fmt::Debug for RerankInput {
38 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
39 let mut formatter = f.debug_struct("RerankInput");
40 formatter.field("queries", &"*** Sensitive Data Redacted ***");
41 formatter.field("sources", &"*** Sensitive Data Redacted ***");
42 formatter.field("reranking_configuration", &self.reranking_configuration);
43 formatter.field("next_token", &self.next_token);
44 formatter.finish()
45 }
46}
47impl RerankInput {
48 pub fn builder() -> crate::operation::rerank::builders::RerankInputBuilder {
50 crate::operation::rerank::builders::RerankInputBuilder::default()
51 }
52}
53
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
56#[non_exhaustive]
57pub struct RerankInputBuilder {
58 pub(crate) queries: ::std::option::Option<::std::vec::Vec<crate::types::RerankQuery>>,
59 pub(crate) sources: ::std::option::Option<::std::vec::Vec<crate::types::RerankSource>>,
60 pub(crate) reranking_configuration: ::std::option::Option<crate::types::RerankingConfiguration>,
61 pub(crate) next_token: ::std::option::Option<::std::string::String>,
62}
63impl RerankInputBuilder {
64 pub fn queries(mut self, input: crate::types::RerankQuery) -> Self {
70 let mut v = self.queries.unwrap_or_default();
71 v.push(input);
72 self.queries = ::std::option::Option::Some(v);
73 self
74 }
75 pub fn set_queries(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RerankQuery>>) -> Self {
77 self.queries = input;
78 self
79 }
80 pub fn get_queries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RerankQuery>> {
82 &self.queries
83 }
84 pub fn sources(mut self, input: crate::types::RerankSource) -> Self {
90 let mut v = self.sources.unwrap_or_default();
91 v.push(input);
92 self.sources = ::std::option::Option::Some(v);
93 self
94 }
95 pub fn set_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RerankSource>>) -> Self {
97 self.sources = input;
98 self
99 }
100 pub fn get_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RerankSource>> {
102 &self.sources
103 }
104 pub fn reranking_configuration(mut self, input: crate::types::RerankingConfiguration) -> Self {
107 self.reranking_configuration = ::std::option::Option::Some(input);
108 self
109 }
110 pub fn set_reranking_configuration(mut self, input: ::std::option::Option<crate::types::RerankingConfiguration>) -> Self {
112 self.reranking_configuration = input;
113 self
114 }
115 pub fn get_reranking_configuration(&self) -> &::std::option::Option<crate::types::RerankingConfiguration> {
117 &self.reranking_configuration
118 }
119 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.next_token = ::std::option::Option::Some(input.into());
122 self
123 }
124 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.next_token = input;
127 self
128 }
129 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
131 &self.next_token
132 }
133 pub fn build(self) -> ::std::result::Result<crate::operation::rerank::RerankInput, ::aws_smithy_types::error::operation::BuildError> {
135 ::std::result::Result::Ok(crate::operation::rerank::RerankInput {
136 queries: self.queries,
137 sources: self.sources,
138 reranking_configuration: self.reranking_configuration,
139 next_token: self.next_token,
140 })
141 }
142}
143impl ::std::fmt::Debug for RerankInputBuilder {
144 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
145 let mut formatter = f.debug_struct("RerankInputBuilder");
146 formatter.field("queries", &"*** Sensitive Data Redacted ***");
147 formatter.field("sources", &"*** Sensitive Data Redacted ***");
148 formatter.field("reranking_configuration", &self.reranking_configuration);
149 formatter.field("next_token", &self.next_token);
150 formatter.finish()
151 }
152}