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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct GetPackageVersionOutput {
    /// <p>The ARN for the package version.</p>
    pub package_version_arn: ::std::option::Option<::std::string::String>,
    /// <p>The name of the software package.</p>
    pub package_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the package version.</p>
    pub version_name: ::std::option::Option<::std::string::String>,
    /// <p>The package version description.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>Metadata that were added to the package version that can be used to define a package version’s configuration.</p>
    pub attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>The status associated to the package version. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/preparing-to-use-software-package-catalog.html#package-version-lifecycle">Package version lifecycle</a>.</p>
    pub status: ::std::option::Option<crate::types::PackageVersionStatus>,
    /// <p>Error reason for a package version failure during creation or update.</p>
    pub error_reason: ::std::option::Option<::std::string::String>,
    /// <p>The date when the package version was created.</p>
    pub creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The date when the package version was last updated.</p>
    pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetPackageVersionOutput {
    /// <p>The ARN for the package version.</p>
    pub fn package_version_arn(&self) -> ::std::option::Option<&str> {
        self.package_version_arn.as_deref()
    }
    /// <p>The name of the software package.</p>
    pub fn package_name(&self) -> ::std::option::Option<&str> {
        self.package_name.as_deref()
    }
    /// <p>The name of the package version.</p>
    pub fn version_name(&self) -> ::std::option::Option<&str> {
        self.version_name.as_deref()
    }
    /// <p>The package version description.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>Metadata that were added to the package version that can be used to define a package version’s configuration.</p>
    pub fn attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.attributes.as_ref()
    }
    /// <p>The status associated to the package version. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/preparing-to-use-software-package-catalog.html#package-version-lifecycle">Package version lifecycle</a>.</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::PackageVersionStatus> {
        self.status.as_ref()
    }
    /// <p>Error reason for a package version failure during creation or update.</p>
    pub fn error_reason(&self) -> ::std::option::Option<&str> {
        self.error_reason.as_deref()
    }
    /// <p>The date when the package version was created.</p>
    pub fn creation_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.creation_date.as_ref()
    }
    /// <p>The date when the package version was last updated.</p>
    pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_modified_date.as_ref()
    }
}
impl ::std::fmt::Debug for GetPackageVersionOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetPackageVersionOutput");
        formatter.field("package_version_arn", &self.package_version_arn);
        formatter.field("package_name", &self.package_name);
        formatter.field("version_name", &self.version_name);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("attributes", &"*** Sensitive Data Redacted ***");
        formatter.field("status", &self.status);
        formatter.field("error_reason", &self.error_reason);
        formatter.field("creation_date", &self.creation_date);
        formatter.field("last_modified_date", &self.last_modified_date);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for GetPackageVersionOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetPackageVersionOutput {
    /// Creates a new builder-style object to manufacture [`GetPackageVersionOutput`](crate::operation::get_package_version::GetPackageVersionOutput).
    pub fn builder() -> crate::operation::get_package_version::builders::GetPackageVersionOutputBuilder {
        crate::operation::get_package_version::builders::GetPackageVersionOutputBuilder::default()
    }
}

/// A builder for [`GetPackageVersionOutput`](crate::operation::get_package_version::GetPackageVersionOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct GetPackageVersionOutputBuilder {
    pub(crate) package_version_arn: ::std::option::Option<::std::string::String>,
    pub(crate) package_name: ::std::option::Option<::std::string::String>,
    pub(crate) version_name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) status: ::std::option::Option<crate::types::PackageVersionStatus>,
    pub(crate) error_reason: ::std::option::Option<::std::string::String>,
    pub(crate) creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetPackageVersionOutputBuilder {
    /// <p>The ARN for the package version.</p>
    pub fn package_version_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.package_version_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN for the package version.</p>
    pub fn set_package_version_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.package_version_arn = input;
        self
    }
    /// <p>The ARN for the package version.</p>
    pub fn get_package_version_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.package_version_arn
    }
    /// <p>The name of the software package.</p>
    pub fn package_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.package_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the software package.</p>
    pub fn set_package_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.package_name = input;
        self
    }
    /// <p>The name of the software package.</p>
    pub fn get_package_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.package_name
    }
    /// <p>The name of the package version.</p>
    pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.version_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the package version.</p>
    pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.version_name = input;
        self
    }
    /// <p>The name of the package version.</p>
    pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.version_name
    }
    /// <p>The package version description.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The package version description.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The package version description.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// Adds a key-value pair to `attributes`.
    ///
    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
    ///
    /// <p>Metadata that were added to the package version that can be used to define a package version’s configuration.</p>
    pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.attributes.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.attributes = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>Metadata that were added to the package version that can be used to define a package version’s configuration.</p>
    pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.attributes = input;
        self
    }
    /// <p>Metadata that were added to the package version that can be used to define a package version’s configuration.</p>
    pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.attributes
    }
    /// <p>The status associated to the package version. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/preparing-to-use-software-package-catalog.html#package-version-lifecycle">Package version lifecycle</a>.</p>
    pub fn status(mut self, input: crate::types::PackageVersionStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status associated to the package version. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/preparing-to-use-software-package-catalog.html#package-version-lifecycle">Package version lifecycle</a>.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::PackageVersionStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status associated to the package version. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/preparing-to-use-software-package-catalog.html#package-version-lifecycle">Package version lifecycle</a>.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::PackageVersionStatus> {
        &self.status
    }
    /// <p>Error reason for a package version failure during creation or update.</p>
    pub fn error_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.error_reason = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Error reason for a package version failure during creation or update.</p>
    pub fn set_error_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.error_reason = input;
        self
    }
    /// <p>Error reason for a package version failure during creation or update.</p>
    pub fn get_error_reason(&self) -> &::std::option::Option<::std::string::String> {
        &self.error_reason
    }
    /// <p>The date when the package version was created.</p>
    pub fn creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date when the package version was created.</p>
    pub fn set_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_date = input;
        self
    }
    /// <p>The date when the package version was created.</p>
    pub fn get_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_date
    }
    /// <p>The date when the package version was last updated.</p>
    pub fn last_modified_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_modified_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date when the package version was last updated.</p>
    pub fn set_last_modified_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_modified_date = input;
        self
    }
    /// <p>The date when the package version was last updated.</p>
    pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_modified_date
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetPackageVersionOutput`](crate::operation::get_package_version::GetPackageVersionOutput).
    pub fn build(self) -> crate::operation::get_package_version::GetPackageVersionOutput {
        crate::operation::get_package_version::GetPackageVersionOutput {
            package_version_arn: self.package_version_arn,
            package_name: self.package_name,
            version_name: self.version_name,
            description: self.description,
            attributes: self.attributes,
            status: self.status,
            error_reason: self.error_reason,
            creation_date: self.creation_date,
            last_modified_date: self.last_modified_date,
            _request_id: self._request_id,
        }
    }
}
impl ::std::fmt::Debug for GetPackageVersionOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetPackageVersionOutputBuilder");
        formatter.field("package_version_arn", &self.package_version_arn);
        formatter.field("package_name", &self.package_name);
        formatter.field("version_name", &self.version_name);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("attributes", &"*** Sensitive Data Redacted ***");
        formatter.field("status", &self.status);
        formatter.field("error_reason", &self.error_reason);
        formatter.field("creation_date", &self.creation_date);
        formatter.field("last_modified_date", &self.last_modified_date);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}