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 primary Region of the endpoint.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Primary {
    /// <p>The ARN of the health check used by the endpoint to determine whether failover is triggered.</p>
    pub health_check: ::std::string::String,
}
impl Primary {
    /// <p>The ARN of the health check used by the endpoint to determine whether failover is triggered.</p>
    pub fn health_check(&self) -> &str {
        use std::ops::Deref;
        self.health_check.deref()
    }
}
impl Primary {
    /// Creates a new builder-style object to manufacture [`Primary`](crate::types::Primary).
    pub fn builder() -> crate::types::builders::PrimaryBuilder {
        crate::types::builders::PrimaryBuilder::default()
    }
}

/// A builder for [`Primary`](crate::types::Primary).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PrimaryBuilder {
    pub(crate) health_check: ::std::option::Option<::std::string::String>,
}
impl PrimaryBuilder {
    /// <p>The ARN of the health check used by the endpoint to determine whether failover is triggered.</p>
    /// This field is required.
    pub fn health_check(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.health_check = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the health check used by the endpoint to determine whether failover is triggered.</p>
    pub fn set_health_check(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.health_check = input;
        self
    }
    /// <p>The ARN of the health check used by the endpoint to determine whether failover is triggered.</p>
    pub fn get_health_check(&self) -> &::std::option::Option<::std::string::String> {
        &self.health_check
    }
    /// Consumes the builder and constructs a [`Primary`](crate::types::Primary).
    /// This method will fail if any of the following fields are not set:
    /// - [`health_check`](crate::types::builders::PrimaryBuilder::health_check)
    pub fn build(self) -> ::std::result::Result<crate::types::Primary, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Primary {
            health_check: self.health_check.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "health_check",
                    "health_check was not specified but it is required when building Primary",
                )
            })?,
        })
    }
}