Skip to main content

aws_sdk_kinesisanalyticsv2/types/
_s3_reference_data_source_description.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>For a SQL-based Kinesis Data Analytics application, provides the bucket name and object key name that stores the reference data.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct S3ReferenceDataSourceDescription {
7    /// <p>The Amazon Resource Name (ARN) of the S3 bucket.</p>
8    pub bucket_arn: ::std::string::String,
9    /// <p>Amazon S3 object key name.</p>
10    pub file_key: ::std::string::String,
11    /// <p>The ARN of the IAM role that Kinesis Data Analytics can assume to read the Amazon S3 object on your behalf to populate the in-application reference table.</p><note>
12    /// <p>Provided for backward compatibility. Applications that are created with the current API version have an application-level service execution role rather than a resource-level role.</p>
13    /// </note>
14    pub reference_role_arn: ::std::option::Option<::std::string::String>,
15}
16impl S3ReferenceDataSourceDescription {
17    /// <p>The Amazon Resource Name (ARN) of the S3 bucket.</p>
18    pub fn bucket_arn(&self) -> &str {
19        use std::ops::Deref;
20        self.bucket_arn.deref()
21    }
22    /// <p>Amazon S3 object key name.</p>
23    pub fn file_key(&self) -> &str {
24        use std::ops::Deref;
25        self.file_key.deref()
26    }
27    /// <p>The ARN of the IAM role that Kinesis Data Analytics can assume to read the Amazon S3 object on your behalf to populate the in-application reference table.</p><note>
28    /// <p>Provided for backward compatibility. Applications that are created with the current API version have an application-level service execution role rather than a resource-level role.</p>
29    /// </note>
30    pub fn reference_role_arn(&self) -> ::std::option::Option<&str> {
31        self.reference_role_arn.as_deref()
32    }
33}
34impl S3ReferenceDataSourceDescription {
35    /// Creates a new builder-style object to manufacture [`S3ReferenceDataSourceDescription`](crate::types::S3ReferenceDataSourceDescription).
36    pub fn builder() -> crate::types::builders::S3ReferenceDataSourceDescriptionBuilder {
37        crate::types::builders::S3ReferenceDataSourceDescriptionBuilder::default()
38    }
39}
40
41/// A builder for [`S3ReferenceDataSourceDescription`](crate::types::S3ReferenceDataSourceDescription).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct S3ReferenceDataSourceDescriptionBuilder {
45    pub(crate) bucket_arn: ::std::option::Option<::std::string::String>,
46    pub(crate) file_key: ::std::option::Option<::std::string::String>,
47    pub(crate) reference_role_arn: ::std::option::Option<::std::string::String>,
48}
49impl S3ReferenceDataSourceDescriptionBuilder {
50    /// <p>The Amazon Resource Name (ARN) of the S3 bucket.</p>
51    /// This field is required.
52    pub fn bucket_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.bucket_arn = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The Amazon Resource Name (ARN) of the S3 bucket.</p>
57    pub fn set_bucket_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.bucket_arn = input;
59        self
60    }
61    /// <p>The Amazon Resource Name (ARN) of the S3 bucket.</p>
62    pub fn get_bucket_arn(&self) -> &::std::option::Option<::std::string::String> {
63        &self.bucket_arn
64    }
65    /// <p>Amazon S3 object key name.</p>
66    /// This field is required.
67    pub fn file_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.file_key = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>Amazon S3 object key name.</p>
72    pub fn set_file_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.file_key = input;
74        self
75    }
76    /// <p>Amazon S3 object key name.</p>
77    pub fn get_file_key(&self) -> &::std::option::Option<::std::string::String> {
78        &self.file_key
79    }
80    /// <p>The ARN of the IAM role that Kinesis Data Analytics can assume to read the Amazon S3 object on your behalf to populate the in-application reference table.</p><note>
81    /// <p>Provided for backward compatibility. Applications that are created with the current API version have an application-level service execution role rather than a resource-level role.</p>
82    /// </note>
83    pub fn reference_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.reference_role_arn = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The ARN of the IAM role that Kinesis Data Analytics can assume to read the Amazon S3 object on your behalf to populate the in-application reference table.</p><note>
88    /// <p>Provided for backward compatibility. Applications that are created with the current API version have an application-level service execution role rather than a resource-level role.</p>
89    /// </note>
90    pub fn set_reference_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91        self.reference_role_arn = input;
92        self
93    }
94    /// <p>The ARN of the IAM role that Kinesis Data Analytics can assume to read the Amazon S3 object on your behalf to populate the in-application reference table.</p><note>
95    /// <p>Provided for backward compatibility. Applications that are created with the current API version have an application-level service execution role rather than a resource-level role.</p>
96    /// </note>
97    pub fn get_reference_role_arn(&self) -> &::std::option::Option<::std::string::String> {
98        &self.reference_role_arn
99    }
100    /// Consumes the builder and constructs a [`S3ReferenceDataSourceDescription`](crate::types::S3ReferenceDataSourceDescription).
101    /// This method will fail if any of the following fields are not set:
102    /// - [`bucket_arn`](crate::types::builders::S3ReferenceDataSourceDescriptionBuilder::bucket_arn)
103    /// - [`file_key`](crate::types::builders::S3ReferenceDataSourceDescriptionBuilder::file_key)
104    pub fn build(self) -> ::std::result::Result<crate::types::S3ReferenceDataSourceDescription, ::aws_smithy_types::error::operation::BuildError> {
105        ::std::result::Result::Ok(crate::types::S3ReferenceDataSourceDescription {
106            bucket_arn: self.bucket_arn.ok_or_else(|| {
107                ::aws_smithy_types::error::operation::BuildError::missing_field(
108                    "bucket_arn",
109                    "bucket_arn was not specified but it is required when building S3ReferenceDataSourceDescription",
110                )
111            })?,
112            file_key: self.file_key.ok_or_else(|| {
113                ::aws_smithy_types::error::operation::BuildError::missing_field(
114                    "file_key",
115                    "file_key was not specified but it is required when building S3ReferenceDataSourceDescription",
116                )
117            })?,
118            reference_role_arn: self.reference_role_arn,
119        })
120    }
121}