aws_sdk_dynamodb/operation/create_table/
_create_table_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>CreateTable</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateTableOutput  {
7    /// <p>Represents the properties of the table.</p>
8    pub table_description: ::std::option::Option<crate::types::TableDescription>,
9    _request_id: Option<String>,
10}
11impl  CreateTableOutput  {
12    /// <p>Represents the properties of the table.</p>
13    pub fn table_description(&self) -> ::std::option::Option<&crate::types::TableDescription> {
14        self.table_description.as_ref()
15    }
16}
17static CREATETABLEOUTPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.dynamodb.synthetic#CreateTableOutput", "com.amazonaws.dynamodb.synthetic", "CreateTableOutput");
18static CREATETABLEOUTPUT_MEMBER_TABLE_DESCRIPTION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
19                            ::aws_smithy_schema::ShapeId::from_static(
20                                "com.amazonaws.dynamodb.synthetic#CreateTableOutput$TableDescription",
21                                "com.amazonaws.dynamodb.synthetic",
22                                "CreateTableOutput",
23                            ),
24                            ::aws_smithy_schema::ShapeType::Structure,
25                            "TableDescription",
26                            0,
27                        );
28static CREATETABLEOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
29                            ::aws_smithy_schema::ShapeId::from_static(
30                                "synthetic#request_id",
31                                "synthetic",
32                                "request_id",
33                            ),
34                            ::aws_smithy_schema::ShapeType::String,
35                            "request_id",
36                            1,
37                        ).with_http_header("x-amzn-requestid");
38static CREATETABLEOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
39                            CREATETABLEOUTPUT_SCHEMA_ID,
40                            ::aws_smithy_schema::ShapeType::Structure,
41                            &[&CREATETABLEOUTPUT_MEMBER_TABLE_DESCRIPTION, &CREATETABLEOUTPUT_MEMBER__REQUEST_ID],
42                        );
43impl CreateTableOutput {
44                /// The schema for this shape.
45                pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CREATETABLEOUTPUT_SCHEMA;
46            }
47impl ::aws_smithy_schema::serde::SerializableStruct for CreateTableOutput {
48                #[allow(unused_variables, clippy::diverging_sub_expression)]
49                fn serialize_members(&self, ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
50                    if let Some(ref val) = self.table_description {
51                                ser.write_struct(&CREATETABLEOUTPUT_MEMBER_TABLE_DESCRIPTION, val)?;
52                            }
53                    Ok(())
54                }
55            }
56impl CreateTableOutput {
57                /// Deserializes this structure from a [`ShapeDeserializer`].
58                pub fn deserialize(deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
59                    #[allow(unused_variables, unused_mut)]
60                    let mut builder = Self::builder();
61                    #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
62                    deserializer.read_struct(&CREATETABLEOUTPUT_SCHEMA, &mut |member, deser| {
63                        match member.member_index() {
64                            Some(0) => {
65                                    builder.table_description = Some(crate::types::TableDescription::deserialize(deser)?);
66                                }
67Some(1) => {
68                                builder._request_id = Some(deser.read_string(member)?);
69                            }
70                            _ => {}
71                        }
72                        Ok(())
73                    })?;
74                    Ok(builder.build())
75                }
76            }
77impl CreateTableOutput {
78                /// Deserializes this structure from a body deserializer and HTTP response headers.
79                /// Header-bound members are read directly from headers, avoiding runtime
80                /// member iteration overhead. Body members are read via the deserializer.
81                pub fn deserialize_with_response(
82                    deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
83                    headers: &::aws_smithy_runtime_api::http::Headers,
84                    _status: u16,
85                    _body: &[u8],
86                ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
87                    #[allow(unused_variables, unused_mut)]
88                    let mut builder = Self::builder();
89if let Some(val) = headers.get("x-amzn-requestid") {
90                    builder._request_id = Some(val.to_string());
91                }
92#[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
93                    deserializer.read_struct(&CREATETABLEOUTPUT_SCHEMA, &mut |member, deser| {
94                        match member.member_index() {
95                            Some(0) => { builder.table_description = Some(crate::types::TableDescription::deserialize(deser)?); }
96                            _ => {}
97                        }
98                        Ok(())
99                    })?;
100                    Ok(builder.build())
101                    }
102                    }
103impl ::aws_types::request_id::RequestId for CreateTableOutput {
104                                    fn request_id(&self) -> Option<&str> {
105                                        self._request_id.as_deref()
106                                    }
107                                }
108impl CreateTableOutput {
109    /// Creates a new builder-style object to manufacture [`CreateTableOutput`](crate::operation::create_table::CreateTableOutput).
110    pub fn builder() -> crate::operation::create_table::builders::CreateTableOutputBuilder {
111        crate::operation::create_table::builders::CreateTableOutputBuilder::default()
112    }
113}
114
115/// A builder for [`CreateTableOutput`](crate::operation::create_table::CreateTableOutput).
116#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
117#[non_exhaustive]
118pub struct CreateTableOutputBuilder {
119    pub(crate) table_description: ::std::option::Option<crate::types::TableDescription>,
120    _request_id: Option<String>,
121}
122impl CreateTableOutputBuilder {
123    /// <p>Represents the properties of the table.</p>
124    pub fn table_description(mut self, input: crate::types::TableDescription) -> Self {
125        self.table_description = ::std::option::Option::Some(input);
126        self
127    }
128    /// <p>Represents the properties of the table.</p>
129    pub fn set_table_description(mut self, input: ::std::option::Option<crate::types::TableDescription>) -> Self {
130        self.table_description = input; self
131    }
132    /// <p>Represents the properties of the table.</p>
133    pub fn get_table_description(&self) -> &::std::option::Option<crate::types::TableDescription> {
134        &self.table_description
135    }
136    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
137                                        self._request_id = Some(request_id.into());
138                                        self
139                                    }
140    
141                                    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
142                                        self._request_id = request_id;
143                                        self
144                                    }
145    /// Consumes the builder and constructs a [`CreateTableOutput`](crate::operation::create_table::CreateTableOutput).
146    pub fn build(self) -> crate::operation::create_table::CreateTableOutput {
147        crate::operation::create_table::CreateTableOutput {
148            table_description: self.table_description
149            ,
150            _request_id: self._request_id,
151        }
152    }
153}
154