aws_sdk_opensearch/operation/associate_package/
_associate_package_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Container for the request parameters to the <code>AssociatePackage</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AssociatePackageInput {
7    /// <p>Internal ID of the package to associate with a domain. Use <code>DescribePackages</code> to find this value.</p>
8    pub package_id: ::std::option::Option<::std::string::String>,
9    /// <p>Name of the domain to associate the package with.</p>
10    pub domain_name: ::std::option::Option<::std::string::String>,
11    /// <p>A list of package IDs that must be associated with the domain before the package specified in the request can be associated.</p>
12    pub prerequisite_package_id_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
13    /// <p>The configuration for associating a package with an Amazon OpenSearch Service domain.</p>
14    pub association_configuration: ::std::option::Option<crate::types::PackageAssociationConfiguration>,
15}
16impl AssociatePackageInput {
17    /// <p>Internal ID of the package to associate with a domain. Use <code>DescribePackages</code> to find this value.</p>
18    pub fn package_id(&self) -> ::std::option::Option<&str> {
19        self.package_id.as_deref()
20    }
21    /// <p>Name of the domain to associate the package with.</p>
22    pub fn domain_name(&self) -> ::std::option::Option<&str> {
23        self.domain_name.as_deref()
24    }
25    /// <p>A list of package IDs that must be associated with the domain before the package specified in the request can be associated.</p>
26    ///
27    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.prerequisite_package_id_list.is_none()`.
28    pub fn prerequisite_package_id_list(&self) -> &[::std::string::String] {
29        self.prerequisite_package_id_list.as_deref().unwrap_or_default()
30    }
31    /// <p>The configuration for associating a package with an Amazon OpenSearch Service domain.</p>
32    pub fn association_configuration(&self) -> ::std::option::Option<&crate::types::PackageAssociationConfiguration> {
33        self.association_configuration.as_ref()
34    }
35}
36impl AssociatePackageInput {
37    /// Creates a new builder-style object to manufacture [`AssociatePackageInput`](crate::operation::associate_package::AssociatePackageInput).
38    pub fn builder() -> crate::operation::associate_package::builders::AssociatePackageInputBuilder {
39        crate::operation::associate_package::builders::AssociatePackageInputBuilder::default()
40    }
41}
42
43/// A builder for [`AssociatePackageInput`](crate::operation::associate_package::AssociatePackageInput).
44#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
45#[non_exhaustive]
46pub struct AssociatePackageInputBuilder {
47    pub(crate) package_id: ::std::option::Option<::std::string::String>,
48    pub(crate) domain_name: ::std::option::Option<::std::string::String>,
49    pub(crate) prerequisite_package_id_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
50    pub(crate) association_configuration: ::std::option::Option<crate::types::PackageAssociationConfiguration>,
51}
52impl AssociatePackageInputBuilder {
53    /// <p>Internal ID of the package to associate with a domain. Use <code>DescribePackages</code> to find this value.</p>
54    /// This field is required.
55    pub fn package_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
56        self.package_id = ::std::option::Option::Some(input.into());
57        self
58    }
59    /// <p>Internal ID of the package to associate with a domain. Use <code>DescribePackages</code> to find this value.</p>
60    pub fn set_package_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
61        self.package_id = input;
62        self
63    }
64    /// <p>Internal ID of the package to associate with a domain. Use <code>DescribePackages</code> to find this value.</p>
65    pub fn get_package_id(&self) -> &::std::option::Option<::std::string::String> {
66        &self.package_id
67    }
68    /// <p>Name of the domain to associate the package with.</p>
69    /// This field is required.
70    pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71        self.domain_name = ::std::option::Option::Some(input.into());
72        self
73    }
74    /// <p>Name of the domain to associate the package with.</p>
75    pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.domain_name = input;
77        self
78    }
79    /// <p>Name of the domain to associate the package with.</p>
80    pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
81        &self.domain_name
82    }
83    /// Appends an item to `prerequisite_package_id_list`.
84    ///
85    /// To override the contents of this collection use [`set_prerequisite_package_id_list`](Self::set_prerequisite_package_id_list).
86    ///
87    /// <p>A list of package IDs that must be associated with the domain before the package specified in the request can be associated.</p>
88    pub fn prerequisite_package_id_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        let mut v = self.prerequisite_package_id_list.unwrap_or_default();
90        v.push(input.into());
91        self.prerequisite_package_id_list = ::std::option::Option::Some(v);
92        self
93    }
94    /// <p>A list of package IDs that must be associated with the domain before the package specified in the request can be associated.</p>
95    pub fn set_prerequisite_package_id_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
96        self.prerequisite_package_id_list = input;
97        self
98    }
99    /// <p>A list of package IDs that must be associated with the domain before the package specified in the request can be associated.</p>
100    pub fn get_prerequisite_package_id_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
101        &self.prerequisite_package_id_list
102    }
103    /// <p>The configuration for associating a package with an Amazon OpenSearch Service domain.</p>
104    pub fn association_configuration(mut self, input: crate::types::PackageAssociationConfiguration) -> Self {
105        self.association_configuration = ::std::option::Option::Some(input);
106        self
107    }
108    /// <p>The configuration for associating a package with an Amazon OpenSearch Service domain.</p>
109    pub fn set_association_configuration(mut self, input: ::std::option::Option<crate::types::PackageAssociationConfiguration>) -> Self {
110        self.association_configuration = input;
111        self
112    }
113    /// <p>The configuration for associating a package with an Amazon OpenSearch Service domain.</p>
114    pub fn get_association_configuration(&self) -> &::std::option::Option<crate::types::PackageAssociationConfiguration> {
115        &self.association_configuration
116    }
117    /// Consumes the builder and constructs a [`AssociatePackageInput`](crate::operation::associate_package::AssociatePackageInput).
118    pub fn build(
119        self,
120    ) -> ::std::result::Result<crate::operation::associate_package::AssociatePackageInput, ::aws_smithy_types::error::operation::BuildError> {
121        ::std::result::Result::Ok(crate::operation::associate_package::AssociatePackageInput {
122            package_id: self.package_id,
123            domain_name: self.domain_name,
124            prerequisite_package_id_list: self.prerequisite_package_id_list,
125            association_configuration: self.association_configuration,
126        })
127    }
128}