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 PutSynchronizationConfigurationInput {
    /// <p>The ID or Amazon Resource Name (ARN) of the S3 File System to configure synchronization for.</p>
    pub file_system_id: ::std::option::Option<::std::string::String>,
    /// <p>The version number of the current synchronization configuration. Omit this value when creating a synchronization configuration for the first time. For subsequent updates, provide this value for optimistic concurrency control. If the version number does not match the current configuration, the request fails with a <code>ConflictException</code>.</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::option::Option<::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::option::Option<::std::vec::Vec<crate::types::ExpirationDataRule>>,
}
impl PutSynchronizationConfigurationInput {
    /// <p>The ID or Amazon Resource Name (ARN) of the S3 File System to configure synchronization for.</p>
    pub fn file_system_id(&self) -> ::std::option::Option<&str> {
        self.file_system_id.as_deref()
    }
    /// <p>The version number of the current synchronization configuration. Omit this value when creating a synchronization configuration for the first time. For subsequent updates, provide this value for optimistic concurrency control. If the version number does not match the current configuration, the request fails with a <code>ConflictException</code>.</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>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.import_data_rules.is_none()`.
    pub fn import_data_rules(&self) -> &[crate::types::ImportDataRule] {
        self.import_data_rules.as_deref().unwrap_or_default()
    }
    /// <p>An array of expiration data rules that control when cached data expires from the file system.</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 `.expiration_data_rules.is_none()`.
    pub fn expiration_data_rules(&self) -> &[crate::types::ExpirationDataRule] {
        self.expiration_data_rules.as_deref().unwrap_or_default()
    }
}
impl PutSynchronizationConfigurationInput {
    /// Creates a new builder-style object to manufacture [`PutSynchronizationConfigurationInput`](crate::operation::put_synchronization_configuration::PutSynchronizationConfigurationInput).
    pub fn builder() -> crate::operation::put_synchronization_configuration::builders::PutSynchronizationConfigurationInputBuilder {
        crate::operation::put_synchronization_configuration::builders::PutSynchronizationConfigurationInputBuilder::default()
    }
}

/// A builder for [`PutSynchronizationConfigurationInput`](crate::operation::put_synchronization_configuration::PutSynchronizationConfigurationInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutSynchronizationConfigurationInputBuilder {
    pub(crate) file_system_id: ::std::option::Option<::std::string::String>,
    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>>,
}
impl PutSynchronizationConfigurationInputBuilder {
    /// <p>The ID or Amazon Resource Name (ARN) of the S3 File System to configure synchronization for.</p>
    /// This field is required.
    pub fn file_system_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.file_system_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID or Amazon Resource Name (ARN) of the S3 File System to configure synchronization for.</p>
    pub fn set_file_system_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.file_system_id = input;
        self
    }
    /// <p>The ID or Amazon Resource Name (ARN) of the S3 File System to configure synchronization for.</p>
    pub fn get_file_system_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.file_system_id
    }
    /// <p>The version number of the current synchronization configuration. Omit this value when creating a synchronization configuration for the first time. For subsequent updates, provide this value for optimistic concurrency control. If the version number does not match the current configuration, the request fails with a <code>ConflictException</code>.</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 current synchronization configuration. Omit this value when creating a synchronization configuration for the first time. For subsequent updates, provide this value for optimistic concurrency control. If the version number does not match the current configuration, the request fails with a <code>ConflictException</code>.</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 current synchronization configuration. Omit this value when creating a synchronization configuration for the first time. For subsequent updates, provide this value for optimistic concurrency control. If the version number does not match the current configuration, the request fails with a <code>ConflictException</code>.</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
    }
    /// Consumes the builder and constructs a [`PutSynchronizationConfigurationInput`](crate::operation::put_synchronization_configuration::PutSynchronizationConfigurationInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::put_synchronization_configuration::PutSynchronizationConfigurationInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(
            crate::operation::put_synchronization_configuration::PutSynchronizationConfigurationInput {
                file_system_id: self.file_system_id,
                latest_version_number: self.latest_version_number,
                import_data_rules: self.import_data_rules,
                expiration_data_rules: self.expiration_data_rules,
            },
        )
    }
}