1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes a Lambda based availability provider.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct LambdaAvailabilityProvider {
    /// <p>The Amazon Resource Name (ARN) of the Lambda that acts as the availability provider.</p>
    pub lambda_arn: ::std::string::String,
}
impl LambdaAvailabilityProvider {
    /// <p>The Amazon Resource Name (ARN) of the Lambda that acts as the availability provider.</p>
    pub fn lambda_arn(&self) -> &str {
        use std::ops::Deref;
        self.lambda_arn.deref()
    }
}
impl LambdaAvailabilityProvider {
    /// Creates a new builder-style object to manufacture [`LambdaAvailabilityProvider`](crate::types::LambdaAvailabilityProvider).
    pub fn builder() -> crate::types::builders::LambdaAvailabilityProviderBuilder {
        crate::types::builders::LambdaAvailabilityProviderBuilder::default()
    }
}

/// A builder for [`LambdaAvailabilityProvider`](crate::types::LambdaAvailabilityProvider).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct LambdaAvailabilityProviderBuilder {
    pub(crate) lambda_arn: ::std::option::Option<::std::string::String>,
}
impl LambdaAvailabilityProviderBuilder {
    /// <p>The Amazon Resource Name (ARN) of the Lambda that acts as the availability provider.</p>
    /// This field is required.
    pub fn lambda_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.lambda_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the Lambda that acts as the availability provider.</p>
    pub fn set_lambda_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.lambda_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the Lambda that acts as the availability provider.</p>
    pub fn get_lambda_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.lambda_arn
    }
    /// Consumes the builder and constructs a [`LambdaAvailabilityProvider`](crate::types::LambdaAvailabilityProvider).
    /// This method will fail if any of the following fields are not set:
    /// - [`lambda_arn`](crate::types::builders::LambdaAvailabilityProviderBuilder::lambda_arn)
    pub fn build(self) -> ::std::result::Result<crate::types::LambdaAvailabilityProvider, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::LambdaAvailabilityProvider {
            lambda_arn: self.lambda_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "lambda_arn",
                    "lambda_arn was not specified but it is required when building LambdaAvailabilityProvider",
                )
            })?,
        })
    }
}