aws-sdk-opensearch 1.111.0

AWS SDK for Amazon OpenSearch Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdatePackageScopeInput {
    /// <p>ID of the package whose scope is being updated.</p>
    pub package_id: ::std::option::Option<::std::string::String>,
    /// <p>The operation to perform on the package scope (e.g., add/remove/override users).</p>
    pub operation: ::std::option::Option<crate::types::PackageScopeOperationEnum>,
    /// <p>List of users to be added or removed from the package scope.</p>
    pub package_user_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl UpdatePackageScopeInput {
    /// <p>ID of the package whose scope is being updated.</p>
    pub fn package_id(&self) -> ::std::option::Option<&str> {
        self.package_id.as_deref()
    }
    /// <p>The operation to perform on the package scope (e.g., add/remove/override users).</p>
    pub fn operation(&self) -> ::std::option::Option<&crate::types::PackageScopeOperationEnum> {
        self.operation.as_ref()
    }
    /// <p>List of users to be added or removed from the package scope.</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 `.package_user_list.is_none()`.
    pub fn package_user_list(&self) -> &[::std::string::String] {
        self.package_user_list.as_deref().unwrap_or_default()
    }
}
impl UpdatePackageScopeInput {
    /// Creates a new builder-style object to manufacture [`UpdatePackageScopeInput`](crate::operation::update_package_scope::UpdatePackageScopeInput).
    pub fn builder() -> crate::operation::update_package_scope::builders::UpdatePackageScopeInputBuilder {
        crate::operation::update_package_scope::builders::UpdatePackageScopeInputBuilder::default()
    }
}

/// A builder for [`UpdatePackageScopeInput`](crate::operation::update_package_scope::UpdatePackageScopeInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdatePackageScopeInputBuilder {
    pub(crate) package_id: ::std::option::Option<::std::string::String>,
    pub(crate) operation: ::std::option::Option<crate::types::PackageScopeOperationEnum>,
    pub(crate) package_user_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl UpdatePackageScopeInputBuilder {
    /// <p>ID of the package whose scope is being updated.</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>ID of the package whose scope is being updated.</p>
    pub fn set_package_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.package_id = input;
        self
    }
    /// <p>ID of the package whose scope is being updated.</p>
    pub fn get_package_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.package_id
    }
    /// <p>The operation to perform on the package scope (e.g., add/remove/override users).</p>
    /// This field is required.
    pub fn operation(mut self, input: crate::types::PackageScopeOperationEnum) -> Self {
        self.operation = ::std::option::Option::Some(input);
        self
    }
    /// <p>The operation to perform on the package scope (e.g., add/remove/override users).</p>
    pub fn set_operation(mut self, input: ::std::option::Option<crate::types::PackageScopeOperationEnum>) -> Self {
        self.operation = input;
        self
    }
    /// <p>The operation to perform on the package scope (e.g., add/remove/override users).</p>
    pub fn get_operation(&self) -> &::std::option::Option<crate::types::PackageScopeOperationEnum> {
        &self.operation
    }
    /// Appends an item to `package_user_list`.
    ///
    /// To override the contents of this collection use [`set_package_user_list`](Self::set_package_user_list).
    ///
    /// <p>List of users to be added or removed from the package scope.</p>
    pub fn package_user_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.package_user_list.unwrap_or_default();
        v.push(input.into());
        self.package_user_list = ::std::option::Option::Some(v);
        self
    }
    /// <p>List of users to be added or removed from the package scope.</p>
    pub fn set_package_user_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.package_user_list = input;
        self
    }
    /// <p>List of users to be added or removed from the package scope.</p>
    pub fn get_package_user_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.package_user_list
    }
    /// Consumes the builder and constructs a [`UpdatePackageScopeInput`](crate::operation::update_package_scope::UpdatePackageScopeInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_package_scope::UpdatePackageScopeInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::update_package_scope::UpdatePackageScopeInput {
            package_id: self.package_id,
            operation: self.operation,
            package_user_list: self.package_user_list,
        })
    }
}