aws_sdk_kinesisanalytics/types/
_input_lambda_processor.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An object that contains the Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/lambda/">AWS Lambda</a> function that is used to preprocess records in the stream, and the ARN of the IAM role that is used to access the AWS Lambda function.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct InputLambdaProcessor {
7    /// <p>The ARN of the <a href="https://docs.aws.amazon.com/lambda/">AWS Lambda</a> function that operates on records in the stream.</p><note>
8    /// <p>To specify an earlier version of the Lambda function than the latest, include the Lambda function version in the Lambda function ARN. For more information about Lambda ARNs, see <a href="/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-lambda">Example ARNs: AWS Lambda</a></p>
9    /// </note>
10    pub resource_arn: ::std::string::String,
11    /// <p>The ARN of the IAM role that is used to access the AWS Lambda function.</p>
12    pub role_arn: ::std::string::String,
13}
14impl InputLambdaProcessor {
15    /// <p>The ARN of the <a href="https://docs.aws.amazon.com/lambda/">AWS Lambda</a> function that operates on records in the stream.</p><note>
16    /// <p>To specify an earlier version of the Lambda function than the latest, include the Lambda function version in the Lambda function ARN. For more information about Lambda ARNs, see <a href="/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-lambda">Example ARNs: AWS Lambda</a></p>
17    /// </note>
18    pub fn resource_arn(&self) -> &str {
19        use std::ops::Deref;
20        self.resource_arn.deref()
21    }
22    /// <p>The ARN of the IAM role that is used to access the AWS Lambda function.</p>
23    pub fn role_arn(&self) -> &str {
24        use std::ops::Deref;
25        self.role_arn.deref()
26    }
27}
28impl InputLambdaProcessor {
29    /// Creates a new builder-style object to manufacture [`InputLambdaProcessor`](crate::types::InputLambdaProcessor).
30    pub fn builder() -> crate::types::builders::InputLambdaProcessorBuilder {
31        crate::types::builders::InputLambdaProcessorBuilder::default()
32    }
33}
34
35/// A builder for [`InputLambdaProcessor`](crate::types::InputLambdaProcessor).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct InputLambdaProcessorBuilder {
39    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
40    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
41}
42impl InputLambdaProcessorBuilder {
43    /// <p>The ARN of the <a href="https://docs.aws.amazon.com/lambda/">AWS Lambda</a> function that operates on records in the stream.</p><note>
44    /// <p>To specify an earlier version of the Lambda function than the latest, include the Lambda function version in the Lambda function ARN. For more information about Lambda ARNs, see <a href="/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-lambda">Example ARNs: AWS Lambda</a></p>
45    /// </note>
46    /// This field is required.
47    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.resource_arn = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>The ARN of the <a href="https://docs.aws.amazon.com/lambda/">AWS Lambda</a> function that operates on records in the stream.</p><note>
52    /// <p>To specify an earlier version of the Lambda function than the latest, include the Lambda function version in the Lambda function ARN. For more information about Lambda ARNs, see <a href="/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-lambda">Example ARNs: AWS Lambda</a></p>
53    /// </note>
54    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
55        self.resource_arn = input;
56        self
57    }
58    /// <p>The ARN of the <a href="https://docs.aws.amazon.com/lambda/">AWS Lambda</a> function that operates on records in the stream.</p><note>
59    /// <p>To specify an earlier version of the Lambda function than the latest, include the Lambda function version in the Lambda function ARN. For more information about Lambda ARNs, see <a href="/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-lambda">Example ARNs: AWS Lambda</a></p>
60    /// </note>
61    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
62        &self.resource_arn
63    }
64    /// <p>The ARN of the IAM role that is used to access the AWS Lambda function.</p>
65    /// This field is required.
66    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.role_arn = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The ARN of the IAM role that is used to access the AWS Lambda function.</p>
71    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.role_arn = input;
73        self
74    }
75    /// <p>The ARN of the IAM role that is used to access the AWS Lambda function.</p>
76    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
77        &self.role_arn
78    }
79    /// Consumes the builder and constructs a [`InputLambdaProcessor`](crate::types::InputLambdaProcessor).
80    /// This method will fail if any of the following fields are not set:
81    /// - [`resource_arn`](crate::types::builders::InputLambdaProcessorBuilder::resource_arn)
82    /// - [`role_arn`](crate::types::builders::InputLambdaProcessorBuilder::role_arn)
83    pub fn build(self) -> ::std::result::Result<crate::types::InputLambdaProcessor, ::aws_smithy_types::error::operation::BuildError> {
84        ::std::result::Result::Ok(crate::types::InputLambdaProcessor {
85            resource_arn: self.resource_arn.ok_or_else(|| {
86                ::aws_smithy_types::error::operation::BuildError::missing_field(
87                    "resource_arn",
88                    "resource_arn was not specified but it is required when building InputLambdaProcessor",
89                )
90            })?,
91            role_arn: self.role_arn.ok_or_else(|| {
92                ::aws_smithy_types::error::operation::BuildError::missing_field(
93                    "role_arn",
94                    "role_arn was not specified but it is required when building InputLambdaProcessor",
95                )
96            })?,
97        })
98    }
99}