aws-sdk-efs 1.54.0

AWS SDK for Amazon Elastic File System
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 CreateReplicationConfigurationInput {
    /// <p>Specifies the Amazon EFS file system that you want to replicate. This file system cannot already be a source or destination file system in another replication configuration.</p>
    pub source_file_system_id: ::std::option::Option<::std::string::String>,
    /// <p>An array of destination configuration objects. Only one destination configuration object is supported.</p>
    pub destinations: ::std::option::Option<::std::vec::Vec<crate::types::DestinationToCreate>>,
}
impl CreateReplicationConfigurationInput {
    /// <p>Specifies the Amazon EFS file system that you want to replicate. This file system cannot already be a source or destination file system in another replication configuration.</p>
    pub fn source_file_system_id(&self) -> ::std::option::Option<&str> {
        self.source_file_system_id.as_deref()
    }
    /// <p>An array of destination configuration objects. Only one destination configuration object is supported.</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 `.destinations.is_none()`.
    pub fn destinations(&self) -> &[crate::types::DestinationToCreate] {
        self.destinations.as_deref().unwrap_or_default()
    }
}
impl CreateReplicationConfigurationInput {
    /// Creates a new builder-style object to manufacture [`CreateReplicationConfigurationInput`](crate::operation::create_replication_configuration::CreateReplicationConfigurationInput).
    pub fn builder() -> crate::operation::create_replication_configuration::builders::CreateReplicationConfigurationInputBuilder {
        crate::operation::create_replication_configuration::builders::CreateReplicationConfigurationInputBuilder::default()
    }
}

/// A builder for [`CreateReplicationConfigurationInput`](crate::operation::create_replication_configuration::CreateReplicationConfigurationInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateReplicationConfigurationInputBuilder {
    pub(crate) source_file_system_id: ::std::option::Option<::std::string::String>,
    pub(crate) destinations: ::std::option::Option<::std::vec::Vec<crate::types::DestinationToCreate>>,
}
impl CreateReplicationConfigurationInputBuilder {
    /// <p>Specifies the Amazon EFS file system that you want to replicate. This file system cannot already be a source or destination file system in another replication configuration.</p>
    /// This field is required.
    pub fn source_file_system_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.source_file_system_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specifies the Amazon EFS file system that you want to replicate. This file system cannot already be a source or destination file system in another replication configuration.</p>
    pub fn set_source_file_system_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.source_file_system_id = input;
        self
    }
    /// <p>Specifies the Amazon EFS file system that you want to replicate. This file system cannot already be a source or destination file system in another replication configuration.</p>
    pub fn get_source_file_system_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.source_file_system_id
    }
    /// Appends an item to `destinations`.
    ///
    /// To override the contents of this collection use [`set_destinations`](Self::set_destinations).
    ///
    /// <p>An array of destination configuration objects. Only one destination configuration object is supported.</p>
    pub fn destinations(mut self, input: crate::types::DestinationToCreate) -> Self {
        let mut v = self.destinations.unwrap_or_default();
        v.push(input);
        self.destinations = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of destination configuration objects. Only one destination configuration object is supported.</p>
    pub fn set_destinations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DestinationToCreate>>) -> Self {
        self.destinations = input;
        self
    }
    /// <p>An array of destination configuration objects. Only one destination configuration object is supported.</p>
    pub fn get_destinations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DestinationToCreate>> {
        &self.destinations
    }
    /// Consumes the builder and constructs a [`CreateReplicationConfigurationInput`](crate::operation::create_replication_configuration::CreateReplicationConfigurationInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_replication_configuration::CreateReplicationConfigurationInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::create_replication_configuration::CreateReplicationConfigurationInput {
            source_file_system_id: self.source_file_system_id,
            destinations: self.destinations,
        })
    }
}