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
// 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, std::fmt::Debug)]
pub struct UpdateDocumentInput {
    /// <p>A valid JSON or YAML string.</p>
    #[doc(hidden)]
    pub content: std::option::Option<std::string::String>,
    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
    #[doc(hidden)]
    pub attachments: std::option::Option<std::vec::Vec<crate::types::AttachmentsSource>>,
    /// <p>The name of the SSM document that you want to update.</p>
    #[doc(hidden)]
    pub name: std::option::Option<std::string::String>,
    /// <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>
    #[doc(hidden)]
    pub display_name: std::option::Option<std::string::String>,
    /// <p>An optional field specifying the version of the artifact you are updating with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.</p>
    #[doc(hidden)]
    pub version_name: std::option::Option<std::string::String>,
    /// <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>
    /// <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>
    /// </note>
    #[doc(hidden)]
    pub document_version: std::option::Option<std::string::String>,
    /// <p>Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.</p>
    #[doc(hidden)]
    pub document_format: std::option::Option<crate::types::DocumentFormat>,
    /// <p>Specify a new target type for the document.</p>
    #[doc(hidden)]
    pub target_type: std::option::Option<std::string::String>,
}
impl UpdateDocumentInput {
    /// <p>A valid JSON or YAML string.</p>
    pub fn content(&self) -> std::option::Option<&str> {
        self.content.as_deref()
    }
    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
    pub fn attachments(&self) -> std::option::Option<&[crate::types::AttachmentsSource]> {
        self.attachments.as_deref()
    }
    /// <p>The name of the SSM document that you want to update.</p>
    pub fn name(&self) -> std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <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>
    pub fn display_name(&self) -> std::option::Option<&str> {
        self.display_name.as_deref()
    }
    /// <p>An optional field specifying the version of the artifact you are updating with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.</p>
    pub fn version_name(&self) -> std::option::Option<&str> {
        self.version_name.as_deref()
    }
    /// <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>
    /// <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>
    /// </note>
    pub fn document_version(&self) -> std::option::Option<&str> {
        self.document_version.as_deref()
    }
    /// <p>Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.</p>
    pub fn document_format(&self) -> std::option::Option<&crate::types::DocumentFormat> {
        self.document_format.as_ref()
    }
    /// <p>Specify a new target type for the document.</p>
    pub fn target_type(&self) -> std::option::Option<&str> {
        self.target_type.as_deref()
    }
}
impl UpdateDocumentInput {
    /// Creates a new builder-style object to manufacture [`UpdateDocumentInput`](crate::operation::update_document::UpdateDocumentInput).
    pub fn builder() -> crate::operation::update_document::builders::UpdateDocumentInputBuilder {
        crate::operation::update_document::builders::UpdateDocumentInputBuilder::default()
    }
}

/// A builder for [`UpdateDocumentInput`](crate::operation::update_document::UpdateDocumentInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct UpdateDocumentInputBuilder {
    pub(crate) content: std::option::Option<std::string::String>,
    pub(crate) attachments: std::option::Option<std::vec::Vec<crate::types::AttachmentsSource>>,
    pub(crate) name: std::option::Option<std::string::String>,
    pub(crate) display_name: std::option::Option<std::string::String>,
    pub(crate) version_name: std::option::Option<std::string::String>,
    pub(crate) document_version: std::option::Option<std::string::String>,
    pub(crate) document_format: std::option::Option<crate::types::DocumentFormat>,
    pub(crate) target_type: std::option::Option<std::string::String>,
}
impl UpdateDocumentInputBuilder {
    /// <p>A valid JSON or YAML string.</p>
    pub fn content(mut self, input: impl Into<std::string::String>) -> Self {
        self.content = Some(input.into());
        self
    }
    /// <p>A valid JSON or YAML string.</p>
    pub fn set_content(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.content = input;
        self
    }
    /// Appends an item to `attachments`.
    ///
    /// To override the contents of this collection use [`set_attachments`](Self::set_attachments).
    ///
    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
    pub fn attachments(mut self, input: crate::types::AttachmentsSource) -> Self {
        let mut v = self.attachments.unwrap_or_default();
        v.push(input);
        self.attachments = Some(v);
        self
    }
    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
    pub fn set_attachments(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::AttachmentsSource>>,
    ) -> Self {
        self.attachments = input;
        self
    }
    /// <p>The name of the SSM document that you want to update.</p>
    pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
        self.name = Some(input.into());
        self
    }
    /// <p>The name of the SSM document that you want to update.</p>
    pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <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>
    pub fn display_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.display_name = Some(input.into());
        self
    }
    /// <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>
    pub fn set_display_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.display_name = input;
        self
    }
    /// <p>An optional field specifying the version of the artifact you are updating with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.</p>
    pub fn version_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.version_name = Some(input.into());
        self
    }
    /// <p>An optional field specifying the version of the artifact you are updating with the document. For example, "Release 12, Update 6". This value is unique across all versions of a document, and can't be changed.</p>
    pub fn set_version_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.version_name = input;
        self
    }
    /// <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>
    /// <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>
    /// </note>
    pub fn document_version(mut self, input: impl Into<std::string::String>) -> Self {
        self.document_version = Some(input.into());
        self
    }
    /// <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>
    /// <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>
    /// </note>
    pub fn set_document_version(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.document_version = input;
        self
    }
    /// <p>Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.</p>
    pub fn document_format(mut self, input: crate::types::DocumentFormat) -> Self {
        self.document_format = Some(input);
        self
    }
    /// <p>Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.</p>
    pub fn set_document_format(
        mut self,
        input: std::option::Option<crate::types::DocumentFormat>,
    ) -> Self {
        self.document_format = input;
        self
    }
    /// <p>Specify a new target type for the document.</p>
    pub fn target_type(mut self, input: impl Into<std::string::String>) -> Self {
        self.target_type = Some(input.into());
        self
    }
    /// <p>Specify a new target type for the document.</p>
    pub fn set_target_type(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.target_type = input;
        self
    }
    /// Consumes the builder and constructs a [`UpdateDocumentInput`](crate::operation::update_document::UpdateDocumentInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::update_document::UpdateDocumentInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(crate::operation::update_document::UpdateDocumentInput {
            content: self.content,
            attachments: self.attachments,
            name: self.name,
            display_name: self.display_name,
            version_name: self.version_name,
            document_version: self.document_version,
            document_format: self.document_format,
            target_type: self.target_type,
        })
    }
}