aws-sdk-opensearch 1.112.0

AWS SDK for Amazon OpenSearch Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Container for the request parameters to the <code>AssociatePackage</code> operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AssociatePackageInput {
    /// <p>Internal ID of the package to associate with a domain. Use <code>DescribePackages</code> to find this value.</p>
    pub package_id: ::std::option::Option<::std::string::String>,
    /// <p>Name of the domain to associate the package with.</p>
    pub domain_name: ::std::option::Option<::std::string::String>,
    /// <p>A list of package IDs that must be associated with the domain before the package specified in the request can be associated.</p>
    pub prerequisite_package_id_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The configuration for associating a package with an Amazon OpenSearch Service domain.</p>
    pub association_configuration: ::std::option::Option<crate::types::PackageAssociationConfiguration>,
}
impl AssociatePackageInput {
    /// <p>Internal ID of the package to associate with a domain. Use <code>DescribePackages</code> to find this value.</p>
    pub fn package_id(&self) -> ::std::option::Option<&str> {
        self.package_id.as_deref()
    }
    /// <p>Name of the domain to associate the package with.</p>
    pub fn domain_name(&self) -> ::std::option::Option<&str> {
        self.domain_name.as_deref()
    }
    /// <p>A list of package IDs that must be associated with the domain before the package specified in the request can be associated.</p>
    ///
    /// 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()`.
    pub fn prerequisite_package_id_list(&self) -> &[::std::string::String] {
        self.prerequisite_package_id_list.as_deref().unwrap_or_default()
    }
    /// <p>The configuration for associating a package with an Amazon OpenSearch Service domain.</p>
    pub fn association_configuration(&self) -> ::std::option::Option<&crate::types::PackageAssociationConfiguration> {
        self.association_configuration.as_ref()
    }
}
impl AssociatePackageInput {
    /// Creates a new builder-style object to manufacture [`AssociatePackageInput`](crate::operation::associate_package::AssociatePackageInput).
    pub fn builder() -> crate::operation::associate_package::builders::AssociatePackageInputBuilder {
        crate::operation::associate_package::builders::AssociatePackageInputBuilder::default()
    }
}

/// A builder for [`AssociatePackageInput`](crate::operation::associate_package::AssociatePackageInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AssociatePackageInputBuilder {
    pub(crate) package_id: ::std::option::Option<::std::string::String>,
    pub(crate) domain_name: ::std::option::Option<::std::string::String>,
    pub(crate) prerequisite_package_id_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) association_configuration: ::std::option::Option<crate::types::PackageAssociationConfiguration>,
}
impl AssociatePackageInputBuilder {
    /// <p>Internal ID of the package to associate with a domain. Use <code>DescribePackages</code> to find this value.</p>
    /// This field is required.
    pub fn package_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.package_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Internal ID of the package to associate with a domain. Use <code>DescribePackages</code> to find this value.</p>
    pub fn set_package_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.package_id = input;
        self
    }
    /// <p>Internal ID of the package to associate with a domain. Use <code>DescribePackages</code> to find this value.</p>
    pub fn get_package_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.package_id
    }
    /// <p>Name of the domain to associate the package with.</p>
    /// This field is required.
    pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.domain_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Name of the domain to associate the package with.</p>
    pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.domain_name = input;
        self
    }
    /// <p>Name of the domain to associate the package with.</p>
    pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.domain_name
    }
    /// Appends an item to `prerequisite_package_id_list`.
    ///
    /// To override the contents of this collection use [`set_prerequisite_package_id_list`](Self::set_prerequisite_package_id_list).
    ///
    /// <p>A list of package IDs that must be associated with the domain before the package specified in the request can be associated.</p>
    pub fn prerequisite_package_id_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.prerequisite_package_id_list.unwrap_or_default();
        v.push(input.into());
        self.prerequisite_package_id_list = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of package IDs that must be associated with the domain before the package specified in the request can be associated.</p>
    pub fn set_prerequisite_package_id_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.prerequisite_package_id_list = input;
        self
    }
    /// <p>A list of package IDs that must be associated with the domain before the package specified in the request can be associated.</p>
    pub fn get_prerequisite_package_id_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.prerequisite_package_id_list
    }
    /// <p>The configuration for associating a package with an Amazon OpenSearch Service domain.</p>
    pub fn association_configuration(mut self, input: crate::types::PackageAssociationConfiguration) -> Self {
        self.association_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>The configuration for associating a package with an Amazon OpenSearch Service domain.</p>
    pub fn set_association_configuration(mut self, input: ::std::option::Option<crate::types::PackageAssociationConfiguration>) -> Self {
        self.association_configuration = input;
        self
    }
    /// <p>The configuration for associating a package with an Amazon OpenSearch Service domain.</p>
    pub fn get_association_configuration(&self) -> &::std::option::Option<crate::types::PackageAssociationConfiguration> {
        &self.association_configuration
    }
    /// Consumes the builder and constructs a [`AssociatePackageInput`](crate::operation::associate_package::AssociatePackageInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::associate_package::AssociatePackageInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::associate_package::AssociatePackageInput {
            package_id: self.package_id,
            domain_name: self.domain_name,
            prerequisite_package_id_list: self.prerequisite_package_id_list,
            association_configuration: self.association_configuration,
        })
    }
}