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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>When you update a reference data source configuration for a SQL-based Kinesis Data Analytics application, this object provides all the updated values (such as the source bucket name and object key name), the in-application table name that is created, and updated mapping information that maps the data in the Amazon S3 object to the in-application reference table that is created.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ReferenceDataSourceUpdate {
    /// <p>The ID of the reference data source that is being updated. You can use the <code>DescribeApplication</code> operation to get this value.</p>
    pub reference_id: ::std::string::String,
    /// <p>The in-application table name that is created by this update.</p>
    pub table_name_update: ::std::option::Option<::std::string::String>,
    /// <p>Describes the S3 bucket name, object key name, and IAM role that Kinesis Data Analytics can assume to read the Amazon S3 object on your behalf and populate the in-application reference table.</p>
    pub s3_reference_data_source_update: ::std::option::Option<crate::types::S3ReferenceDataSourceUpdate>,
    /// <p>Describes the format of the data in the streaming source, and how each data element maps to corresponding columns created in the in-application stream.</p>
    pub reference_schema_update: ::std::option::Option<crate::types::SourceSchema>,
}
impl ReferenceDataSourceUpdate {
    /// <p>The ID of the reference data source that is being updated. You can use the <code>DescribeApplication</code> operation to get this value.</p>
    pub fn reference_id(&self) -> &str {
        use std::ops::Deref;
        self.reference_id.deref()
    }
    /// <p>The in-application table name that is created by this update.</p>
    pub fn table_name_update(&self) -> ::std::option::Option<&str> {
        self.table_name_update.as_deref()
    }
    /// <p>Describes the S3 bucket name, object key name, and IAM role that Kinesis Data Analytics can assume to read the Amazon S3 object on your behalf and populate the in-application reference table.</p>
    pub fn s3_reference_data_source_update(&self) -> ::std::option::Option<&crate::types::S3ReferenceDataSourceUpdate> {
        self.s3_reference_data_source_update.as_ref()
    }
    /// <p>Describes the format of the data in the streaming source, and how each data element maps to corresponding columns created in the in-application stream.</p>
    pub fn reference_schema_update(&self) -> ::std::option::Option<&crate::types::SourceSchema> {
        self.reference_schema_update.as_ref()
    }
}
impl ReferenceDataSourceUpdate {
    /// Creates a new builder-style object to manufacture [`ReferenceDataSourceUpdate`](crate::types::ReferenceDataSourceUpdate).
    pub fn builder() -> crate::types::builders::ReferenceDataSourceUpdateBuilder {
        crate::types::builders::ReferenceDataSourceUpdateBuilder::default()
    }
}

/// A builder for [`ReferenceDataSourceUpdate`](crate::types::ReferenceDataSourceUpdate).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ReferenceDataSourceUpdateBuilder {
    pub(crate) reference_id: ::std::option::Option<::std::string::String>,
    pub(crate) table_name_update: ::std::option::Option<::std::string::String>,
    pub(crate) s3_reference_data_source_update: ::std::option::Option<crate::types::S3ReferenceDataSourceUpdate>,
    pub(crate) reference_schema_update: ::std::option::Option<crate::types::SourceSchema>,
}
impl ReferenceDataSourceUpdateBuilder {
    /// <p>The ID of the reference data source that is being updated. You can use the <code>DescribeApplication</code> operation to get this value.</p>
    /// This field is required.
    pub fn reference_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.reference_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the reference data source that is being updated. You can use the <code>DescribeApplication</code> operation to get this value.</p>
    pub fn set_reference_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.reference_id = input;
        self
    }
    /// <p>The ID of the reference data source that is being updated. You can use the <code>DescribeApplication</code> operation to get this value.</p>
    pub fn get_reference_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.reference_id
    }
    /// <p>The in-application table name that is created by this update.</p>
    pub fn table_name_update(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.table_name_update = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The in-application table name that is created by this update.</p>
    pub fn set_table_name_update(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.table_name_update = input;
        self
    }
    /// <p>The in-application table name that is created by this update.</p>
    pub fn get_table_name_update(&self) -> &::std::option::Option<::std::string::String> {
        &self.table_name_update
    }
    /// <p>Describes the S3 bucket name, object key name, and IAM role that Kinesis Data Analytics can assume to read the Amazon S3 object on your behalf and populate the in-application reference table.</p>
    pub fn s3_reference_data_source_update(mut self, input: crate::types::S3ReferenceDataSourceUpdate) -> Self {
        self.s3_reference_data_source_update = ::std::option::Option::Some(input);
        self
    }
    /// <p>Describes the S3 bucket name, object key name, and IAM role that Kinesis Data Analytics can assume to read the Amazon S3 object on your behalf and populate the in-application reference table.</p>
    pub fn set_s3_reference_data_source_update(mut self, input: ::std::option::Option<crate::types::S3ReferenceDataSourceUpdate>) -> Self {
        self.s3_reference_data_source_update = input;
        self
    }
    /// <p>Describes the S3 bucket name, object key name, and IAM role that Kinesis Data Analytics can assume to read the Amazon S3 object on your behalf and populate the in-application reference table.</p>
    pub fn get_s3_reference_data_source_update(&self) -> &::std::option::Option<crate::types::S3ReferenceDataSourceUpdate> {
        &self.s3_reference_data_source_update
    }
    /// <p>Describes the format of the data in the streaming source, and how each data element maps to corresponding columns created in the in-application stream.</p>
    pub fn reference_schema_update(mut self, input: crate::types::SourceSchema) -> Self {
        self.reference_schema_update = ::std::option::Option::Some(input);
        self
    }
    /// <p>Describes the format of the data in the streaming source, and how each data element maps to corresponding columns created in the in-application stream.</p>
    pub fn set_reference_schema_update(mut self, input: ::std::option::Option<crate::types::SourceSchema>) -> Self {
        self.reference_schema_update = input;
        self
    }
    /// <p>Describes the format of the data in the streaming source, and how each data element maps to corresponding columns created in the in-application stream.</p>
    pub fn get_reference_schema_update(&self) -> &::std::option::Option<crate::types::SourceSchema> {
        &self.reference_schema_update
    }
    /// Consumes the builder and constructs a [`ReferenceDataSourceUpdate`](crate::types::ReferenceDataSourceUpdate).
    /// This method will fail if any of the following fields are not set:
    /// - [`reference_id`](crate::types::builders::ReferenceDataSourceUpdateBuilder::reference_id)
    pub fn build(self) -> ::std::result::Result<crate::types::ReferenceDataSourceUpdate, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::ReferenceDataSourceUpdate {
            reference_id: self.reference_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "reference_id",
                    "reference_id was not specified but it is required when building ReferenceDataSourceUpdate",
                )
            })?,
            table_name_update: self.table_name_update,
            s3_reference_data_source_update: self.s3_reference_data_source_update,
            reference_schema_update: self.reference_schema_update,
        })
    }
}