aws_sdk_redshiftdata/operation/describe_table/
_describe_table_output.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 DescribeTableOutput {
6    /// <p>The table name.</p>
7    pub table_name: ::std::option::Option<::std::string::String>,
8    /// <p>A list of columns in the table.</p>
9    pub column_list: ::std::option::Option<::std::vec::Vec<crate::types::ColumnMetadata>>,
10    /// <p>A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.</p>
11    pub next_token: ::std::option::Option<::std::string::String>,
12    _request_id: Option<String>,
13}
14impl DescribeTableOutput {
15    /// <p>The table name.</p>
16    pub fn table_name(&self) -> ::std::option::Option<&str> {
17        self.table_name.as_deref()
18    }
19    /// <p>A list of columns in the table.</p>
20    ///
21    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.column_list.is_none()`.
22    pub fn column_list(&self) -> &[crate::types::ColumnMetadata] {
23        self.column_list.as_deref().unwrap_or_default()
24    }
25    /// <p>A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.</p>
26    pub fn next_token(&self) -> ::std::option::Option<&str> {
27        self.next_token.as_deref()
28    }
29}
30impl ::aws_types::request_id::RequestId for DescribeTableOutput {
31    fn request_id(&self) -> Option<&str> {
32        self._request_id.as_deref()
33    }
34}
35impl DescribeTableOutput {
36    /// Creates a new builder-style object to manufacture [`DescribeTableOutput`](crate::operation::describe_table::DescribeTableOutput).
37    pub fn builder() -> crate::operation::describe_table::builders::DescribeTableOutputBuilder {
38        crate::operation::describe_table::builders::DescribeTableOutputBuilder::default()
39    }
40}
41
42/// A builder for [`DescribeTableOutput`](crate::operation::describe_table::DescribeTableOutput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct DescribeTableOutputBuilder {
46    pub(crate) table_name: ::std::option::Option<::std::string::String>,
47    pub(crate) column_list: ::std::option::Option<::std::vec::Vec<crate::types::ColumnMetadata>>,
48    pub(crate) next_token: ::std::option::Option<::std::string::String>,
49    _request_id: Option<String>,
50}
51impl DescribeTableOutputBuilder {
52    /// <p>The table name.</p>
53    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54        self.table_name = ::std::option::Option::Some(input.into());
55        self
56    }
57    /// <p>The table name.</p>
58    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59        self.table_name = input;
60        self
61    }
62    /// <p>The table name.</p>
63    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
64        &self.table_name
65    }
66    /// Appends an item to `column_list`.
67    ///
68    /// To override the contents of this collection use [`set_column_list`](Self::set_column_list).
69    ///
70    /// <p>A list of columns in the table.</p>
71    pub fn column_list(mut self, input: crate::types::ColumnMetadata) -> Self {
72        let mut v = self.column_list.unwrap_or_default();
73        v.push(input);
74        self.column_list = ::std::option::Option::Some(v);
75        self
76    }
77    /// <p>A list of columns in the table.</p>
78    pub fn set_column_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ColumnMetadata>>) -> Self {
79        self.column_list = input;
80        self
81    }
82    /// <p>A list of columns in the table.</p>
83    pub fn get_column_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ColumnMetadata>> {
84        &self.column_list
85    }
86    /// <p>A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.</p>
87    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88        self.next_token = ::std::option::Option::Some(input.into());
89        self
90    }
91    /// <p>A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.</p>
92    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93        self.next_token = input;
94        self
95    }
96    /// <p>A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.</p>
97    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
98        &self.next_token
99    }
100    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
101        self._request_id = Some(request_id.into());
102        self
103    }
104
105    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
106        self._request_id = request_id;
107        self
108    }
109    /// Consumes the builder and constructs a [`DescribeTableOutput`](crate::operation::describe_table::DescribeTableOutput).
110    pub fn build(self) -> crate::operation::describe_table::DescribeTableOutput {
111        crate::operation::describe_table::DescribeTableOutput {
112            table_name: self.table_name,
113            column_list: self.column_list,
114            next_token: self.next_token,
115            _request_id: self._request_id,
116        }
117    }
118}