aws_sdk_dynamodb/operation/describe_table/
_describe_table_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the input of a <code>DescribeTable</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribeTableInput  {
7    /// <p>The name of the table to describe. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
8    pub table_name: ::std::option::Option<::std::string::String>,
9}
10impl  DescribeTableInput  {
11    /// <p>The name of the table to describe. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
12    pub fn table_name(&self) -> ::std::option::Option<&str> {
13        self.table_name.as_deref()
14    }
15}
16static DESCRIBETABLEINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.dynamodb.synthetic#DescribeTableInput", "com.amazonaws.dynamodb.synthetic", "DescribeTableInput");
17static DESCRIBETABLEINPUT_MEMBER_TABLE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
18                            ::aws_smithy_schema::ShapeId::from_static(
19                                "com.amazonaws.dynamodb.synthetic#DescribeTableInput$TableName",
20                                "com.amazonaws.dynamodb.synthetic",
21                                "DescribeTableInput",
22                            ),
23                            ::aws_smithy_schema::ShapeType::String,
24                            "TableName",
25                            0,
26                        );
27static DESCRIBETABLEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
28                            DESCRIBETABLEINPUT_SCHEMA_ID,
29                            ::aws_smithy_schema::ShapeType::Structure,
30                            &[&DESCRIBETABLEINPUT_MEMBER_TABLE_NAME],
31                        );
32impl DescribeTableInput {
33                /// The schema for this shape.
34                pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &DESCRIBETABLEINPUT_SCHEMA;
35            }
36impl ::aws_smithy_schema::serde::SerializableStruct for DescribeTableInput {
37                #[allow(unused_variables, clippy::diverging_sub_expression)]
38                fn serialize_members(&self, ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
39                    if let Some(ref val) = self.table_name {
40                                ser.write_string(&DESCRIBETABLEINPUT_MEMBER_TABLE_NAME, val)?;
41                            }
42                    Ok(())
43                }
44            }
45impl DescribeTableInput {
46                /// Deserializes this structure from a [`ShapeDeserializer`].
47                pub fn deserialize(deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
48                    #[allow(unused_variables, unused_mut)]
49                    let mut builder = Self::builder();
50                    #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
51                    deserializer.read_struct(&DESCRIBETABLEINPUT_SCHEMA, &mut |member, deser| {
52                        match member.member_index() {
53                            Some(0) => {
54                                    builder.table_name = Some(deser.read_string(member)?);
55                                }
56                            _ => {}
57                        }
58                        Ok(())
59                    })?;
60                    builder.table_name = builder.table_name.or(Some(String::new()));
61builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
62                }
63            }
64impl DescribeTableInput {
65                        /// Deserializes this structure from a body deserializer and HTTP response.
66                        pub fn deserialize_with_response(
67                            deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
68                            _headers: &::aws_smithy_runtime_api::http::Headers,
69                            _status: u16,
70                            _body: &[u8],
71                        ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
72                            Self::deserialize(deserializer)
73                        }
74                    }
75impl DescribeTableInput {
76    /// Creates a new builder-style object to manufacture [`DescribeTableInput`](crate::operation::describe_table::DescribeTableInput).
77    pub fn builder() -> crate::operation::describe_table::builders::DescribeTableInputBuilder {
78        crate::operation::describe_table::builders::DescribeTableInputBuilder::default()
79    }
80}
81
82/// A builder for [`DescribeTableInput`](crate::operation::describe_table::DescribeTableInput).
83#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
84#[non_exhaustive]
85pub struct DescribeTableInputBuilder {
86    pub(crate) table_name: ::std::option::Option<::std::string::String>,
87}
88impl DescribeTableInputBuilder {
89    /// <p>The name of the table to describe. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
90    /// This field is required.
91    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.table_name = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// <p>The name of the table to describe. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
96    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.table_name = input; self
98    }
99    /// <p>The name of the table to describe. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
100    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
101        &self.table_name
102    }
103    /// Consumes the builder and constructs a [`DescribeTableInput`](crate::operation::describe_table::DescribeTableInput).
104    pub fn build(self) -> ::std::result::Result<crate::operation::describe_table::DescribeTableInput, ::aws_smithy_types::error::operation::BuildError> {
105        ::std::result::Result::Ok(
106            crate::operation::describe_table::DescribeTableInput {
107                table_name: self.table_name
108                ,
109            }
110        )
111    }
112}
113