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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Contains the metadata required to introspect the RDS cluster.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct RdsDataApiConfig {
    /// <p>The resource ARN of the RDS cluster.</p>
    pub resource_arn: ::std::string::String,
    /// <p>The secret's ARN that was obtained from Secrets Manager. A secret consists of secret information, the secret value, plus metadata about the secret. A secret value can be a string or binary. It typically includes the ARN, secret name and description, policies, tags, encryption key from the Key Management Service, and key rotation data.</p>
    pub secret_arn: ::std::string::String,
    /// <p>The name of the database in the cluster.</p>
    pub database_name: ::std::string::String,
}
impl RdsDataApiConfig {
    /// <p>The resource ARN of the RDS cluster.</p>
    pub fn resource_arn(&self) -> &str {
        use std::ops::Deref;
        self.resource_arn.deref()
    }
    /// <p>The secret's ARN that was obtained from Secrets Manager. A secret consists of secret information, the secret value, plus metadata about the secret. A secret value can be a string or binary. It typically includes the ARN, secret name and description, policies, tags, encryption key from the Key Management Service, and key rotation data.</p>
    pub fn secret_arn(&self) -> &str {
        use std::ops::Deref;
        self.secret_arn.deref()
    }
    /// <p>The name of the database in the cluster.</p>
    pub fn database_name(&self) -> &str {
        use std::ops::Deref;
        self.database_name.deref()
    }
}
impl RdsDataApiConfig {
    /// Creates a new builder-style object to manufacture [`RdsDataApiConfig`](crate::types::RdsDataApiConfig).
    pub fn builder() -> crate::types::builders::RdsDataApiConfigBuilder {
        crate::types::builders::RdsDataApiConfigBuilder::default()
    }
}

/// A builder for [`RdsDataApiConfig`](crate::types::RdsDataApiConfig).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct RdsDataApiConfigBuilder {
    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
    pub(crate) secret_arn: ::std::option::Option<::std::string::String>,
    pub(crate) database_name: ::std::option::Option<::std::string::String>,
}
impl RdsDataApiConfigBuilder {
    /// <p>The resource ARN of the RDS cluster.</p>
    /// This field is required.
    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The resource ARN of the RDS cluster.</p>
    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_arn = input;
        self
    }
    /// <p>The resource ARN of the RDS cluster.</p>
    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_arn
    }
    /// <p>The secret's ARN that was obtained from Secrets Manager. A secret consists of secret information, the secret value, plus metadata about the secret. A secret value can be a string or binary. It typically includes the ARN, secret name and description, policies, tags, encryption key from the Key Management Service, and key rotation data.</p>
    /// This field is required.
    pub fn secret_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.secret_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The secret's ARN that was obtained from Secrets Manager. A secret consists of secret information, the secret value, plus metadata about the secret. A secret value can be a string or binary. It typically includes the ARN, secret name and description, policies, tags, encryption key from the Key Management Service, and key rotation data.</p>
    pub fn set_secret_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.secret_arn = input;
        self
    }
    /// <p>The secret's ARN that was obtained from Secrets Manager. A secret consists of secret information, the secret value, plus metadata about the secret. A secret value can be a string or binary. It typically includes the ARN, secret name and description, policies, tags, encryption key from the Key Management Service, and key rotation data.</p>
    pub fn get_secret_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.secret_arn
    }
    /// <p>The name of the database in the cluster.</p>
    /// This field is required.
    pub fn database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.database_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the database in the cluster.</p>
    pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.database_name = input;
        self
    }
    /// <p>The name of the database in the cluster.</p>
    pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.database_name
    }
    /// Consumes the builder and constructs a [`RdsDataApiConfig`](crate::types::RdsDataApiConfig).
    /// This method will fail if any of the following fields are not set:
    /// - [`resource_arn`](crate::types::builders::RdsDataApiConfigBuilder::resource_arn)
    /// - [`secret_arn`](crate::types::builders::RdsDataApiConfigBuilder::secret_arn)
    /// - [`database_name`](crate::types::builders::RdsDataApiConfigBuilder::database_name)
    pub fn build(self) -> ::std::result::Result<crate::types::RdsDataApiConfig, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::RdsDataApiConfig {
            resource_arn: self.resource_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "resource_arn",
                    "resource_arn was not specified but it is required when building RdsDataApiConfig",
                )
            })?,
            secret_arn: self.secret_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "secret_arn",
                    "secret_arn was not specified but it is required when building RdsDataApiConfig",
                )
            })?,
            database_name: self.database_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "database_name",
                    "database_name was not specified but it is required when building RdsDataApiConfig",
                )
            })?,
        })
    }
}