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