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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The collection of documents that match the search request.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Hits {
/// <p>The total number of documents that match the search request.</p>
pub found: i64,
/// <p>The index of the first matching document.</p>
pub start: i64,
/// <p>A cursor that can be used to retrieve the next set of matching documents when you want to page through a large result set.</p>
pub cursor: ::std::option::Option<::std::string::String>,
/// <p>A document that matches the search request.</p>
pub hit: ::std::option::Option<::std::vec::Vec<crate::types::Hit>>,
}
impl Hits {
/// <p>The total number of documents that match the search request.</p>
pub fn found(&self) -> i64 {
self.found
}
/// <p>The index of the first matching document.</p>
pub fn start(&self) -> i64 {
self.start
}
/// <p>A cursor that can be used to retrieve the next set of matching documents when you want to page through a large result set.</p>
pub fn cursor(&self) -> ::std::option::Option<&str> {
self.cursor.as_deref()
}
/// <p>A document that matches the search request.</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 `.hit.is_none()`.
pub fn hit(&self) -> &[crate::types::Hit] {
self.hit.as_deref().unwrap_or_default()
}
}
impl Hits {
/// Creates a new builder-style object to manufacture [`Hits`](crate::types::Hits).
pub fn builder() -> crate::types::builders::HitsBuilder {
crate::types::builders::HitsBuilder::default()
}
}
/// A builder for [`Hits`](crate::types::Hits).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct HitsBuilder {
pub(crate) found: ::std::option::Option<i64>,
pub(crate) start: ::std::option::Option<i64>,
pub(crate) cursor: ::std::option::Option<::std::string::String>,
pub(crate) hit: ::std::option::Option<::std::vec::Vec<crate::types::Hit>>,
}
impl HitsBuilder {
/// <p>The total number of documents that match the search request.</p>
pub fn found(mut self, input: i64) -> Self {
self.found = ::std::option::Option::Some(input);
self
}
/// <p>The total number of documents that match the search request.</p>
pub fn set_found(mut self, input: ::std::option::Option<i64>) -> Self {
self.found = input;
self
}
/// <p>The total number of documents that match the search request.</p>
pub fn get_found(&self) -> &::std::option::Option<i64> {
&self.found
}
/// <p>The index of the first matching document.</p>
pub fn start(mut self, input: i64) -> Self {
self.start = ::std::option::Option::Some(input);
self
}
/// <p>The index of the first matching document.</p>
pub fn set_start(mut self, input: ::std::option::Option<i64>) -> Self {
self.start = input;
self
}
/// <p>The index of the first matching document.</p>
pub fn get_start(&self) -> &::std::option::Option<i64> {
&self.start
}
/// <p>A cursor that can be used to retrieve the next set of matching documents when you want to page through a large result set.</p>
pub fn cursor(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.cursor = ::std::option::Option::Some(input.into());
self
}
/// <p>A cursor that can be used to retrieve the next set of matching documents when you want to page through a large result set.</p>
pub fn set_cursor(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.cursor = input;
self
}
/// <p>A cursor that can be used to retrieve the next set of matching documents when you want to page through a large result set.</p>
pub fn get_cursor(&self) -> &::std::option::Option<::std::string::String> {
&self.cursor
}
/// Appends an item to `hit`.
///
/// To override the contents of this collection use [`set_hit`](Self::set_hit).
///
/// <p>A document that matches the search request.</p>
pub fn hit(mut self, input: crate::types::Hit) -> Self {
let mut v = self.hit.unwrap_or_default();
v.push(input);
self.hit = ::std::option::Option::Some(v);
self
}
/// <p>A document that matches the search request.</p>
pub fn set_hit(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Hit>>) -> Self {
self.hit = input;
self
}
/// <p>A document that matches the search request.</p>
pub fn get_hit(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Hit>> {
&self.hit
}
/// Consumes the builder and constructs a [`Hits`](crate::types::Hits).
pub fn build(self) -> crate::types::Hits {
crate::types::Hits {
found: self.found.unwrap_or_default(),
start: self.start.unwrap_or_default(),
cursor: self.cursor,
hit: self.hit,
}
}
}