aws-sdk-efs 0.27.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>
    #[doc(hidden)]
    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>
    #[doc(hidden)]
    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>
    pub fn destinations(&self) -> std::option::Option<&[crate::types::DestinationToCreate]> {
        self.destinations.as_deref()
    }
}
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).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
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>
    pub fn source_file_system_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.source_file_system_id = 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
    }
    /// 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 = 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
    }
    /// Consumes the builder and constructs a [`CreateReplicationConfigurationInput`](crate::operation::create_replication_configuration::CreateReplicationConfigurationInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::create_replication_configuration::CreateReplicationConfigurationInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(
            crate::operation::create_replication_configuration::CreateReplicationConfigurationInput {
                source_file_system_id: self.source_file_system_id
                ,
                destinations: self.destinations
                ,
            }
        )
    }
}