aws_sdk_opensearch/operation/describe_domains/
_describe_domains_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Container for the parameters to the <code>DescribeDomains</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribeDomainsInput {
7    /// <p>Array of OpenSearch Service domain names that you want information about. You must specify at least one domain name.</p>
8    pub domain_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
9}
10impl DescribeDomainsInput {
11    /// <p>Array of OpenSearch Service domain names that you want information about. You must specify at least one domain name.</p>
12    ///
13    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.domain_names.is_none()`.
14    pub fn domain_names(&self) -> &[::std::string::String] {
15        self.domain_names.as_deref().unwrap_or_default()
16    }
17}
18impl DescribeDomainsInput {
19    /// Creates a new builder-style object to manufacture [`DescribeDomainsInput`](crate::operation::describe_domains::DescribeDomainsInput).
20    pub fn builder() -> crate::operation::describe_domains::builders::DescribeDomainsInputBuilder {
21        crate::operation::describe_domains::builders::DescribeDomainsInputBuilder::default()
22    }
23}
24
25/// A builder for [`DescribeDomainsInput`](crate::operation::describe_domains::DescribeDomainsInput).
26#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
27#[non_exhaustive]
28pub struct DescribeDomainsInputBuilder {
29    pub(crate) domain_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
30}
31impl DescribeDomainsInputBuilder {
32    /// Appends an item to `domain_names`.
33    ///
34    /// To override the contents of this collection use [`set_domain_names`](Self::set_domain_names).
35    ///
36    /// <p>Array of OpenSearch Service domain names that you want information about. You must specify at least one domain name.</p>
37    pub fn domain_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
38        let mut v = self.domain_names.unwrap_or_default();
39        v.push(input.into());
40        self.domain_names = ::std::option::Option::Some(v);
41        self
42    }
43    /// <p>Array of OpenSearch Service domain names that you want information about. You must specify at least one domain name.</p>
44    pub fn set_domain_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
45        self.domain_names = input;
46        self
47    }
48    /// <p>Array of OpenSearch Service domain names that you want information about. You must specify at least one domain name.</p>
49    pub fn get_domain_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
50        &self.domain_names
51    }
52    /// Consumes the builder and constructs a [`DescribeDomainsInput`](crate::operation::describe_domains::DescribeDomainsInput).
53    pub fn build(
54        self,
55    ) -> ::std::result::Result<crate::operation::describe_domains::DescribeDomainsInput, ::aws_smithy_types::error::operation::BuildError> {
56        ::std::result::Result::Ok(crate::operation::describe_domains::DescribeDomainsInput {
57            domain_names: self.domain_names,
58        })
59    }
60}