aws-sdk-directory 1.107.0

AWS SDK for AWS Directory 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 UpdateSettingsInput {
    /// <p>The identifier of the directory for which to update settings.</p>
    pub directory_id: ::std::option::Option<::std::string::String>,
    /// <p>The list of <code>Setting</code> objects.</p>
    pub settings: ::std::option::Option<::std::vec::Vec<crate::types::Setting>>,
}
impl UpdateSettingsInput {
    /// <p>The identifier of the directory for which to update settings.</p>
    pub fn directory_id(&self) -> ::std::option::Option<&str> {
        self.directory_id.as_deref()
    }
    /// <p>The list of <code>Setting</code> objects.</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 `.settings.is_none()`.
    pub fn settings(&self) -> &[crate::types::Setting] {
        self.settings.as_deref().unwrap_or_default()
    }
}
impl UpdateSettingsInput {
    /// Creates a new builder-style object to manufacture [`UpdateSettingsInput`](crate::operation::update_settings::UpdateSettingsInput).
    pub fn builder() -> crate::operation::update_settings::builders::UpdateSettingsInputBuilder {
        crate::operation::update_settings::builders::UpdateSettingsInputBuilder::default()
    }
}

/// A builder for [`UpdateSettingsInput`](crate::operation::update_settings::UpdateSettingsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateSettingsInputBuilder {
    pub(crate) directory_id: ::std::option::Option<::std::string::String>,
    pub(crate) settings: ::std::option::Option<::std::vec::Vec<crate::types::Setting>>,
}
impl UpdateSettingsInputBuilder {
    /// <p>The identifier of the directory for which to update settings.</p>
    /// This field is required.
    pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.directory_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the directory for which to update settings.</p>
    pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.directory_id = input;
        self
    }
    /// <p>The identifier of the directory for which to update settings.</p>
    pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.directory_id
    }
    /// Appends an item to `settings`.
    ///
    /// To override the contents of this collection use [`set_settings`](Self::set_settings).
    ///
    /// <p>The list of <code>Setting</code> objects.</p>
    pub fn settings(mut self, input: crate::types::Setting) -> Self {
        let mut v = self.settings.unwrap_or_default();
        v.push(input);
        self.settings = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of <code>Setting</code> objects.</p>
    pub fn set_settings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Setting>>) -> Self {
        self.settings = input;
        self
    }
    /// <p>The list of <code>Setting</code> objects.</p>
    pub fn get_settings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Setting>> {
        &self.settings
    }
    /// Consumes the builder and constructs a [`UpdateSettingsInput`](crate::operation::update_settings::UpdateSettingsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_settings::UpdateSettingsInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_settings::UpdateSettingsInput {
            directory_id: self.directory_id,
            settings: self.settings,
        })
    }
}