Skip to main content

aws_sdk_redshiftserverless/operation/get_credentials/
_get_credentials_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetCredentialsInput {
6    /// <p>The name of the database to get temporary authorization to log on to.</p>
7    /// <p>Constraints:</p>
8    /// <ul>
9    /// <li>
10    /// <p>Must be 1 to 64 alphanumeric characters or hyphens.</p></li>
11    /// <li>
12    /// <p>Must contain only uppercase or lowercase letters, numbers, underscore, plus sign, period (dot), at symbol (@), or hyphen.</p></li>
13    /// <li>
14    /// <p>The first character must be a letter.</p></li>
15    /// <li>
16    /// <p>Must not contain a colon ( : ) or slash ( / ).</p></li>
17    /// <li>
18    /// <p>Cannot be a reserved word. A list of reserved words can be found in <a href="https://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html">Reserved Words </a> in the Amazon Redshift Database Developer Guide</p></li>
19    /// </ul>
20    pub db_name: ::std::option::Option<::std::string::String>,
21    /// <p>The number of seconds until the returned temporary password expires. The minimum is 900 seconds, and the maximum is 3600 seconds.</p>
22    pub duration_seconds: ::std::option::Option<i32>,
23    /// <p>The name of the workgroup associated with the database.</p>
24    pub workgroup_name: ::std::option::Option<::std::string::String>,
25    /// <p>The custom domain name associated with the workgroup. The custom domain name or the workgroup name must be included in the request.</p>
26    pub custom_domain_name: ::std::option::Option<::std::string::String>,
27}
28impl GetCredentialsInput {
29    /// <p>The name of the database to get temporary authorization to log on to.</p>
30    /// <p>Constraints:</p>
31    /// <ul>
32    /// <li>
33    /// <p>Must be 1 to 64 alphanumeric characters or hyphens.</p></li>
34    /// <li>
35    /// <p>Must contain only uppercase or lowercase letters, numbers, underscore, plus sign, period (dot), at symbol (@), or hyphen.</p></li>
36    /// <li>
37    /// <p>The first character must be a letter.</p></li>
38    /// <li>
39    /// <p>Must not contain a colon ( : ) or slash ( / ).</p></li>
40    /// <li>
41    /// <p>Cannot be a reserved word. A list of reserved words can be found in <a href="https://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html">Reserved Words </a> in the Amazon Redshift Database Developer Guide</p></li>
42    /// </ul>
43    pub fn db_name(&self) -> ::std::option::Option<&str> {
44        self.db_name.as_deref()
45    }
46    /// <p>The number of seconds until the returned temporary password expires. The minimum is 900 seconds, and the maximum is 3600 seconds.</p>
47    pub fn duration_seconds(&self) -> ::std::option::Option<i32> {
48        self.duration_seconds
49    }
50    /// <p>The name of the workgroup associated with the database.</p>
51    pub fn workgroup_name(&self) -> ::std::option::Option<&str> {
52        self.workgroup_name.as_deref()
53    }
54    /// <p>The custom domain name associated with the workgroup. The custom domain name or the workgroup name must be included in the request.</p>
55    pub fn custom_domain_name(&self) -> ::std::option::Option<&str> {
56        self.custom_domain_name.as_deref()
57    }
58}
59impl GetCredentialsInput {
60    /// Creates a new builder-style object to manufacture [`GetCredentialsInput`](crate::operation::get_credentials::GetCredentialsInput).
61    pub fn builder() -> crate::operation::get_credentials::builders::GetCredentialsInputBuilder {
62        crate::operation::get_credentials::builders::GetCredentialsInputBuilder::default()
63    }
64}
65
66/// A builder for [`GetCredentialsInput`](crate::operation::get_credentials::GetCredentialsInput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68#[non_exhaustive]
69pub struct GetCredentialsInputBuilder {
70    pub(crate) db_name: ::std::option::Option<::std::string::String>,
71    pub(crate) duration_seconds: ::std::option::Option<i32>,
72    pub(crate) workgroup_name: ::std::option::Option<::std::string::String>,
73    pub(crate) custom_domain_name: ::std::option::Option<::std::string::String>,
74}
75impl GetCredentialsInputBuilder {
76    /// <p>The name of the database to get temporary authorization to log on to.</p>
77    /// <p>Constraints:</p>
78    /// <ul>
79    /// <li>
80    /// <p>Must be 1 to 64 alphanumeric characters or hyphens.</p></li>
81    /// <li>
82    /// <p>Must contain only uppercase or lowercase letters, numbers, underscore, plus sign, period (dot), at symbol (@), or hyphen.</p></li>
83    /// <li>
84    /// <p>The first character must be a letter.</p></li>
85    /// <li>
86    /// <p>Must not contain a colon ( : ) or slash ( / ).</p></li>
87    /// <li>
88    /// <p>Cannot be a reserved word. A list of reserved words can be found in <a href="https://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html">Reserved Words </a> in the Amazon Redshift Database Developer Guide</p></li>
89    /// </ul>
90    pub fn db_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.db_name = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The name of the database to get temporary authorization to log on to.</p>
95    /// <p>Constraints:</p>
96    /// <ul>
97    /// <li>
98    /// <p>Must be 1 to 64 alphanumeric characters or hyphens.</p></li>
99    /// <li>
100    /// <p>Must contain only uppercase or lowercase letters, numbers, underscore, plus sign, period (dot), at symbol (@), or hyphen.</p></li>
101    /// <li>
102    /// <p>The first character must be a letter.</p></li>
103    /// <li>
104    /// <p>Must not contain a colon ( : ) or slash ( / ).</p></li>
105    /// <li>
106    /// <p>Cannot be a reserved word. A list of reserved words can be found in <a href="https://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html">Reserved Words </a> in the Amazon Redshift Database Developer Guide</p></li>
107    /// </ul>
108    pub fn set_db_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.db_name = input;
110        self
111    }
112    /// <p>The name of the database to get temporary authorization to log on to.</p>
113    /// <p>Constraints:</p>
114    /// <ul>
115    /// <li>
116    /// <p>Must be 1 to 64 alphanumeric characters or hyphens.</p></li>
117    /// <li>
118    /// <p>Must contain only uppercase or lowercase letters, numbers, underscore, plus sign, period (dot), at symbol (@), or hyphen.</p></li>
119    /// <li>
120    /// <p>The first character must be a letter.</p></li>
121    /// <li>
122    /// <p>Must not contain a colon ( : ) or slash ( / ).</p></li>
123    /// <li>
124    /// <p>Cannot be a reserved word. A list of reserved words can be found in <a href="https://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html">Reserved Words </a> in the Amazon Redshift Database Developer Guide</p></li>
125    /// </ul>
126    pub fn get_db_name(&self) -> &::std::option::Option<::std::string::String> {
127        &self.db_name
128    }
129    /// <p>The number of seconds until the returned temporary password expires. The minimum is 900 seconds, and the maximum is 3600 seconds.</p>
130    pub fn duration_seconds(mut self, input: i32) -> Self {
131        self.duration_seconds = ::std::option::Option::Some(input);
132        self
133    }
134    /// <p>The number of seconds until the returned temporary password expires. The minimum is 900 seconds, and the maximum is 3600 seconds.</p>
135    pub fn set_duration_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
136        self.duration_seconds = input;
137        self
138    }
139    /// <p>The number of seconds until the returned temporary password expires. The minimum is 900 seconds, and the maximum is 3600 seconds.</p>
140    pub fn get_duration_seconds(&self) -> &::std::option::Option<i32> {
141        &self.duration_seconds
142    }
143    /// <p>The name of the workgroup associated with the database.</p>
144    pub fn workgroup_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.workgroup_name = ::std::option::Option::Some(input.into());
146        self
147    }
148    /// <p>The name of the workgroup associated with the database.</p>
149    pub fn set_workgroup_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.workgroup_name = input;
151        self
152    }
153    /// <p>The name of the workgroup associated with the database.</p>
154    pub fn get_workgroup_name(&self) -> &::std::option::Option<::std::string::String> {
155        &self.workgroup_name
156    }
157    /// <p>The custom domain name associated with the workgroup. The custom domain name or the workgroup name must be included in the request.</p>
158    pub fn custom_domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.custom_domain_name = ::std::option::Option::Some(input.into());
160        self
161    }
162    /// <p>The custom domain name associated with the workgroup. The custom domain name or the workgroup name must be included in the request.</p>
163    pub fn set_custom_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.custom_domain_name = input;
165        self
166    }
167    /// <p>The custom domain name associated with the workgroup. The custom domain name or the workgroup name must be included in the request.</p>
168    pub fn get_custom_domain_name(&self) -> &::std::option::Option<::std::string::String> {
169        &self.custom_domain_name
170    }
171    /// Consumes the builder and constructs a [`GetCredentialsInput`](crate::operation::get_credentials::GetCredentialsInput).
172    pub fn build(
173        self,
174    ) -> ::std::result::Result<crate::operation::get_credentials::GetCredentialsInput, ::aws_smithy_types::error::operation::BuildError> {
175        ::std::result::Result::Ok(crate::operation::get_credentials::GetCredentialsInput {
176            db_name: self.db_name,
177            duration_seconds: self.duration_seconds,
178            workgroup_name: self.workgroup_name,
179            custom_domain_name: self.custom_domain_name,
180        })
181    }
182}