aws_sdk_opensearch/operation/dissociate_packages/
_dissociate_packages_input.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 DissociatePackagesInput {
6    /// <p>A list of package IDs to be dissociated from a domain.</p>
7    pub package_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8    /// <p>The name of an OpenSearch Service domain. Domain names are unique across the domains owned by an account within an Amazon Web Services Region.</p>
9    pub domain_name: ::std::option::Option<::std::string::String>,
10}
11impl DissociatePackagesInput {
12    /// <p>A list of package IDs to be dissociated from a domain.</p>
13    ///
14    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.package_list.is_none()`.
15    pub fn package_list(&self) -> &[::std::string::String] {
16        self.package_list.as_deref().unwrap_or_default()
17    }
18    /// <p>The name of an OpenSearch Service domain. Domain names are unique across the domains owned by an account within an Amazon Web Services Region.</p>
19    pub fn domain_name(&self) -> ::std::option::Option<&str> {
20        self.domain_name.as_deref()
21    }
22}
23impl DissociatePackagesInput {
24    /// Creates a new builder-style object to manufacture [`DissociatePackagesInput`](crate::operation::dissociate_packages::DissociatePackagesInput).
25    pub fn builder() -> crate::operation::dissociate_packages::builders::DissociatePackagesInputBuilder {
26        crate::operation::dissociate_packages::builders::DissociatePackagesInputBuilder::default()
27    }
28}
29
30/// A builder for [`DissociatePackagesInput`](crate::operation::dissociate_packages::DissociatePackagesInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct DissociatePackagesInputBuilder {
34    pub(crate) package_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
35    pub(crate) domain_name: ::std::option::Option<::std::string::String>,
36}
37impl DissociatePackagesInputBuilder {
38    /// Appends an item to `package_list`.
39    ///
40    /// To override the contents of this collection use [`set_package_list`](Self::set_package_list).
41    ///
42    /// <p>A list of package IDs to be dissociated from a domain.</p>
43    pub fn package_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
44        let mut v = self.package_list.unwrap_or_default();
45        v.push(input.into());
46        self.package_list = ::std::option::Option::Some(v);
47        self
48    }
49    /// <p>A list of package IDs to be dissociated from a domain.</p>
50    pub fn set_package_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
51        self.package_list = input;
52        self
53    }
54    /// <p>A list of package IDs to be dissociated from a domain.</p>
55    pub fn get_package_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
56        &self.package_list
57    }
58    /// <p>The name of an OpenSearch Service domain. Domain names are unique across the domains owned by an account within an Amazon Web Services Region.</p>
59    /// This field is required.
60    pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.domain_name = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The name of an OpenSearch Service domain. Domain names are unique across the domains owned by an account within an Amazon Web Services Region.</p>
65    pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.domain_name = input;
67        self
68    }
69    /// <p>The name of an OpenSearch Service domain. Domain names are unique across the domains owned by an account within an Amazon Web Services Region.</p>
70    pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
71        &self.domain_name
72    }
73    /// Consumes the builder and constructs a [`DissociatePackagesInput`](crate::operation::dissociate_packages::DissociatePackagesInput).
74    pub fn build(
75        self,
76    ) -> ::std::result::Result<crate::operation::dissociate_packages::DissociatePackagesInput, ::aws_smithy_types::error::operation::BuildError> {
77        ::std::result::Result::Ok(crate::operation::dissociate_packages::DissociatePackagesInput {
78            package_list: self.package_list,
79            domain_name: self.domain_name,
80        })
81    }
82}