1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// Object
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct BackupObject {
    /// Object name
    pub name: ::std::string::String,
    /// Number of chunks in object
    pub chunks_count: ::std::option::Option<i64>,
    /// Metadata string associated with the Object
    pub metadata_string: ::std::option::Option<::std::string::String>,
    /// Object checksum
    pub object_checksum: ::std::string::String,
    /// Checksum algorithm
    pub object_checksum_algorithm: crate::types::SummaryChecksumAlgorithm,
    /// Object token
    pub object_token: ::std::string::String,
}
impl BackupObject {
    /// Object name
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// Number of chunks in object
    pub fn chunks_count(&self) -> ::std::option::Option<i64> {
        self.chunks_count
    }
    /// Metadata string associated with the Object
    pub fn metadata_string(&self) -> ::std::option::Option<&str> {
        self.metadata_string.as_deref()
    }
    /// Object checksum
    pub fn object_checksum(&self) -> &str {
        use std::ops::Deref;
        self.object_checksum.deref()
    }
    /// Checksum algorithm
    pub fn object_checksum_algorithm(&self) -> &crate::types::SummaryChecksumAlgorithm {
        &self.object_checksum_algorithm
    }
    /// Object token
    pub fn object_token(&self) -> &str {
        use std::ops::Deref;
        self.object_token.deref()
    }
}
impl BackupObject {
    /// Creates a new builder-style object to manufacture [`BackupObject`](crate::types::BackupObject).
    pub fn builder() -> crate::types::builders::BackupObjectBuilder {
        crate::types::builders::BackupObjectBuilder::default()
    }
}

/// A builder for [`BackupObject`](crate::types::BackupObject).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct BackupObjectBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) chunks_count: ::std::option::Option<i64>,
    pub(crate) metadata_string: ::std::option::Option<::std::string::String>,
    pub(crate) object_checksum: ::std::option::Option<::std::string::String>,
    pub(crate) object_checksum_algorithm: ::std::option::Option<crate::types::SummaryChecksumAlgorithm>,
    pub(crate) object_token: ::std::option::Option<::std::string::String>,
}
impl BackupObjectBuilder {
    /// Object name
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// Object name
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// Object name
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// Number of chunks in object
    pub fn chunks_count(mut self, input: i64) -> Self {
        self.chunks_count = ::std::option::Option::Some(input);
        self
    }
    /// Number of chunks in object
    pub fn set_chunks_count(mut self, input: ::std::option::Option<i64>) -> Self {
        self.chunks_count = input;
        self
    }
    /// Number of chunks in object
    pub fn get_chunks_count(&self) -> &::std::option::Option<i64> {
        &self.chunks_count
    }
    /// Metadata string associated with the Object
    pub fn metadata_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.metadata_string = ::std::option::Option::Some(input.into());
        self
    }
    /// Metadata string associated with the Object
    pub fn set_metadata_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.metadata_string = input;
        self
    }
    /// Metadata string associated with the Object
    pub fn get_metadata_string(&self) -> &::std::option::Option<::std::string::String> {
        &self.metadata_string
    }
    /// Object checksum
    /// This field is required.
    pub fn object_checksum(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.object_checksum = ::std::option::Option::Some(input.into());
        self
    }
    /// Object checksum
    pub fn set_object_checksum(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.object_checksum = input;
        self
    }
    /// Object checksum
    pub fn get_object_checksum(&self) -> &::std::option::Option<::std::string::String> {
        &self.object_checksum
    }
    /// Checksum algorithm
    /// This field is required.
    pub fn object_checksum_algorithm(mut self, input: crate::types::SummaryChecksumAlgorithm) -> Self {
        self.object_checksum_algorithm = ::std::option::Option::Some(input);
        self
    }
    /// Checksum algorithm
    pub fn set_object_checksum_algorithm(mut self, input: ::std::option::Option<crate::types::SummaryChecksumAlgorithm>) -> Self {
        self.object_checksum_algorithm = input;
        self
    }
    /// Checksum algorithm
    pub fn get_object_checksum_algorithm(&self) -> &::std::option::Option<crate::types::SummaryChecksumAlgorithm> {
        &self.object_checksum_algorithm
    }
    /// Object token
    /// This field is required.
    pub fn object_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.object_token = ::std::option::Option::Some(input.into());
        self
    }
    /// Object token
    pub fn set_object_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.object_token = input;
        self
    }
    /// Object token
    pub fn get_object_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.object_token
    }
    /// Consumes the builder and constructs a [`BackupObject`](crate::types::BackupObject).
    /// This method will fail if any of the following fields are not set:
    /// - [`name`](crate::types::builders::BackupObjectBuilder::name)
    /// - [`object_checksum`](crate::types::builders::BackupObjectBuilder::object_checksum)
    /// - [`object_checksum_algorithm`](crate::types::builders::BackupObjectBuilder::object_checksum_algorithm)
    /// - [`object_token`](crate::types::builders::BackupObjectBuilder::object_token)
    pub fn build(self) -> ::std::result::Result<crate::types::BackupObject, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::BackupObject {
            name: self.name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "name",
                    "name was not specified but it is required when building BackupObject",
                )
            })?,
            chunks_count: self.chunks_count,
            metadata_string: self.metadata_string,
            object_checksum: self.object_checksum.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "object_checksum",
                    "object_checksum was not specified but it is required when building BackupObject",
                )
            })?,
            object_checksum_algorithm: self.object_checksum_algorithm.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "object_checksum_algorithm",
                    "object_checksum_algorithm was not specified but it is required when building BackupObject",
                )
            })?,
            object_token: self.object_token.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "object_token",
                    "object_token was not specified but it is required when building BackupObject",
                )
            })?,
        })
    }
}