aws_sdk_dynamodb/operation/list_tables/_list_tables_output.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the output of a <code>ListTables</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ListTablesOutput {
7 /// <p>The names of the tables associated with the current account at the current endpoint. The maximum size of this array is 100.</p>
8 /// <p>If <code>LastEvaluatedTableName</code> also appears in the output, you can use this value as the <code>ExclusiveStartTableName</code> parameter in a subsequent <code>ListTables</code> request and obtain the next page of results.</p>
9 pub table_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10 /// <p>The name of the last table in the current page of results. Use this value as the <code>ExclusiveStartTableName</code> in a new request to obtain the next page of results, until all the table names are returned.</p>
11 /// <p>If you do not receive a <code>LastEvaluatedTableName</code> value in the response, this means that there are no more table names to be retrieved.</p>
12 pub last_evaluated_table_name: ::std::option::Option<::std::string::String>,
13 _request_id: Option<String>,
14}
15impl ListTablesOutput {
16 /// <p>The names of the tables associated with the current account at the current endpoint. The maximum size of this array is 100.</p>
17 /// <p>If <code>LastEvaluatedTableName</code> also appears in the output, you can use this value as the <code>ExclusiveStartTableName</code> parameter in a subsequent <code>ListTables</code> request and obtain the next page of results.</p>
18 ///
19 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.table_names.is_none()`.
20 pub fn table_names(&self) -> &[::std::string::String] {
21 self.table_names.as_deref().unwrap_or_default()
22 }
23 /// <p>The name of the last table in the current page of results. Use this value as the <code>ExclusiveStartTableName</code> in a new request to obtain the next page of results, until all the table names are returned.</p>
24 /// <p>If you do not receive a <code>LastEvaluatedTableName</code> value in the response, this means that there are no more table names to be retrieved.</p>
25 pub fn last_evaluated_table_name(&self) -> ::std::option::Option<&str> {
26 self.last_evaluated_table_name.as_deref()
27 }
28}
29impl ::aws_types::request_id::RequestId for ListTablesOutput {
30 fn request_id(&self) -> Option<&str> {
31 self._request_id.as_deref()
32 }
33}
34impl ListTablesOutput {
35 /// Creates a new builder-style object to manufacture [`ListTablesOutput`](crate::operation::list_tables::ListTablesOutput).
36 pub fn builder() -> crate::operation::list_tables::builders::ListTablesOutputBuilder {
37 crate::operation::list_tables::builders::ListTablesOutputBuilder::default()
38 }
39}
40
41/// A builder for [`ListTablesOutput`](crate::operation::list_tables::ListTablesOutput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct ListTablesOutputBuilder {
45 pub(crate) table_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
46 pub(crate) last_evaluated_table_name: ::std::option::Option<::std::string::String>,
47 _request_id: Option<String>,
48}
49impl ListTablesOutputBuilder {
50 /// Appends an item to `table_names`.
51 ///
52 /// To override the contents of this collection use [`set_table_names`](Self::set_table_names).
53 ///
54 /// <p>The names of the tables associated with the current account at the current endpoint. The maximum size of this array is 100.</p>
55 /// <p>If <code>LastEvaluatedTableName</code> also appears in the output, you can use this value as the <code>ExclusiveStartTableName</code> parameter in a subsequent <code>ListTables</code> request and obtain the next page of results.</p>
56 pub fn table_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
57 let mut v = self.table_names.unwrap_or_default();
58 v.push(input.into());
59 self.table_names = ::std::option::Option::Some(v);
60 self
61 }
62 /// <p>The names of the tables associated with the current account at the current endpoint. The maximum size of this array is 100.</p>
63 /// <p>If <code>LastEvaluatedTableName</code> also appears in the output, you can use this value as the <code>ExclusiveStartTableName</code> parameter in a subsequent <code>ListTables</code> request and obtain the next page of results.</p>
64 pub fn set_table_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
65 self.table_names = input;
66 self
67 }
68 /// <p>The names of the tables associated with the current account at the current endpoint. The maximum size of this array is 100.</p>
69 /// <p>If <code>LastEvaluatedTableName</code> also appears in the output, you can use this value as the <code>ExclusiveStartTableName</code> parameter in a subsequent <code>ListTables</code> request and obtain the next page of results.</p>
70 pub fn get_table_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
71 &self.table_names
72 }
73 /// <p>The name of the last table in the current page of results. Use this value as the <code>ExclusiveStartTableName</code> in a new request to obtain the next page of results, until all the table names are returned.</p>
74 /// <p>If you do not receive a <code>LastEvaluatedTableName</code> value in the response, this means that there are no more table names to be retrieved.</p>
75 pub fn last_evaluated_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.last_evaluated_table_name = ::std::option::Option::Some(input.into());
77 self
78 }
79 /// <p>The name of the last table in the current page of results. Use this value as the <code>ExclusiveStartTableName</code> in a new request to obtain the next page of results, until all the table names are returned.</p>
80 /// <p>If you do not receive a <code>LastEvaluatedTableName</code> value in the response, this means that there are no more table names to be retrieved.</p>
81 pub fn set_last_evaluated_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82 self.last_evaluated_table_name = input;
83 self
84 }
85 /// <p>The name of the last table in the current page of results. Use this value as the <code>ExclusiveStartTableName</code> in a new request to obtain the next page of results, until all the table names are returned.</p>
86 /// <p>If you do not receive a <code>LastEvaluatedTableName</code> value in the response, this means that there are no more table names to be retrieved.</p>
87 pub fn get_last_evaluated_table_name(&self) -> &::std::option::Option<::std::string::String> {
88 &self.last_evaluated_table_name
89 }
90 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
91 self._request_id = Some(request_id.into());
92 self
93 }
94
95 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
96 self._request_id = request_id;
97 self
98 }
99 /// Consumes the builder and constructs a [`ListTablesOutput`](crate::operation::list_tables::ListTablesOutput).
100 pub fn build(self) -> crate::operation::list_tables::ListTablesOutput {
101 crate::operation::list_tables::ListTablesOutput {
102 table_names: self.table_names,
103 last_evaluated_table_name: self.last_evaluated_table_name,
104 _request_id: self._request_id,
105 }
106 }
107}