aws_sdk_kendra/operation/get_snapshots/
_get_snapshots_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetSnapshotsOutput {
6    /// <p>The Unix timestamp for the beginning and end of the time window for the search metrics data.</p>
7    pub snap_shot_time_filter: ::std::option::Option<crate::types::TimeRange>,
8    /// <p>The column headers for the search metrics data.</p>
9    pub snapshots_data_header: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10    /// <p>The search metrics data. The data returned depends on the metric type you requested.</p>
11    pub snapshots_data: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
12    /// <p>If the response is truncated, Amazon Kendra returns this token, which you can use in a later request to retrieve the next set of search metrics data.</p>
13    pub next_token: ::std::option::Option<::std::string::String>,
14    _request_id: Option<String>,
15}
16impl GetSnapshotsOutput {
17    /// <p>The Unix timestamp for the beginning and end of the time window for the search metrics data.</p>
18    pub fn snap_shot_time_filter(&self) -> ::std::option::Option<&crate::types::TimeRange> {
19        self.snap_shot_time_filter.as_ref()
20    }
21    /// <p>The column headers for the search metrics data.</p>
22    ///
23    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.snapshots_data_header.is_none()`.
24    pub fn snapshots_data_header(&self) -> &[::std::string::String] {
25        self.snapshots_data_header.as_deref().unwrap_or_default()
26    }
27    /// <p>The search metrics data. The data returned depends on the metric type you requested.</p>
28    ///
29    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.snapshots_data.is_none()`.
30    pub fn snapshots_data(&self) -> &[::std::vec::Vec<::std::string::String>] {
31        self.snapshots_data.as_deref().unwrap_or_default()
32    }
33    /// <p>If the response is truncated, Amazon Kendra returns this token, which you can use in a later request to retrieve the next set of search metrics data.</p>
34    pub fn next_token(&self) -> ::std::option::Option<&str> {
35        self.next_token.as_deref()
36    }
37}
38impl ::aws_types::request_id::RequestId for GetSnapshotsOutput {
39    fn request_id(&self) -> Option<&str> {
40        self._request_id.as_deref()
41    }
42}
43impl GetSnapshotsOutput {
44    /// Creates a new builder-style object to manufacture [`GetSnapshotsOutput`](crate::operation::get_snapshots::GetSnapshotsOutput).
45    pub fn builder() -> crate::operation::get_snapshots::builders::GetSnapshotsOutputBuilder {
46        crate::operation::get_snapshots::builders::GetSnapshotsOutputBuilder::default()
47    }
48}
49
50/// A builder for [`GetSnapshotsOutput`](crate::operation::get_snapshots::GetSnapshotsOutput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct GetSnapshotsOutputBuilder {
54    pub(crate) snap_shot_time_filter: ::std::option::Option<crate::types::TimeRange>,
55    pub(crate) snapshots_data_header: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
56    pub(crate) snapshots_data: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
57    pub(crate) next_token: ::std::option::Option<::std::string::String>,
58    _request_id: Option<String>,
59}
60impl GetSnapshotsOutputBuilder {
61    /// <p>The Unix timestamp for the beginning and end of the time window for the search metrics data.</p>
62    pub fn snap_shot_time_filter(mut self, input: crate::types::TimeRange) -> Self {
63        self.snap_shot_time_filter = ::std::option::Option::Some(input);
64        self
65    }
66    /// <p>The Unix timestamp for the beginning and end of the time window for the search metrics data.</p>
67    pub fn set_snap_shot_time_filter(mut self, input: ::std::option::Option<crate::types::TimeRange>) -> Self {
68        self.snap_shot_time_filter = input;
69        self
70    }
71    /// <p>The Unix timestamp for the beginning and end of the time window for the search metrics data.</p>
72    pub fn get_snap_shot_time_filter(&self) -> &::std::option::Option<crate::types::TimeRange> {
73        &self.snap_shot_time_filter
74    }
75    /// Appends an item to `snapshots_data_header`.
76    ///
77    /// To override the contents of this collection use [`set_snapshots_data_header`](Self::set_snapshots_data_header).
78    ///
79    /// <p>The column headers for the search metrics data.</p>
80    pub fn snapshots_data_header(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        let mut v = self.snapshots_data_header.unwrap_or_default();
82        v.push(input.into());
83        self.snapshots_data_header = ::std::option::Option::Some(v);
84        self
85    }
86    /// <p>The column headers for the search metrics data.</p>
87    pub fn set_snapshots_data_header(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
88        self.snapshots_data_header = input;
89        self
90    }
91    /// <p>The column headers for the search metrics data.</p>
92    pub fn get_snapshots_data_header(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
93        &self.snapshots_data_header
94    }
95    /// Appends an item to `snapshots_data`.
96    ///
97    /// To override the contents of this collection use [`set_snapshots_data`](Self::set_snapshots_data).
98    ///
99    /// <p>The search metrics data. The data returned depends on the metric type you requested.</p>
100    pub fn snapshots_data(mut self, input: ::std::vec::Vec<::std::string::String>) -> Self {
101        let mut v = self.snapshots_data.unwrap_or_default();
102        v.push(input);
103        self.snapshots_data = ::std::option::Option::Some(v);
104        self
105    }
106    /// <p>The search metrics data. The data returned depends on the metric type you requested.</p>
107    pub fn set_snapshots_data(mut self, input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>) -> Self {
108        self.snapshots_data = input;
109        self
110    }
111    /// <p>The search metrics data. The data returned depends on the metric type you requested.</p>
112    pub fn get_snapshots_data(&self) -> &::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>> {
113        &self.snapshots_data
114    }
115    /// <p>If the response is truncated, Amazon Kendra returns this token, which you can use in a later request to retrieve the next set of search metrics data.</p>
116    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.next_token = ::std::option::Option::Some(input.into());
118        self
119    }
120    /// <p>If the response is truncated, Amazon Kendra returns this token, which you can use in a later request to retrieve the next set of search metrics data.</p>
121    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.next_token = input;
123        self
124    }
125    /// <p>If the response is truncated, Amazon Kendra returns this token, which you can use in a later request to retrieve the next set of search metrics data.</p>
126    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
127        &self.next_token
128    }
129    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
130        self._request_id = Some(request_id.into());
131        self
132    }
133
134    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
135        self._request_id = request_id;
136        self
137    }
138    /// Consumes the builder and constructs a [`GetSnapshotsOutput`](crate::operation::get_snapshots::GetSnapshotsOutput).
139    pub fn build(self) -> crate::operation::get_snapshots::GetSnapshotsOutput {
140        crate::operation::get_snapshots::GetSnapshotsOutput {
141            snap_shot_time_filter: self.snap_shot_time_filter,
142            snapshots_data_header: self.snapshots_data_header,
143            snapshots_data: self.snapshots_data,
144            next_token: self.next_token,
145            _request_id: self._request_id,
146        }
147    }
148}