aws-sdk-s3files 1.1.0

AWS SDK for Amazon S3 Files
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 GetSynchronizationConfigurationOutput {
    /// <p>The version number of the synchronization configuration. Use this value with <code>PutSynchronizationConfiguration</code> to ensure optimistic concurrency control.</p>
    pub latest_version_number: ::std::option::Option<i32>,
    /// <p>An array of import data rules that control how data is imported from S3 into the file system.</p>
    pub import_data_rules: ::std::vec::Vec<crate::types::ImportDataRule>,
    /// <p>An array of expiration data rules that control when cached data expires from the file system.</p>
    pub expiration_data_rules: ::std::vec::Vec<crate::types::ExpirationDataRule>,
    _request_id: Option<String>,
}
impl GetSynchronizationConfigurationOutput {
    /// <p>The version number of the synchronization configuration. Use this value with <code>PutSynchronizationConfiguration</code> to ensure optimistic concurrency control.</p>
    pub fn latest_version_number(&self) -> ::std::option::Option<i32> {
        self.latest_version_number
    }
    /// <p>An array of import data rules that control how data is imported from S3 into the file system.</p>
    pub fn import_data_rules(&self) -> &[crate::types::ImportDataRule] {
        use std::ops::Deref;
        self.import_data_rules.deref()
    }
    /// <p>An array of expiration data rules that control when cached data expires from the file system.</p>
    pub fn expiration_data_rules(&self) -> &[crate::types::ExpirationDataRule] {
        use std::ops::Deref;
        self.expiration_data_rules.deref()
    }
}
impl ::aws_types::request_id::RequestId for GetSynchronizationConfigurationOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetSynchronizationConfigurationOutput {
    /// Creates a new builder-style object to manufacture [`GetSynchronizationConfigurationOutput`](crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationOutput).
    pub fn builder() -> crate::operation::get_synchronization_configuration::builders::GetSynchronizationConfigurationOutputBuilder {
        crate::operation::get_synchronization_configuration::builders::GetSynchronizationConfigurationOutputBuilder::default()
    }
}

/// A builder for [`GetSynchronizationConfigurationOutput`](crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetSynchronizationConfigurationOutputBuilder {
    pub(crate) latest_version_number: ::std::option::Option<i32>,
    pub(crate) import_data_rules: ::std::option::Option<::std::vec::Vec<crate::types::ImportDataRule>>,
    pub(crate) expiration_data_rules: ::std::option::Option<::std::vec::Vec<crate::types::ExpirationDataRule>>,
    _request_id: Option<String>,
}
impl GetSynchronizationConfigurationOutputBuilder {
    /// <p>The version number of the synchronization configuration. Use this value with <code>PutSynchronizationConfiguration</code> to ensure optimistic concurrency control.</p>
    pub fn latest_version_number(mut self, input: i32) -> Self {
        self.latest_version_number = ::std::option::Option::Some(input);
        self
    }
    /// <p>The version number of the synchronization configuration. Use this value with <code>PutSynchronizationConfiguration</code> to ensure optimistic concurrency control.</p>
    pub fn set_latest_version_number(mut self, input: ::std::option::Option<i32>) -> Self {
        self.latest_version_number = input;
        self
    }
    /// <p>The version number of the synchronization configuration. Use this value with <code>PutSynchronizationConfiguration</code> to ensure optimistic concurrency control.</p>
    pub fn get_latest_version_number(&self) -> &::std::option::Option<i32> {
        &self.latest_version_number
    }
    /// Appends an item to `import_data_rules`.
    ///
    /// To override the contents of this collection use [`set_import_data_rules`](Self::set_import_data_rules).
    ///
    /// <p>An array of import data rules that control how data is imported from S3 into the file system.</p>
    pub fn import_data_rules(mut self, input: crate::types::ImportDataRule) -> Self {
        let mut v = self.import_data_rules.unwrap_or_default();
        v.push(input);
        self.import_data_rules = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of import data rules that control how data is imported from S3 into the file system.</p>
    pub fn set_import_data_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ImportDataRule>>) -> Self {
        self.import_data_rules = input;
        self
    }
    /// <p>An array of import data rules that control how data is imported from S3 into the file system.</p>
    pub fn get_import_data_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ImportDataRule>> {
        &self.import_data_rules
    }
    /// Appends an item to `expiration_data_rules`.
    ///
    /// To override the contents of this collection use [`set_expiration_data_rules`](Self::set_expiration_data_rules).
    ///
    /// <p>An array of expiration data rules that control when cached data expires from the file system.</p>
    pub fn expiration_data_rules(mut self, input: crate::types::ExpirationDataRule) -> Self {
        let mut v = self.expiration_data_rules.unwrap_or_default();
        v.push(input);
        self.expiration_data_rules = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of expiration data rules that control when cached data expires from the file system.</p>
    pub fn set_expiration_data_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ExpirationDataRule>>) -> Self {
        self.expiration_data_rules = input;
        self
    }
    /// <p>An array of expiration data rules that control when cached data expires from the file system.</p>
    pub fn get_expiration_data_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ExpirationDataRule>> {
        &self.expiration_data_rules
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetSynchronizationConfigurationOutput`](crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`import_data_rules`](crate::operation::get_synchronization_configuration::builders::GetSynchronizationConfigurationOutputBuilder::import_data_rules)
    /// - [`expiration_data_rules`](crate::operation::get_synchronization_configuration::builders::GetSynchronizationConfigurationOutputBuilder::expiration_data_rules)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationOutput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(
            crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationOutput {
                latest_version_number: self.latest_version_number,
                import_data_rules: self.import_data_rules.ok_or_else(|| {
                    ::aws_smithy_types::error::operation::BuildError::missing_field(
                        "import_data_rules",
                        "import_data_rules was not specified but it is required when building GetSynchronizationConfigurationOutput",
                    )
                })?,
                expiration_data_rules: self.expiration_data_rules.ok_or_else(|| {
                    ::aws_smithy_types::error::operation::BuildError::missing_field(
                        "expiration_data_rules",
                        "expiration_data_rules was not specified but it is required when building GetSynchronizationConfigurationOutput",
                    )
                })?,
                _request_id: self._request_id,
            },
        )
    }
}