aws_sdk_kendra/types/
_expanded_result_item.rs1#[non_exhaustive]
6#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
7pub struct ExpandedResultItem {
8 pub id: ::std::option::Option<::std::string::String>,
10 pub document_id: ::std::option::Option<::std::string::String>,
12 pub document_title: ::std::option::Option<crate::types::TextWithHighlights>,
14 pub document_excerpt: ::std::option::Option<crate::types::TextWithHighlights>,
16 pub document_uri: ::std::option::Option<::std::string::String>,
18 pub document_attributes: ::std::option::Option<::std::vec::Vec<crate::types::DocumentAttribute>>,
20}
21impl ExpandedResultItem {
22 pub fn id(&self) -> ::std::option::Option<&str> {
24 self.id.as_deref()
25 }
26 pub fn document_id(&self) -> ::std::option::Option<&str> {
28 self.document_id.as_deref()
29 }
30 pub fn document_title(&self) -> ::std::option::Option<&crate::types::TextWithHighlights> {
32 self.document_title.as_ref()
33 }
34 pub fn document_excerpt(&self) -> ::std::option::Option<&crate::types::TextWithHighlights> {
36 self.document_excerpt.as_ref()
37 }
38 pub fn document_uri(&self) -> ::std::option::Option<&str> {
40 self.document_uri.as_deref()
41 }
42 pub fn document_attributes(&self) -> &[crate::types::DocumentAttribute] {
46 self.document_attributes.as_deref().unwrap_or_default()
47 }
48}
49impl ExpandedResultItem {
50 pub fn builder() -> crate::types::builders::ExpandedResultItemBuilder {
52 crate::types::builders::ExpandedResultItemBuilder::default()
53 }
54}
55
56#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct ExpandedResultItemBuilder {
60 pub(crate) id: ::std::option::Option<::std::string::String>,
61 pub(crate) document_id: ::std::option::Option<::std::string::String>,
62 pub(crate) document_title: ::std::option::Option<crate::types::TextWithHighlights>,
63 pub(crate) document_excerpt: ::std::option::Option<crate::types::TextWithHighlights>,
64 pub(crate) document_uri: ::std::option::Option<::std::string::String>,
65 pub(crate) document_attributes: ::std::option::Option<::std::vec::Vec<crate::types::DocumentAttribute>>,
66}
67impl ExpandedResultItemBuilder {
68 pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70 self.id = ::std::option::Option::Some(input.into());
71 self
72 }
73 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75 self.id = input;
76 self
77 }
78 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
80 &self.id
81 }
82 pub fn document_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84 self.document_id = ::std::option::Option::Some(input.into());
85 self
86 }
87 pub fn set_document_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89 self.document_id = input;
90 self
91 }
92 pub fn get_document_id(&self) -> &::std::option::Option<::std::string::String> {
94 &self.document_id
95 }
96 pub fn document_title(mut self, input: crate::types::TextWithHighlights) -> Self {
98 self.document_title = ::std::option::Option::Some(input);
99 self
100 }
101 pub fn set_document_title(mut self, input: ::std::option::Option<crate::types::TextWithHighlights>) -> Self {
103 self.document_title = input;
104 self
105 }
106 pub fn get_document_title(&self) -> &::std::option::Option<crate::types::TextWithHighlights> {
108 &self.document_title
109 }
110 pub fn document_excerpt(mut self, input: crate::types::TextWithHighlights) -> Self {
112 self.document_excerpt = ::std::option::Option::Some(input);
113 self
114 }
115 pub fn set_document_excerpt(mut self, input: ::std::option::Option<crate::types::TextWithHighlights>) -> Self {
117 self.document_excerpt = input;
118 self
119 }
120 pub fn get_document_excerpt(&self) -> &::std::option::Option<crate::types::TextWithHighlights> {
122 &self.document_excerpt
123 }
124 pub fn document_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126 self.document_uri = ::std::option::Option::Some(input.into());
127 self
128 }
129 pub fn set_document_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131 self.document_uri = input;
132 self
133 }
134 pub fn get_document_uri(&self) -> &::std::option::Option<::std::string::String> {
136 &self.document_uri
137 }
138 pub fn document_attributes(mut self, input: crate::types::DocumentAttribute) -> Self {
144 let mut v = self.document_attributes.unwrap_or_default();
145 v.push(input);
146 self.document_attributes = ::std::option::Option::Some(v);
147 self
148 }
149 pub fn set_document_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DocumentAttribute>>) -> Self {
151 self.document_attributes = input;
152 self
153 }
154 pub fn get_document_attributes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DocumentAttribute>> {
156 &self.document_attributes
157 }
158 pub fn build(self) -> crate::types::ExpandedResultItem {
160 crate::types::ExpandedResultItem {
161 id: self.id,
162 document_id: self.document_id,
163 document_title: self.document_title,
164 document_excerpt: self.document_excerpt,
165 document_uri: self.document_uri,
166 document_attributes: self.document_attributes,
167 }
168 }
169}