// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Optional configuration to replicate existing source bucket objects.</p><note>
/// <p>This parameter is no longer supported. To replicate existing objects, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-batch-replication-batch.html">Replicating existing objects with S3 Batch Replication</a> in the <i>Amazon S3 User Guide</i>.</p>
/// </note>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ExistingObjectReplication {
    /// <p>Specifies whether Amazon S3 replicates existing source bucket objects.</p>
    pub status: crate::types::ExistingObjectReplicationStatus,
}
impl ExistingObjectReplication {
    /// <p>Specifies whether Amazon S3 replicates existing source bucket objects.</p>
    pub fn status(&self) -> &crate::types::ExistingObjectReplicationStatus {
        &self.status
    }
}
impl ExistingObjectReplication {
    /// Creates a new builder-style object to manufacture [`ExistingObjectReplication`](crate::types::ExistingObjectReplication).
    pub fn builder() -> crate::types::builders::ExistingObjectReplicationBuilder {
        crate::types::builders::ExistingObjectReplicationBuilder::default()
    }
}

/// A builder for [`ExistingObjectReplication`](crate::types::ExistingObjectReplication).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ExistingObjectReplicationBuilder {
    pub(crate) status: ::std::option::Option<crate::types::ExistingObjectReplicationStatus>,
}
impl ExistingObjectReplicationBuilder {
    /// <p>Specifies whether Amazon S3 replicates existing source bucket objects.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::ExistingObjectReplicationStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether Amazon S3 replicates existing source bucket objects.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ExistingObjectReplicationStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>Specifies whether Amazon S3 replicates existing source bucket objects.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ExistingObjectReplicationStatus> {
        &self.status
    }
    /// Consumes the builder and constructs a [`ExistingObjectReplication`](crate::types::ExistingObjectReplication).
    /// This method will fail if any of the following fields are not set:
    /// - [`status`](crate::types::builders::ExistingObjectReplicationBuilder::status)
    pub fn build(self) -> ::std::result::Result<crate::types::ExistingObjectReplication, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::ExistingObjectReplication {
            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 ExistingObjectReplication",
                )
            })?,
        })
    }
}
