aws-sdk-efs 1.67.0

AWS SDK for Amazon Elastic File System
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes the destination file system in the replication configuration.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Destination {
    /// <p>Describes the status of the replication configuration. For more information about replication status, see <a href="https://docs.aws.amazon.com/efs/latest/ug/awsbackup.html#restoring-backup-efsmonitoring-replication-status.html">Viewing replication details</a> in the <i>Amazon EFS User Guide</i>.</p>
    pub status: crate::types::ReplicationStatus,
    /// <p>The ID of the destination Amazon EFS file system.</p>
    pub file_system_id: ::std::string::String,
    /// <p>The Amazon Web Services Region in which the destination file system is located.</p>
    pub region: ::std::string::String,
    /// <p>The time when the most recent sync was successfully completed on the destination file system. Any changes to data on the source file system that occurred before this time have been successfully replicated to the destination file system. Any changes that occurred after this time might not be fully replicated.</p>
    pub last_replicated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>ID of the Amazon Web Services account in which the destination file system resides.</p>
    pub owner_id: ::std::option::Option<::std::string::String>,
    /// <p>Message that provides details about the <code>PAUSED</code> or <code>ERRROR</code> state of the replication destination configuration. For more information about replication status messages, see <a href="https://docs.aws.amazon.com/efs/latest/ug/awsbackup.html#restoring-backup-efsmonitoring-replication-status.html">Viewing replication details</a> in the <i>Amazon EFS User Guide</i>.</p>
    pub status_message: ::std::option::Option<::std::string::String>,
    /// <p>Amazon Resource Name (ARN) of the IAM role in the source account that allows Amazon EFS to perform replication on its behalf. This is optional for same-account replication and required for cross-account replication.</p>
    pub role_arn: ::std::option::Option<::std::string::String>,
}
impl Destination {
    /// <p>Describes the status of the replication configuration. For more information about replication status, see <a href="https://docs.aws.amazon.com/efs/latest/ug/awsbackup.html#restoring-backup-efsmonitoring-replication-status.html">Viewing replication details</a> in the <i>Amazon EFS User Guide</i>.</p>
    pub fn status(&self) -> &crate::types::ReplicationStatus {
        &self.status
    }
    /// <p>The ID of the destination Amazon EFS file system.</p>
    pub fn file_system_id(&self) -> &str {
        use std::ops::Deref;
        self.file_system_id.deref()
    }
    /// <p>The Amazon Web Services Region in which the destination file system is located.</p>
    pub fn region(&self) -> &str {
        use std::ops::Deref;
        self.region.deref()
    }
    /// <p>The time when the most recent sync was successfully completed on the destination file system. Any changes to data on the source file system that occurred before this time have been successfully replicated to the destination file system. Any changes that occurred after this time might not be fully replicated.</p>
    pub fn last_replicated_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_replicated_timestamp.as_ref()
    }
    /// <p>ID of the Amazon Web Services account in which the destination file system resides.</p>
    pub fn owner_id(&self) -> ::std::option::Option<&str> {
        self.owner_id.as_deref()
    }
    /// <p>Message that provides details about the <code>PAUSED</code> or <code>ERRROR</code> state of the replication destination configuration. For more information about replication status messages, see <a href="https://docs.aws.amazon.com/efs/latest/ug/awsbackup.html#restoring-backup-efsmonitoring-replication-status.html">Viewing replication details</a> in the <i>Amazon EFS User Guide</i>.</p>
    pub fn status_message(&self) -> ::std::option::Option<&str> {
        self.status_message.as_deref()
    }
    /// <p>Amazon Resource Name (ARN) of the IAM role in the source account that allows Amazon EFS to perform replication on its behalf. This is optional for same-account replication and required for cross-account replication.</p>
    pub fn role_arn(&self) -> ::std::option::Option<&str> {
        self.role_arn.as_deref()
    }
}
impl Destination {
    /// Creates a new builder-style object to manufacture [`Destination`](crate::types::Destination).
    pub fn builder() -> crate::types::builders::DestinationBuilder {
        crate::types::builders::DestinationBuilder::default()
    }
}

/// A builder for [`Destination`](crate::types::Destination).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DestinationBuilder {
    pub(crate) status: ::std::option::Option<crate::types::ReplicationStatus>,
    pub(crate) file_system_id: ::std::option::Option<::std::string::String>,
    pub(crate) region: ::std::option::Option<::std::string::String>,
    pub(crate) last_replicated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) owner_id: ::std::option::Option<::std::string::String>,
    pub(crate) status_message: ::std::option::Option<::std::string::String>,
    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
}
impl DestinationBuilder {
    /// <p>Describes the status of the replication configuration. For more information about replication status, see <a href="https://docs.aws.amazon.com/efs/latest/ug/awsbackup.html#restoring-backup-efsmonitoring-replication-status.html">Viewing replication details</a> in the <i>Amazon EFS User Guide</i>.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::ReplicationStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>Describes the status of the replication configuration. For more information about replication status, see <a href="https://docs.aws.amazon.com/efs/latest/ug/awsbackup.html#restoring-backup-efsmonitoring-replication-status.html">Viewing replication details</a> in the <i>Amazon EFS User Guide</i>.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ReplicationStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>Describes the status of the replication configuration. For more information about replication status, see <a href="https://docs.aws.amazon.com/efs/latest/ug/awsbackup.html#restoring-backup-efsmonitoring-replication-status.html">Viewing replication details</a> in the <i>Amazon EFS User Guide</i>.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ReplicationStatus> {
        &self.status
    }
    /// <p>The ID of the destination Amazon EFS file system.</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 of the destination Amazon EFS file system.</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 of the destination Amazon EFS file system.</p>
    pub fn get_file_system_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.file_system_id
    }
    /// <p>The Amazon Web Services Region in which the destination file system is located.</p>
    /// This field is required.
    pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.region = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Web Services Region in which the destination file system is located.</p>
    pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.region = input;
        self
    }
    /// <p>The Amazon Web Services Region in which the destination file system is located.</p>
    pub fn get_region(&self) -> &::std::option::Option<::std::string::String> {
        &self.region
    }
    /// <p>The time when the most recent sync was successfully completed on the destination file system. Any changes to data on the source file system that occurred before this time have been successfully replicated to the destination file system. Any changes that occurred after this time might not be fully replicated.</p>
    pub fn last_replicated_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_replicated_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when the most recent sync was successfully completed on the destination file system. Any changes to data on the source file system that occurred before this time have been successfully replicated to the destination file system. Any changes that occurred after this time might not be fully replicated.</p>
    pub fn set_last_replicated_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_replicated_timestamp = input;
        self
    }
    /// <p>The time when the most recent sync was successfully completed on the destination file system. Any changes to data on the source file system that occurred before this time have been successfully replicated to the destination file system. Any changes that occurred after this time might not be fully replicated.</p>
    pub fn get_last_replicated_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_replicated_timestamp
    }
    /// <p>ID of the Amazon Web Services account in which the destination file system resides.</p>
    pub fn owner_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.owner_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>ID of the Amazon Web Services account in which the destination file system resides.</p>
    pub fn set_owner_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.owner_id = input;
        self
    }
    /// <p>ID of the Amazon Web Services account in which the destination file system resides.</p>
    pub fn get_owner_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.owner_id
    }
    /// <p>Message that provides details about the <code>PAUSED</code> or <code>ERRROR</code> state of the replication destination configuration. For more information about replication status messages, see <a href="https://docs.aws.amazon.com/efs/latest/ug/awsbackup.html#restoring-backup-efsmonitoring-replication-status.html">Viewing replication details</a> in the <i>Amazon EFS User Guide</i>.</p>
    pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.status_message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Message that provides details about the <code>PAUSED</code> or <code>ERRROR</code> state of the replication destination configuration. For more information about replication status messages, see <a href="https://docs.aws.amazon.com/efs/latest/ug/awsbackup.html#restoring-backup-efsmonitoring-replication-status.html">Viewing replication details</a> in the <i>Amazon EFS User Guide</i>.</p>
    pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.status_message = input;
        self
    }
    /// <p>Message that provides details about the <code>PAUSED</code> or <code>ERRROR</code> state of the replication destination configuration. For more information about replication status messages, see <a href="https://docs.aws.amazon.com/efs/latest/ug/awsbackup.html#restoring-backup-efsmonitoring-replication-status.html">Viewing replication details</a> in the <i>Amazon EFS User Guide</i>.</p>
    pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.status_message
    }
    /// <p>Amazon Resource Name (ARN) of the IAM role in the source account that allows Amazon EFS to perform replication on its behalf. This is optional for same-account replication and required for cross-account replication.</p>
    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Amazon Resource Name (ARN) of the IAM role in the source account that allows Amazon EFS to perform replication on its behalf. This is optional for same-account replication and required for cross-account replication.</p>
    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.role_arn = input;
        self
    }
    /// <p>Amazon Resource Name (ARN) of the IAM role in the source account that allows Amazon EFS to perform replication on its behalf. This is optional for same-account replication and required for cross-account replication.</p>
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.role_arn
    }
    /// Consumes the builder and constructs a [`Destination`](crate::types::Destination).
    /// This method will fail if any of the following fields are not set:
    /// - [`status`](crate::types::builders::DestinationBuilder::status)
    /// - [`file_system_id`](crate::types::builders::DestinationBuilder::file_system_id)
    /// - [`region`](crate::types::builders::DestinationBuilder::region)
    pub fn build(self) -> ::std::result::Result<crate::types::Destination, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Destination {
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building Destination",
                )
            })?,
            file_system_id: self.file_system_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "file_system_id",
                    "file_system_id was not specified but it is required when building Destination",
                )
            })?,
            region: self.region.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "region",
                    "region was not specified but it is required when building Destination",
                )
            })?,
            last_replicated_timestamp: self.last_replicated_timestamp,
            owner_id: self.owner_id,
            status_message: self.status_message,
            role_arn: self.role_arn,
        })
    }
}