aws_sdk_cloudsearchdomain/operation/suggest/
_suggest_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the response to a <code>Suggest</code> request.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SuggestOutput {
7    /// <p>The status of a <code>SuggestRequest</code>. Contains the resource ID (<code>rid</code>) and how long it took to process the request (<code>timems</code>).</p>
8    pub status: ::std::option::Option<crate::types::SuggestStatus>,
9    /// <p>Container for the matching search suggestion information.</p>
10    pub suggest: ::std::option::Option<crate::types::SuggestModel>,
11    _request_id: Option<String>,
12}
13impl SuggestOutput {
14    /// <p>The status of a <code>SuggestRequest</code>. Contains the resource ID (<code>rid</code>) and how long it took to process the request (<code>timems</code>).</p>
15    pub fn status(&self) -> ::std::option::Option<&crate::types::SuggestStatus> {
16        self.status.as_ref()
17    }
18    /// <p>Container for the matching search suggestion information.</p>
19    pub fn suggest(&self) -> ::std::option::Option<&crate::types::SuggestModel> {
20        self.suggest.as_ref()
21    }
22}
23impl ::aws_types::request_id::RequestId for SuggestOutput {
24    fn request_id(&self) -> Option<&str> {
25        self._request_id.as_deref()
26    }
27}
28impl SuggestOutput {
29    /// Creates a new builder-style object to manufacture [`SuggestOutput`](crate::operation::suggest::SuggestOutput).
30    pub fn builder() -> crate::operation::suggest::builders::SuggestOutputBuilder {
31        crate::operation::suggest::builders::SuggestOutputBuilder::default()
32    }
33}
34
35/// A builder for [`SuggestOutput`](crate::operation::suggest::SuggestOutput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct SuggestOutputBuilder {
39    pub(crate) status: ::std::option::Option<crate::types::SuggestStatus>,
40    pub(crate) suggest: ::std::option::Option<crate::types::SuggestModel>,
41    _request_id: Option<String>,
42}
43impl SuggestOutputBuilder {
44    /// <p>The status of a <code>SuggestRequest</code>. Contains the resource ID (<code>rid</code>) and how long it took to process the request (<code>timems</code>).</p>
45    pub fn status(mut self, input: crate::types::SuggestStatus) -> Self {
46        self.status = ::std::option::Option::Some(input);
47        self
48    }
49    /// <p>The status of a <code>SuggestRequest</code>. Contains the resource ID (<code>rid</code>) and how long it took to process the request (<code>timems</code>).</p>
50    pub fn set_status(mut self, input: ::std::option::Option<crate::types::SuggestStatus>) -> Self {
51        self.status = input;
52        self
53    }
54    /// <p>The status of a <code>SuggestRequest</code>. Contains the resource ID (<code>rid</code>) and how long it took to process the request (<code>timems</code>).</p>
55    pub fn get_status(&self) -> &::std::option::Option<crate::types::SuggestStatus> {
56        &self.status
57    }
58    /// <p>Container for the matching search suggestion information.</p>
59    pub fn suggest(mut self, input: crate::types::SuggestModel) -> Self {
60        self.suggest = ::std::option::Option::Some(input);
61        self
62    }
63    /// <p>Container for the matching search suggestion information.</p>
64    pub fn set_suggest(mut self, input: ::std::option::Option<crate::types::SuggestModel>) -> Self {
65        self.suggest = input;
66        self
67    }
68    /// <p>Container for the matching search suggestion information.</p>
69    pub fn get_suggest(&self) -> &::std::option::Option<crate::types::SuggestModel> {
70        &self.suggest
71    }
72    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
73        self._request_id = Some(request_id.into());
74        self
75    }
76
77    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
78        self._request_id = request_id;
79        self
80    }
81    /// Consumes the builder and constructs a [`SuggestOutput`](crate::operation::suggest::SuggestOutput).
82    pub fn build(self) -> crate::operation::suggest::SuggestOutput {
83        crate::operation::suggest::SuggestOutput {
84            status: self.status,
85            suggest: self.suggest,
86            _request_id: self._request_id,
87        }
88    }
89}