aws_sdk_ssm/operation/get_document/_get_document_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 GetDocumentOutput {
6 /// <p>The name of the SSM document.</p>
7 pub name: ::std::option::Option<::std::string::String>,
8 /// <p>The date the SSM document was created.</p>
9 pub created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
10 /// <p>The friendly name of the SSM document. This value can differ for each version of the document. If you want to update this value, see <code>UpdateDocument</code>.</p>
11 pub display_name: ::std::option::Option<::std::string::String>,
12 /// <p>The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
13 pub version_name: ::std::option::Option<::std::string::String>,
14 /// <p>The document version.</p>
15 pub document_version: ::std::option::Option<::std::string::String>,
16 /// <p>The status of the SSM document, such as <code>Creating</code>, <code>Active</code>, <code>Updating</code>, <code>Failed</code>, and <code>Deleting</code>.</p>
17 pub status: ::std::option::Option<crate::types::DocumentStatus>,
18 /// <p>A message returned by Amazon Web Services Systems Manager that explains the <code>Status</code> value. For example, a <code>Failed</code> status might be explained by the <code>StatusInformation</code> message, "The specified S3 bucket doesn't exist. Verify that the URL of the S3 bucket is correct."</p>
19 pub status_information: ::std::option::Option<::std::string::String>,
20 /// <p>The contents of the SSM document.</p>
21 pub content: ::std::option::Option<::std::string::String>,
22 /// <p>The document type.</p>
23 pub document_type: ::std::option::Option<crate::types::DocumentType>,
24 /// <p>The document format, either JSON or YAML.</p>
25 pub document_format: ::std::option::Option<crate::types::DocumentFormat>,
26 /// <p>A list of SSM documents required by a document. For example, an <code>ApplicationConfiguration</code> document requires an <code>ApplicationConfigurationSchema</code> document.</p>
27 pub requires: ::std::option::Option<::std::vec::Vec<crate::types::DocumentRequires>>,
28 /// <p>A description of the document attachments, including names, locations, sizes, and so on.</p>
29 pub attachments_content: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentContent>>,
30 /// <p>The current review status of a new custom Systems Manager document (SSM document) created by a member of your organization, or of the latest version of an existing SSM document.</p>
31 /// <p>Only one version of an SSM document can be in the APPROVED state at a time. When a new version is approved, the status of the previous version changes to REJECTED.</p>
32 /// <p>Only one version of an SSM document can be in review, or PENDING, at a time.</p>
33 pub review_status: ::std::option::Option<crate::types::ReviewStatus>,
34 _request_id: Option<String>,
35}
36impl GetDocumentOutput {
37 /// <p>The name of the SSM document.</p>
38 pub fn name(&self) -> ::std::option::Option<&str> {
39 self.name.as_deref()
40 }
41 /// <p>The date the SSM document was created.</p>
42 pub fn created_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
43 self.created_date.as_ref()
44 }
45 /// <p>The friendly name of the SSM document. This value can differ for each version of the document. If you want to update this value, see <code>UpdateDocument</code>.</p>
46 pub fn display_name(&self) -> ::std::option::Option<&str> {
47 self.display_name.as_deref()
48 }
49 /// <p>The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
50 pub fn version_name(&self) -> ::std::option::Option<&str> {
51 self.version_name.as_deref()
52 }
53 /// <p>The document version.</p>
54 pub fn document_version(&self) -> ::std::option::Option<&str> {
55 self.document_version.as_deref()
56 }
57 /// <p>The status of the SSM document, such as <code>Creating</code>, <code>Active</code>, <code>Updating</code>, <code>Failed</code>, and <code>Deleting</code>.</p>
58 pub fn status(&self) -> ::std::option::Option<&crate::types::DocumentStatus> {
59 self.status.as_ref()
60 }
61 /// <p>A message returned by Amazon Web Services Systems Manager that explains the <code>Status</code> value. For example, a <code>Failed</code> status might be explained by the <code>StatusInformation</code> message, "The specified S3 bucket doesn't exist. Verify that the URL of the S3 bucket is correct."</p>
62 pub fn status_information(&self) -> ::std::option::Option<&str> {
63 self.status_information.as_deref()
64 }
65 /// <p>The contents of the SSM document.</p>
66 pub fn content(&self) -> ::std::option::Option<&str> {
67 self.content.as_deref()
68 }
69 /// <p>The document type.</p>
70 pub fn document_type(&self) -> ::std::option::Option<&crate::types::DocumentType> {
71 self.document_type.as_ref()
72 }
73 /// <p>The document format, either JSON or YAML.</p>
74 pub fn document_format(&self) -> ::std::option::Option<&crate::types::DocumentFormat> {
75 self.document_format.as_ref()
76 }
77 /// <p>A list of SSM documents required by a document. For example, an <code>ApplicationConfiguration</code> document requires an <code>ApplicationConfigurationSchema</code> document.</p>
78 ///
79 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.requires.is_none()`.
80 pub fn requires(&self) -> &[crate::types::DocumentRequires] {
81 self.requires.as_deref().unwrap_or_default()
82 }
83 /// <p>A description of the document attachments, including names, locations, sizes, and so on.</p>
84 ///
85 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.attachments_content.is_none()`.
86 pub fn attachments_content(&self) -> &[crate::types::AttachmentContent] {
87 self.attachments_content.as_deref().unwrap_or_default()
88 }
89 /// <p>The current review status of a new custom Systems Manager document (SSM document) created by a member of your organization, or of the latest version of an existing SSM document.</p>
90 /// <p>Only one version of an SSM document can be in the APPROVED state at a time. When a new version is approved, the status of the previous version changes to REJECTED.</p>
91 /// <p>Only one version of an SSM document can be in review, or PENDING, at a time.</p>
92 pub fn review_status(&self) -> ::std::option::Option<&crate::types::ReviewStatus> {
93 self.review_status.as_ref()
94 }
95}
96impl ::aws_types::request_id::RequestId for GetDocumentOutput {
97 fn request_id(&self) -> Option<&str> {
98 self._request_id.as_deref()
99 }
100}
101impl GetDocumentOutput {
102 /// Creates a new builder-style object to manufacture [`GetDocumentOutput`](crate::operation::get_document::GetDocumentOutput).
103 pub fn builder() -> crate::operation::get_document::builders::GetDocumentOutputBuilder {
104 crate::operation::get_document::builders::GetDocumentOutputBuilder::default()
105 }
106}
107
108/// A builder for [`GetDocumentOutput`](crate::operation::get_document::GetDocumentOutput).
109#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
110#[non_exhaustive]
111pub struct GetDocumentOutputBuilder {
112 pub(crate) name: ::std::option::Option<::std::string::String>,
113 pub(crate) created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
114 pub(crate) display_name: ::std::option::Option<::std::string::String>,
115 pub(crate) version_name: ::std::option::Option<::std::string::String>,
116 pub(crate) document_version: ::std::option::Option<::std::string::String>,
117 pub(crate) status: ::std::option::Option<crate::types::DocumentStatus>,
118 pub(crate) status_information: ::std::option::Option<::std::string::String>,
119 pub(crate) content: ::std::option::Option<::std::string::String>,
120 pub(crate) document_type: ::std::option::Option<crate::types::DocumentType>,
121 pub(crate) document_format: ::std::option::Option<crate::types::DocumentFormat>,
122 pub(crate) requires: ::std::option::Option<::std::vec::Vec<crate::types::DocumentRequires>>,
123 pub(crate) attachments_content: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentContent>>,
124 pub(crate) review_status: ::std::option::Option<crate::types::ReviewStatus>,
125 _request_id: Option<String>,
126}
127impl GetDocumentOutputBuilder {
128 /// <p>The name of the SSM document.</p>
129 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130 self.name = ::std::option::Option::Some(input.into());
131 self
132 }
133 /// <p>The name of the SSM document.</p>
134 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.name = input;
136 self
137 }
138 /// <p>The name of the SSM document.</p>
139 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
140 &self.name
141 }
142 /// <p>The date the SSM document was created.</p>
143 pub fn created_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
144 self.created_date = ::std::option::Option::Some(input);
145 self
146 }
147 /// <p>The date the SSM document was created.</p>
148 pub fn set_created_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
149 self.created_date = input;
150 self
151 }
152 /// <p>The date the SSM document was created.</p>
153 pub fn get_created_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
154 &self.created_date
155 }
156 /// <p>The friendly name of the SSM document. This value can differ for each version of the document. If you want to update this value, see <code>UpdateDocument</code>.</p>
157 pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158 self.display_name = ::std::option::Option::Some(input.into());
159 self
160 }
161 /// <p>The friendly name of the SSM document. This value can differ for each version of the document. If you want to update this value, see <code>UpdateDocument</code>.</p>
162 pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163 self.display_name = input;
164 self
165 }
166 /// <p>The friendly name of the SSM document. This value can differ for each version of the document. If you want to update this value, see <code>UpdateDocument</code>.</p>
167 pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
168 &self.display_name
169 }
170 /// <p>The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
171 pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172 self.version_name = ::std::option::Option::Some(input.into());
173 self
174 }
175 /// <p>The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
176 pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177 self.version_name = input;
178 self
179 }
180 /// <p>The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
181 pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> {
182 &self.version_name
183 }
184 /// <p>The document version.</p>
185 pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186 self.document_version = ::std::option::Option::Some(input.into());
187 self
188 }
189 /// <p>The document version.</p>
190 pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191 self.document_version = input;
192 self
193 }
194 /// <p>The document version.</p>
195 pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
196 &self.document_version
197 }
198 /// <p>The status of the SSM document, such as <code>Creating</code>, <code>Active</code>, <code>Updating</code>, <code>Failed</code>, and <code>Deleting</code>.</p>
199 pub fn status(mut self, input: crate::types::DocumentStatus) -> Self {
200 self.status = ::std::option::Option::Some(input);
201 self
202 }
203 /// <p>The status of the SSM document, such as <code>Creating</code>, <code>Active</code>, <code>Updating</code>, <code>Failed</code>, and <code>Deleting</code>.</p>
204 pub fn set_status(mut self, input: ::std::option::Option<crate::types::DocumentStatus>) -> Self {
205 self.status = input;
206 self
207 }
208 /// <p>The status of the SSM document, such as <code>Creating</code>, <code>Active</code>, <code>Updating</code>, <code>Failed</code>, and <code>Deleting</code>.</p>
209 pub fn get_status(&self) -> &::std::option::Option<crate::types::DocumentStatus> {
210 &self.status
211 }
212 /// <p>A message returned by Amazon Web Services Systems Manager that explains the <code>Status</code> value. For example, a <code>Failed</code> status might be explained by the <code>StatusInformation</code> message, "The specified S3 bucket doesn't exist. Verify that the URL of the S3 bucket is correct."</p>
213 pub fn status_information(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214 self.status_information = ::std::option::Option::Some(input.into());
215 self
216 }
217 /// <p>A message returned by Amazon Web Services Systems Manager that explains the <code>Status</code> value. For example, a <code>Failed</code> status might be explained by the <code>StatusInformation</code> message, "The specified S3 bucket doesn't exist. Verify that the URL of the S3 bucket is correct."</p>
218 pub fn set_status_information(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
219 self.status_information = input;
220 self
221 }
222 /// <p>A message returned by Amazon Web Services Systems Manager that explains the <code>Status</code> value. For example, a <code>Failed</code> status might be explained by the <code>StatusInformation</code> message, "The specified S3 bucket doesn't exist. Verify that the URL of the S3 bucket is correct."</p>
223 pub fn get_status_information(&self) -> &::std::option::Option<::std::string::String> {
224 &self.status_information
225 }
226 /// <p>The contents of the SSM document.</p>
227 pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
228 self.content = ::std::option::Option::Some(input.into());
229 self
230 }
231 /// <p>The contents of the SSM document.</p>
232 pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
233 self.content = input;
234 self
235 }
236 /// <p>The contents of the SSM document.</p>
237 pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
238 &self.content
239 }
240 /// <p>The document type.</p>
241 pub fn document_type(mut self, input: crate::types::DocumentType) -> Self {
242 self.document_type = ::std::option::Option::Some(input);
243 self
244 }
245 /// <p>The document type.</p>
246 pub fn set_document_type(mut self, input: ::std::option::Option<crate::types::DocumentType>) -> Self {
247 self.document_type = input;
248 self
249 }
250 /// <p>The document type.</p>
251 pub fn get_document_type(&self) -> &::std::option::Option<crate::types::DocumentType> {
252 &self.document_type
253 }
254 /// <p>The document format, either JSON or YAML.</p>
255 pub fn document_format(mut self, input: crate::types::DocumentFormat) -> Self {
256 self.document_format = ::std::option::Option::Some(input);
257 self
258 }
259 /// <p>The document format, either JSON or YAML.</p>
260 pub fn set_document_format(mut self, input: ::std::option::Option<crate::types::DocumentFormat>) -> Self {
261 self.document_format = input;
262 self
263 }
264 /// <p>The document format, either JSON or YAML.</p>
265 pub fn get_document_format(&self) -> &::std::option::Option<crate::types::DocumentFormat> {
266 &self.document_format
267 }
268 /// Appends an item to `requires`.
269 ///
270 /// To override the contents of this collection use [`set_requires`](Self::set_requires).
271 ///
272 /// <p>A list of SSM documents required by a document. For example, an <code>ApplicationConfiguration</code> document requires an <code>ApplicationConfigurationSchema</code> document.</p>
273 pub fn requires(mut self, input: crate::types::DocumentRequires) -> Self {
274 let mut v = self.requires.unwrap_or_default();
275 v.push(input);
276 self.requires = ::std::option::Option::Some(v);
277 self
278 }
279 /// <p>A list of SSM documents required by a document. For example, an <code>ApplicationConfiguration</code> document requires an <code>ApplicationConfigurationSchema</code> document.</p>
280 pub fn set_requires(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DocumentRequires>>) -> Self {
281 self.requires = input;
282 self
283 }
284 /// <p>A list of SSM documents required by a document. For example, an <code>ApplicationConfiguration</code> document requires an <code>ApplicationConfigurationSchema</code> document.</p>
285 pub fn get_requires(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DocumentRequires>> {
286 &self.requires
287 }
288 /// Appends an item to `attachments_content`.
289 ///
290 /// To override the contents of this collection use [`set_attachments_content`](Self::set_attachments_content).
291 ///
292 /// <p>A description of the document attachments, including names, locations, sizes, and so on.</p>
293 pub fn attachments_content(mut self, input: crate::types::AttachmentContent) -> Self {
294 let mut v = self.attachments_content.unwrap_or_default();
295 v.push(input);
296 self.attachments_content = ::std::option::Option::Some(v);
297 self
298 }
299 /// <p>A description of the document attachments, including names, locations, sizes, and so on.</p>
300 pub fn set_attachments_content(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentContent>>) -> Self {
301 self.attachments_content = input;
302 self
303 }
304 /// <p>A description of the document attachments, including names, locations, sizes, and so on.</p>
305 pub fn get_attachments_content(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AttachmentContent>> {
306 &self.attachments_content
307 }
308 /// <p>The current review status of a new custom Systems Manager document (SSM document) created by a member of your organization, or of the latest version of an existing SSM document.</p>
309 /// <p>Only one version of an SSM document can be in the APPROVED state at a time. When a new version is approved, the status of the previous version changes to REJECTED.</p>
310 /// <p>Only one version of an SSM document can be in review, or PENDING, at a time.</p>
311 pub fn review_status(mut self, input: crate::types::ReviewStatus) -> Self {
312 self.review_status = ::std::option::Option::Some(input);
313 self
314 }
315 /// <p>The current review status of a new custom Systems Manager document (SSM document) created by a member of your organization, or of the latest version of an existing SSM document.</p>
316 /// <p>Only one version of an SSM document can be in the APPROVED state at a time. When a new version is approved, the status of the previous version changes to REJECTED.</p>
317 /// <p>Only one version of an SSM document can be in review, or PENDING, at a time.</p>
318 pub fn set_review_status(mut self, input: ::std::option::Option<crate::types::ReviewStatus>) -> Self {
319 self.review_status = input;
320 self
321 }
322 /// <p>The current review status of a new custom Systems Manager document (SSM document) created by a member of your organization, or of the latest version of an existing SSM document.</p>
323 /// <p>Only one version of an SSM document can be in the APPROVED state at a time. When a new version is approved, the status of the previous version changes to REJECTED.</p>
324 /// <p>Only one version of an SSM document can be in review, or PENDING, at a time.</p>
325 pub fn get_review_status(&self) -> &::std::option::Option<crate::types::ReviewStatus> {
326 &self.review_status
327 }
328 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
329 self._request_id = Some(request_id.into());
330 self
331 }
332
333 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
334 self._request_id = request_id;
335 self
336 }
337 /// Consumes the builder and constructs a [`GetDocumentOutput`](crate::operation::get_document::GetDocumentOutput).
338 pub fn build(self) -> crate::operation::get_document::GetDocumentOutput {
339 crate::operation::get_document::GetDocumentOutput {
340 name: self.name,
341 created_date: self.created_date,
342 display_name: self.display_name,
343 version_name: self.version_name,
344 document_version: self.document_version,
345 status: self.status,
346 status_information: self.status_information,
347 content: self.content,
348 document_type: self.document_type,
349 document_format: self.document_format,
350 requires: self.requires,
351 attachments_content: self.attachments_content,
352 review_status: self.review_status,
353 _request_id: self._request_id,
354 }
355 }
356}