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