aws_sdk_glue/operation/get_databases/
_get_databases_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 GetDatabasesInput {
6    /// <p>The ID of the Data Catalog from which to retrieve <code>Databases</code>. If none is provided, the Amazon Web Services account ID is used by default.</p>
7    pub catalog_id: ::std::option::Option<::std::string::String>,
8    /// <p>A continuation token, if this is a continuation call.</p>
9    pub next_token: ::std::option::Option<::std::string::String>,
10    /// <p>The maximum number of databases to return in one response.</p>
11    pub max_results: ::std::option::Option<i32>,
12    /// <p>Allows you to specify that you want to list the databases shared with your account. The allowable values are <code>FEDERATED</code>, <code>FOREIGN</code> or <code>ALL</code>.</p>
13    /// <ul>
14    /// <li>
15    /// <p>If set to <code>FEDERATED</code>, will list the federated databases (referencing an external entity) shared with your account.</p></li>
16    /// <li>
17    /// <p>If set to <code>FOREIGN</code>, will list the databases shared with your account.</p></li>
18    /// <li>
19    /// <p>If set to <code>ALL</code>, will list the databases shared with your account, as well as the databases in yor local account.</p></li>
20    /// </ul>
21    pub resource_share_type: ::std::option::Option<crate::types::ResourceShareType>,
22    /// <p>Specifies the database fields returned by the <code>GetDatabases</code> call. This parameter doesn’t accept an empty list. The request must include the <code>NAME</code>.</p>
23    pub attributes_to_get: ::std::option::Option<::std::vec::Vec<crate::types::DatabaseAttributes>>,
24}
25impl GetDatabasesInput {
26    /// <p>The ID of the Data Catalog from which to retrieve <code>Databases</code>. If none is provided, the Amazon Web Services account ID is used by default.</p>
27    pub fn catalog_id(&self) -> ::std::option::Option<&str> {
28        self.catalog_id.as_deref()
29    }
30    /// <p>A continuation token, if this is a continuation call.</p>
31    pub fn next_token(&self) -> ::std::option::Option<&str> {
32        self.next_token.as_deref()
33    }
34    /// <p>The maximum number of databases to return in one response.</p>
35    pub fn max_results(&self) -> ::std::option::Option<i32> {
36        self.max_results
37    }
38    /// <p>Allows you to specify that you want to list the databases shared with your account. The allowable values are <code>FEDERATED</code>, <code>FOREIGN</code> or <code>ALL</code>.</p>
39    /// <ul>
40    /// <li>
41    /// <p>If set to <code>FEDERATED</code>, will list the federated databases (referencing an external entity) shared with your account.</p></li>
42    /// <li>
43    /// <p>If set to <code>FOREIGN</code>, will list the databases shared with your account.</p></li>
44    /// <li>
45    /// <p>If set to <code>ALL</code>, will list the databases shared with your account, as well as the databases in yor local account.</p></li>
46    /// </ul>
47    pub fn resource_share_type(&self) -> ::std::option::Option<&crate::types::ResourceShareType> {
48        self.resource_share_type.as_ref()
49    }
50    /// <p>Specifies the database fields returned by the <code>GetDatabases</code> call. This parameter doesn’t accept an empty list. The request must include the <code>NAME</code>.</p>
51    ///
52    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.attributes_to_get.is_none()`.
53    pub fn attributes_to_get(&self) -> &[crate::types::DatabaseAttributes] {
54        self.attributes_to_get.as_deref().unwrap_or_default()
55    }
56}
57impl GetDatabasesInput {
58    /// Creates a new builder-style object to manufacture [`GetDatabasesInput`](crate::operation::get_databases::GetDatabasesInput).
59    pub fn builder() -> crate::operation::get_databases::builders::GetDatabasesInputBuilder {
60        crate::operation::get_databases::builders::GetDatabasesInputBuilder::default()
61    }
62}
63
64/// A builder for [`GetDatabasesInput`](crate::operation::get_databases::GetDatabasesInput).
65#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
66#[non_exhaustive]
67pub struct GetDatabasesInputBuilder {
68    pub(crate) catalog_id: ::std::option::Option<::std::string::String>,
69    pub(crate) next_token: ::std::option::Option<::std::string::String>,
70    pub(crate) max_results: ::std::option::Option<i32>,
71    pub(crate) resource_share_type: ::std::option::Option<crate::types::ResourceShareType>,
72    pub(crate) attributes_to_get: ::std::option::Option<::std::vec::Vec<crate::types::DatabaseAttributes>>,
73}
74impl GetDatabasesInputBuilder {
75    /// <p>The ID of the Data Catalog from which to retrieve <code>Databases</code>. If none is provided, the Amazon Web Services account ID is used by default.</p>
76    pub fn catalog_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.catalog_id = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>The ID of the Data Catalog from which to retrieve <code>Databases</code>. If none is provided, the Amazon Web Services account ID is used by default.</p>
81    pub fn set_catalog_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.catalog_id = input;
83        self
84    }
85    /// <p>The ID of the Data Catalog from which to retrieve <code>Databases</code>. If none is provided, the Amazon Web Services account ID is used by default.</p>
86    pub fn get_catalog_id(&self) -> &::std::option::Option<::std::string::String> {
87        &self.catalog_id
88    }
89    /// <p>A continuation token, if this is a continuation call.</p>
90    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.next_token = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>A continuation token, if this is a continuation call.</p>
95    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.next_token = input;
97        self
98    }
99    /// <p>A continuation token, if this is a continuation call.</p>
100    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
101        &self.next_token
102    }
103    /// <p>The maximum number of databases to return in one response.</p>
104    pub fn max_results(mut self, input: i32) -> Self {
105        self.max_results = ::std::option::Option::Some(input);
106        self
107    }
108    /// <p>The maximum number of databases to return in one response.</p>
109    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
110        self.max_results = input;
111        self
112    }
113    /// <p>The maximum number of databases to return in one response.</p>
114    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
115        &self.max_results
116    }
117    /// <p>Allows you to specify that you want to list the databases shared with your account. The allowable values are <code>FEDERATED</code>, <code>FOREIGN</code> or <code>ALL</code>.</p>
118    /// <ul>
119    /// <li>
120    /// <p>If set to <code>FEDERATED</code>, will list the federated databases (referencing an external entity) shared with your account.</p></li>
121    /// <li>
122    /// <p>If set to <code>FOREIGN</code>, will list the databases shared with your account.</p></li>
123    /// <li>
124    /// <p>If set to <code>ALL</code>, will list the databases shared with your account, as well as the databases in yor local account.</p></li>
125    /// </ul>
126    pub fn resource_share_type(mut self, input: crate::types::ResourceShareType) -> Self {
127        self.resource_share_type = ::std::option::Option::Some(input);
128        self
129    }
130    /// <p>Allows you to specify that you want to list the databases shared with your account. The allowable values are <code>FEDERATED</code>, <code>FOREIGN</code> or <code>ALL</code>.</p>
131    /// <ul>
132    /// <li>
133    /// <p>If set to <code>FEDERATED</code>, will list the federated databases (referencing an external entity) shared with your account.</p></li>
134    /// <li>
135    /// <p>If set to <code>FOREIGN</code>, will list the databases shared with your account.</p></li>
136    /// <li>
137    /// <p>If set to <code>ALL</code>, will list the databases shared with your account, as well as the databases in yor local account.</p></li>
138    /// </ul>
139    pub fn set_resource_share_type(mut self, input: ::std::option::Option<crate::types::ResourceShareType>) -> Self {
140        self.resource_share_type = input;
141        self
142    }
143    /// <p>Allows you to specify that you want to list the databases shared with your account. The allowable values are <code>FEDERATED</code>, <code>FOREIGN</code> or <code>ALL</code>.</p>
144    /// <ul>
145    /// <li>
146    /// <p>If set to <code>FEDERATED</code>, will list the federated databases (referencing an external entity) shared with your account.</p></li>
147    /// <li>
148    /// <p>If set to <code>FOREIGN</code>, will list the databases shared with your account.</p></li>
149    /// <li>
150    /// <p>If set to <code>ALL</code>, will list the databases shared with your account, as well as the databases in yor local account.</p></li>
151    /// </ul>
152    pub fn get_resource_share_type(&self) -> &::std::option::Option<crate::types::ResourceShareType> {
153        &self.resource_share_type
154    }
155    /// Appends an item to `attributes_to_get`.
156    ///
157    /// To override the contents of this collection use [`set_attributes_to_get`](Self::set_attributes_to_get).
158    ///
159    /// <p>Specifies the database fields returned by the <code>GetDatabases</code> call. This parameter doesn’t accept an empty list. The request must include the <code>NAME</code>.</p>
160    pub fn attributes_to_get(mut self, input: crate::types::DatabaseAttributes) -> Self {
161        let mut v = self.attributes_to_get.unwrap_or_default();
162        v.push(input);
163        self.attributes_to_get = ::std::option::Option::Some(v);
164        self
165    }
166    /// <p>Specifies the database fields returned by the <code>GetDatabases</code> call. This parameter doesn’t accept an empty list. The request must include the <code>NAME</code>.</p>
167    pub fn set_attributes_to_get(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DatabaseAttributes>>) -> Self {
168        self.attributes_to_get = input;
169        self
170    }
171    /// <p>Specifies the database fields returned by the <code>GetDatabases</code> call. This parameter doesn’t accept an empty list. The request must include the <code>NAME</code>.</p>
172    pub fn get_attributes_to_get(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DatabaseAttributes>> {
173        &self.attributes_to_get
174    }
175    /// Consumes the builder and constructs a [`GetDatabasesInput`](crate::operation::get_databases::GetDatabasesInput).
176    pub fn build(
177        self,
178    ) -> ::std::result::Result<crate::operation::get_databases::GetDatabasesInput, ::aws_smithy_types::error::operation::BuildError> {
179        ::std::result::Result::Ok(crate::operation::get_databases::GetDatabasesInput {
180            catalog_id: self.catalog_id,
181            next_token: self.next_token,
182            max_results: self.max_results,
183            resource_share_type: self.resource_share_type,
184            attributes_to_get: self.attributes_to_get,
185        })
186    }
187}