aws-sdk-eventbridge 1.105.0

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

/// <p>The secondary Region that processes events when failover is triggered or replication is enabled.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Secondary {
    /// <p>Defines the secondary Region.</p>
    pub route: ::std::string::String,
}
impl Secondary {
    /// <p>Defines the secondary Region.</p>
    pub fn route(&self) -> &str {
        use std::ops::Deref;
        self.route.deref()
    }
}
impl Secondary {
    /// Creates a new builder-style object to manufacture [`Secondary`](crate::types::Secondary).
    pub fn builder() -> crate::types::builders::SecondaryBuilder {
        crate::types::builders::SecondaryBuilder::default()
    }
}

/// A builder for [`Secondary`](crate::types::Secondary).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SecondaryBuilder {
    pub(crate) route: ::std::option::Option<::std::string::String>,
}
impl SecondaryBuilder {
    /// <p>Defines the secondary Region.</p>
    /// This field is required.
    pub fn route(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.route = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Defines the secondary Region.</p>
    pub fn set_route(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.route = input;
        self
    }
    /// <p>Defines the secondary Region.</p>
    pub fn get_route(&self) -> &::std::option::Option<::std::string::String> {
        &self.route
    }
    /// Consumes the builder and constructs a [`Secondary`](crate::types::Secondary).
    /// This method will fail if any of the following fields are not set:
    /// - [`route`](crate::types::builders::SecondaryBuilder::route)
    pub fn build(self) -> ::std::result::Result<crate::types::Secondary, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Secondary {
            route: self.route.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "route",
                    "route was not specified but it is required when building Secondary",
                )
            })?,
        })
    }
}