aws_sdk_cloudsearch/operation/describe_suggesters/
_describe_suggesters_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The result of a <code>DescribeSuggesters</code> request.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribeSuggestersOutput {
7    /// <p>The suggesters configured for the domain specified in the request.</p>
8    pub suggesters: ::std::vec::Vec<crate::types::SuggesterStatus>,
9    _request_id: Option<String>,
10}
11impl DescribeSuggestersOutput {
12    /// <p>The suggesters configured for the domain specified in the request.</p>
13    pub fn suggesters(&self) -> &[crate::types::SuggesterStatus] {
14        use std::ops::Deref;
15        self.suggesters.deref()
16    }
17}
18impl ::aws_types::request_id::RequestId for DescribeSuggestersOutput {
19    fn request_id(&self) -> Option<&str> {
20        self._request_id.as_deref()
21    }
22}
23impl DescribeSuggestersOutput {
24    /// Creates a new builder-style object to manufacture [`DescribeSuggestersOutput`](crate::operation::describe_suggesters::DescribeSuggestersOutput).
25    pub fn builder() -> crate::operation::describe_suggesters::builders::DescribeSuggestersOutputBuilder {
26        crate::operation::describe_suggesters::builders::DescribeSuggestersOutputBuilder::default()
27    }
28}
29
30/// A builder for [`DescribeSuggestersOutput`](crate::operation::describe_suggesters::DescribeSuggestersOutput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct DescribeSuggestersOutputBuilder {
34    pub(crate) suggesters: ::std::option::Option<::std::vec::Vec<crate::types::SuggesterStatus>>,
35    _request_id: Option<String>,
36}
37impl DescribeSuggestersOutputBuilder {
38    /// Appends an item to `suggesters`.
39    ///
40    /// To override the contents of this collection use [`set_suggesters`](Self::set_suggesters).
41    ///
42    /// <p>The suggesters configured for the domain specified in the request.</p>
43    pub fn suggesters(mut self, input: crate::types::SuggesterStatus) -> Self {
44        let mut v = self.suggesters.unwrap_or_default();
45        v.push(input);
46        self.suggesters = ::std::option::Option::Some(v);
47        self
48    }
49    /// <p>The suggesters configured for the domain specified in the request.</p>
50    pub fn set_suggesters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SuggesterStatus>>) -> Self {
51        self.suggesters = input;
52        self
53    }
54    /// <p>The suggesters configured for the domain specified in the request.</p>
55    pub fn get_suggesters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SuggesterStatus>> {
56        &self.suggesters
57    }
58    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
59        self._request_id = Some(request_id.into());
60        self
61    }
62
63    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
64        self._request_id = request_id;
65        self
66    }
67    /// Consumes the builder and constructs a [`DescribeSuggestersOutput`](crate::operation::describe_suggesters::DescribeSuggestersOutput).
68    /// This method will fail if any of the following fields are not set:
69    /// - [`suggesters`](crate::operation::describe_suggesters::builders::DescribeSuggestersOutputBuilder::suggesters)
70    pub fn build(
71        self,
72    ) -> ::std::result::Result<crate::operation::describe_suggesters::DescribeSuggestersOutput, ::aws_smithy_types::error::operation::BuildError>
73    {
74        ::std::result::Result::Ok(crate::operation::describe_suggesters::DescribeSuggestersOutput {
75            suggesters: self.suggesters.ok_or_else(|| {
76                ::aws_smithy_types::error::operation::BuildError::missing_field(
77                    "suggesters",
78                    "suggesters was not specified but it is required when building DescribeSuggestersOutput",
79                )
80            })?,
81            _request_id: self._request_id,
82        })
83    }
84}