aws_sdk_ssm/operation/update_document/
_update_document_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 UpdateDocumentInput {
6    /// <p>A valid JSON or YAML string.</p>
7    pub content: ::std::option::Option<::std::string::String>,
8    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
9    pub attachments: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentsSource>>,
10    /// <p>The name of the SSM document that you want to update.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>The friendly name of the SSM document that you want to update. This value can differ for each version of the document. If you don't specify a value for this parameter in your request, the existing value is applied to the new document version.</p>
13    pub display_name: ::std::option::Option<::std::string::String>,
14    /// <p>An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
15    pub version_name: ::std::option::Option<::std::string::String>,
16    /// <p>The version of the document that you want to update. Currently, Systems Manager supports updating only the latest version of the document. You can specify the version number of the latest version or use the <code>$LATEST</code> variable.</p><note>
17    /// <p>If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p>
18    /// </note>
19    pub document_version: ::std::option::Option<::std::string::String>,
20    /// <p>Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.</p>
21    pub document_format: ::std::option::Option<crate::types::DocumentFormat>,
22    /// <p>Specify a new target type for the document.</p>
23    pub target_type: ::std::option::Option<::std::string::String>,
24}
25impl UpdateDocumentInput {
26    /// <p>A valid JSON or YAML string.</p>
27    pub fn content(&self) -> ::std::option::Option<&str> {
28        self.content.as_deref()
29    }
30    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
31    ///
32    /// 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.is_none()`.
33    pub fn attachments(&self) -> &[crate::types::AttachmentsSource] {
34        self.attachments.as_deref().unwrap_or_default()
35    }
36    /// <p>The name of the SSM document that you want to update.</p>
37    pub fn name(&self) -> ::std::option::Option<&str> {
38        self.name.as_deref()
39    }
40    /// <p>The friendly name of the SSM document that you want to update. This value can differ for each version of the document. If you don't specify a value for this parameter in your request, the existing value is applied to the new document version.</p>
41    pub fn display_name(&self) -> ::std::option::Option<&str> {
42        self.display_name.as_deref()
43    }
44    /// <p>An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
45    pub fn version_name(&self) -> ::std::option::Option<&str> {
46        self.version_name.as_deref()
47    }
48    /// <p>The version of the document that you want to update. Currently, Systems Manager supports updating only the latest version of the document. You can specify the version number of the latest version or use the <code>$LATEST</code> variable.</p><note>
49    /// <p>If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p>
50    /// </note>
51    pub fn document_version(&self) -> ::std::option::Option<&str> {
52        self.document_version.as_deref()
53    }
54    /// <p>Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.</p>
55    pub fn document_format(&self) -> ::std::option::Option<&crate::types::DocumentFormat> {
56        self.document_format.as_ref()
57    }
58    /// <p>Specify a new target type for the document.</p>
59    pub fn target_type(&self) -> ::std::option::Option<&str> {
60        self.target_type.as_deref()
61    }
62}
63impl UpdateDocumentInput {
64    /// Creates a new builder-style object to manufacture [`UpdateDocumentInput`](crate::operation::update_document::UpdateDocumentInput).
65    pub fn builder() -> crate::operation::update_document::builders::UpdateDocumentInputBuilder {
66        crate::operation::update_document::builders::UpdateDocumentInputBuilder::default()
67    }
68}
69
70/// A builder for [`UpdateDocumentInput`](crate::operation::update_document::UpdateDocumentInput).
71#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
72#[non_exhaustive]
73pub struct UpdateDocumentInputBuilder {
74    pub(crate) content: ::std::option::Option<::std::string::String>,
75    pub(crate) attachments: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentsSource>>,
76    pub(crate) name: ::std::option::Option<::std::string::String>,
77    pub(crate) display_name: ::std::option::Option<::std::string::String>,
78    pub(crate) version_name: ::std::option::Option<::std::string::String>,
79    pub(crate) document_version: ::std::option::Option<::std::string::String>,
80    pub(crate) document_format: ::std::option::Option<crate::types::DocumentFormat>,
81    pub(crate) target_type: ::std::option::Option<::std::string::String>,
82}
83impl UpdateDocumentInputBuilder {
84    /// <p>A valid JSON or YAML string.</p>
85    /// This field is required.
86    pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87        self.content = ::std::option::Option::Some(input.into());
88        self
89    }
90    /// <p>A valid JSON or YAML string.</p>
91    pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92        self.content = input;
93        self
94    }
95    /// <p>A valid JSON or YAML string.</p>
96    pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
97        &self.content
98    }
99    /// Appends an item to `attachments`.
100    ///
101    /// To override the contents of this collection use [`set_attachments`](Self::set_attachments).
102    ///
103    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
104    pub fn attachments(mut self, input: crate::types::AttachmentsSource) -> Self {
105        let mut v = self.attachments.unwrap_or_default();
106        v.push(input);
107        self.attachments = ::std::option::Option::Some(v);
108        self
109    }
110    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
111    pub fn set_attachments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentsSource>>) -> Self {
112        self.attachments = input;
113        self
114    }
115    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
116    pub fn get_attachments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AttachmentsSource>> {
117        &self.attachments
118    }
119    /// <p>The name of the SSM document that you want to update.</p>
120    /// This field is required.
121    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.name = ::std::option::Option::Some(input.into());
123        self
124    }
125    /// <p>The name of the SSM document that you want to update.</p>
126    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.name = input;
128        self
129    }
130    /// <p>The name of the SSM document that you want to update.</p>
131    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
132        &self.name
133    }
134    /// <p>The friendly name of the SSM document that you want to update. This value can differ for each version of the document. If you don't specify a value for this parameter in your request, the existing value is applied to the new document version.</p>
135    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.display_name = ::std::option::Option::Some(input.into());
137        self
138    }
139    /// <p>The friendly name of the SSM document that you want to update. This value can differ for each version of the document. If you don't specify a value for this parameter in your request, the existing value is applied to the new document version.</p>
140    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.display_name = input;
142        self
143    }
144    /// <p>The friendly name of the SSM document that you want to update. This value can differ for each version of the document. If you don't specify a value for this parameter in your request, the existing value is applied to the new document version.</p>
145    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
146        &self.display_name
147    }
148    /// <p>An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
149    pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.version_name = ::std::option::Option::Some(input.into());
151        self
152    }
153    /// <p>An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
154    pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.version_name = input;
156        self
157    }
158    /// <p>An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
159    pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> {
160        &self.version_name
161    }
162    /// <p>The version of the document that you want to update. Currently, Systems Manager supports updating only the latest version of the document. You can specify the version number of the latest version or use the <code>$LATEST</code> variable.</p><note>
163    /// <p>If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p>
164    /// </note>
165    pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166        self.document_version = ::std::option::Option::Some(input.into());
167        self
168    }
169    /// <p>The version of the document that you want to update. Currently, Systems Manager supports updating only the latest version of the document. You can specify the version number of the latest version or use the <code>$LATEST</code> variable.</p><note>
170    /// <p>If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p>
171    /// </note>
172    pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173        self.document_version = input;
174        self
175    }
176    /// <p>The version of the document that you want to update. Currently, Systems Manager supports updating only the latest version of the document. You can specify the version number of the latest version or use the <code>$LATEST</code> variable.</p><note>
177    /// <p>If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p>
178    /// </note>
179    pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
180        &self.document_version
181    }
182    /// <p>Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.</p>
183    pub fn document_format(mut self, input: crate::types::DocumentFormat) -> Self {
184        self.document_format = ::std::option::Option::Some(input);
185        self
186    }
187    /// <p>Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.</p>
188    pub fn set_document_format(mut self, input: ::std::option::Option<crate::types::DocumentFormat>) -> Self {
189        self.document_format = input;
190        self
191    }
192    /// <p>Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.</p>
193    pub fn get_document_format(&self) -> &::std::option::Option<crate::types::DocumentFormat> {
194        &self.document_format
195    }
196    /// <p>Specify a new target type for the document.</p>
197    pub fn target_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198        self.target_type = ::std::option::Option::Some(input.into());
199        self
200    }
201    /// <p>Specify a new target type for the document.</p>
202    pub fn set_target_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203        self.target_type = input;
204        self
205    }
206    /// <p>Specify a new target type for the document.</p>
207    pub fn get_target_type(&self) -> &::std::option::Option<::std::string::String> {
208        &self.target_type
209    }
210    /// Consumes the builder and constructs a [`UpdateDocumentInput`](crate::operation::update_document::UpdateDocumentInput).
211    pub fn build(
212        self,
213    ) -> ::std::result::Result<crate::operation::update_document::UpdateDocumentInput, ::aws_smithy_types::error::operation::BuildError> {
214        ::std::result::Result::Ok(crate::operation::update_document::UpdateDocumentInput {
215            content: self.content,
216            attachments: self.attachments,
217            name: self.name,
218            display_name: self.display_name,
219            version_name: self.version_name,
220            document_version: self.document_version,
221            document_format: self.document_format,
222            target_type: self.target_type,
223        })
224    }
225}