aws_sdk_ssm/operation/create_document/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_document::_create_document_output::CreateDocumentOutputBuilder;
3
4pub use crate::operation::create_document::_create_document_input::CreateDocumentInputBuilder;
5
6impl crate::operation::create_document::builders::CreateDocumentInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_document::CreateDocumentOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_document::CreateDocumentError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_document();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateDocument`.
24///
25/// <p>Creates a Amazon Web Services Systems Manager (SSM document). An SSM document defines the actions that Systems Manager performs on your managed nodes. For more information about SSM documents, including information about supported schemas, features, and syntax, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/documents.html">Amazon Web Services Systems Manager Documents</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateDocumentFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_document::builders::CreateDocumentInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_document::CreateDocumentOutput,
35        crate::operation::create_document::CreateDocumentError,
36    > for CreateDocumentFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_document::CreateDocumentOutput,
44            crate::operation::create_document::CreateDocumentError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateDocumentFluentBuilder {
51    /// Creates a new `CreateDocumentFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateDocument as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_document::builders::CreateDocumentInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_document::CreateDocumentOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_document::CreateDocumentError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_document::CreateDocument::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_document::CreateDocument::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_document::CreateDocumentOutput,
97        crate::operation::create_document::CreateDocumentError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The content for the new SSM document in JSON or YAML format. The content of the document must not exceed 64KB. This quota also includes the content specified for input parameters at runtime. We recommend storing the contents for your new document in an external JSON or YAML file and referencing the file in a command.</p>
112    /// <p>For examples, see the following topics in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
113    /// <ul>
114    /// <li>
115    /// <p><a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/documents-using.html#create-ssm-console">Create an SSM document (console)</a></p></li>
116    /// <li>
117    /// <p><a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/documents-using.html#create-ssm-document-cli">Create an SSM document (command line)</a></p></li>
118    /// <li>
119    /// <p><a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/documents-using.html#create-ssm-document-api">Create an SSM document (API)</a></p></li>
120    /// </ul>
121    pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.content(input.into());
123        self
124    }
125    /// <p>The content for the new SSM document in JSON or YAML format. The content of the document must not exceed 64KB. This quota also includes the content specified for input parameters at runtime. We recommend storing the contents for your new document in an external JSON or YAML file and referencing the file in a command.</p>
126    /// <p>For examples, see the following topics in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
127    /// <ul>
128    /// <li>
129    /// <p><a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/documents-using.html#create-ssm-console">Create an SSM document (console)</a></p></li>
130    /// <li>
131    /// <p><a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/documents-using.html#create-ssm-document-cli">Create an SSM document (command line)</a></p></li>
132    /// <li>
133    /// <p><a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/documents-using.html#create-ssm-document-api">Create an SSM document (API)</a></p></li>
134    /// </ul>
135    pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_content(input);
137        self
138    }
139    /// <p>The content for the new SSM document in JSON or YAML format. The content of the document must not exceed 64KB. This quota also includes the content specified for input parameters at runtime. We recommend storing the contents for your new document in an external JSON or YAML file and referencing the file in a command.</p>
140    /// <p>For examples, see the following topics in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
141    /// <ul>
142    /// <li>
143    /// <p><a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/documents-using.html#create-ssm-console">Create an SSM document (console)</a></p></li>
144    /// <li>
145    /// <p><a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/documents-using.html#create-ssm-document-cli">Create an SSM document (command line)</a></p></li>
146    /// <li>
147    /// <p><a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/documents-using.html#create-ssm-document-api">Create an SSM document (API)</a></p></li>
148    /// </ul>
149    pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
150        self.inner.get_content()
151    }
152    ///
153    /// Appends an item to `Requires`.
154    ///
155    /// To override the contents of this collection use [`set_requires`](Self::set_requires).
156    ///
157    /// <p>A list of SSM documents required by a document. This parameter is used exclusively by AppConfig. When a user creates an AppConfig configuration in an SSM document, the user must also specify a required document for validation purposes. In this case, an <code>ApplicationConfiguration</code> document requires an <code>ApplicationConfigurationSchema</code> document for validation purposes. For more information, see <a href="https://docs.aws.amazon.com/appconfig/latest/userguide/what-is-appconfig.html">What is AppConfig?</a> in the <i>AppConfig User Guide</i>.</p>
158    pub fn requires(mut self, input: crate::types::DocumentRequires) -> Self {
159        self.inner = self.inner.requires(input);
160        self
161    }
162    /// <p>A list of SSM documents required by a document. This parameter is used exclusively by AppConfig. When a user creates an AppConfig configuration in an SSM document, the user must also specify a required document for validation purposes. In this case, an <code>ApplicationConfiguration</code> document requires an <code>ApplicationConfigurationSchema</code> document for validation purposes. For more information, see <a href="https://docs.aws.amazon.com/appconfig/latest/userguide/what-is-appconfig.html">What is AppConfig?</a> in the <i>AppConfig User Guide</i>.</p>
163    pub fn set_requires(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DocumentRequires>>) -> Self {
164        self.inner = self.inner.set_requires(input);
165        self
166    }
167    /// <p>A list of SSM documents required by a document. This parameter is used exclusively by AppConfig. When a user creates an AppConfig configuration in an SSM document, the user must also specify a required document for validation purposes. In this case, an <code>ApplicationConfiguration</code> document requires an <code>ApplicationConfigurationSchema</code> document for validation purposes. For more information, see <a href="https://docs.aws.amazon.com/appconfig/latest/userguide/what-is-appconfig.html">What is AppConfig?</a> in the <i>AppConfig User Guide</i>.</p>
168    pub fn get_requires(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DocumentRequires>> {
169        self.inner.get_requires()
170    }
171    ///
172    /// Appends an item to `Attachments`.
173    ///
174    /// To override the contents of this collection use [`set_attachments`](Self::set_attachments).
175    ///
176    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
177    pub fn attachments(mut self, input: crate::types::AttachmentsSource) -> Self {
178        self.inner = self.inner.attachments(input);
179        self
180    }
181    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
182    pub fn set_attachments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentsSource>>) -> Self {
183        self.inner = self.inner.set_attachments(input);
184        self
185    }
186    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
187    pub fn get_attachments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AttachmentsSource>> {
188        self.inner.get_attachments()
189    }
190    /// <p>A name for the SSM document.</p><important>
191    /// <p>You can't use the following strings as document name prefixes. These are reserved by Amazon Web Services for use as document name prefixes:</p>
192    /// <ul>
193    /// <li>
194    /// <p><code>aws</code></p></li>
195    /// <li>
196    /// <p><code>amazon</code></p></li>
197    /// <li>
198    /// <p><code>amzn</code></p></li>
199    /// <li>
200    /// <p><code>AWSEC2</code></p></li>
201    /// <li>
202    /// <p><code>AWSConfigRemediation</code></p></li>
203    /// <li>
204    /// <p><code>AWSSupport</code></p></li>
205    /// </ul>
206    /// </important>
207    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208        self.inner = self.inner.name(input.into());
209        self
210    }
211    /// <p>A name for the SSM document.</p><important>
212    /// <p>You can't use the following strings as document name prefixes. These are reserved by Amazon Web Services for use as document name prefixes:</p>
213    /// <ul>
214    /// <li>
215    /// <p><code>aws</code></p></li>
216    /// <li>
217    /// <p><code>amazon</code></p></li>
218    /// <li>
219    /// <p><code>amzn</code></p></li>
220    /// <li>
221    /// <p><code>AWSEC2</code></p></li>
222    /// <li>
223    /// <p><code>AWSConfigRemediation</code></p></li>
224    /// <li>
225    /// <p><code>AWSSupport</code></p></li>
226    /// </ul>
227    /// </important>
228    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
229        self.inner = self.inner.set_name(input);
230        self
231    }
232    /// <p>A name for the SSM document.</p><important>
233    /// <p>You can't use the following strings as document name prefixes. These are reserved by Amazon Web Services for use as document name prefixes:</p>
234    /// <ul>
235    /// <li>
236    /// <p><code>aws</code></p></li>
237    /// <li>
238    /// <p><code>amazon</code></p></li>
239    /// <li>
240    /// <p><code>amzn</code></p></li>
241    /// <li>
242    /// <p><code>AWSEC2</code></p></li>
243    /// <li>
244    /// <p><code>AWSConfigRemediation</code></p></li>
245    /// <li>
246    /// <p><code>AWSSupport</code></p></li>
247    /// </ul>
248    /// </important>
249    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
250        self.inner.get_name()
251    }
252    /// <p>An optional field where you can specify a friendly name for the SSM document. This value can differ for each version of the document. You can update this value at a later time using the <code>UpdateDocument</code> operation.</p>
253    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
254        self.inner = self.inner.display_name(input.into());
255        self
256    }
257    /// <p>An optional field where you can specify a friendly name for the SSM document. This value can differ for each version of the document. You can update this value at a later time using the <code>UpdateDocument</code> operation.</p>
258    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
259        self.inner = self.inner.set_display_name(input);
260        self
261    }
262    /// <p>An optional field where you can specify a friendly name for the SSM document. This value can differ for each version of the document. You can update this value at a later time using the <code>UpdateDocument</code> operation.</p>
263    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
264        self.inner.get_display_name()
265    }
266    /// <p>An optional field specifying the version of the artifact you are creating with the document. For example, <code>Release12.1</code>. This value is unique across all versions of a document, and can't be changed.</p>
267    pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
268        self.inner = self.inner.version_name(input.into());
269        self
270    }
271    /// <p>An optional field specifying the version of the artifact you are creating with the document. For example, <code>Release12.1</code>. This value is unique across all versions of a document, and can't be changed.</p>
272    pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
273        self.inner = self.inner.set_version_name(input);
274        self
275    }
276    /// <p>An optional field specifying the version of the artifact you are creating with the document. For example, <code>Release12.1</code>. This value is unique across all versions of a document, and can't be changed.</p>
277    pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> {
278        self.inner.get_version_name()
279    }
280    /// <p>The type of document to create.</p><note>
281    /// <p>The <code>DeploymentStrategy</code> document type is an internal-use-only document type reserved for AppConfig.</p>
282    /// </note>
283    pub fn document_type(mut self, input: crate::types::DocumentType) -> Self {
284        self.inner = self.inner.document_type(input);
285        self
286    }
287    /// <p>The type of document to create.</p><note>
288    /// <p>The <code>DeploymentStrategy</code> document type is an internal-use-only document type reserved for AppConfig.</p>
289    /// </note>
290    pub fn set_document_type(mut self, input: ::std::option::Option<crate::types::DocumentType>) -> Self {
291        self.inner = self.inner.set_document_type(input);
292        self
293    }
294    /// <p>The type of document to create.</p><note>
295    /// <p>The <code>DeploymentStrategy</code> document type is an internal-use-only document type reserved for AppConfig.</p>
296    /// </note>
297    pub fn get_document_type(&self) -> &::std::option::Option<crate::types::DocumentType> {
298        self.inner.get_document_type()
299    }
300    /// <p>Specify the document format for the request. The document format can be JSON, YAML, or TEXT. JSON is the default format.</p>
301    pub fn document_format(mut self, input: crate::types::DocumentFormat) -> Self {
302        self.inner = self.inner.document_format(input);
303        self
304    }
305    /// <p>Specify the document format for the request. The document format can be JSON, YAML, or TEXT. JSON is the default format.</p>
306    pub fn set_document_format(mut self, input: ::std::option::Option<crate::types::DocumentFormat>) -> Self {
307        self.inner = self.inner.set_document_format(input);
308        self
309    }
310    /// <p>Specify the document format for the request. The document format can be JSON, YAML, or TEXT. JSON is the default format.</p>
311    pub fn get_document_format(&self) -> &::std::option::Option<crate::types::DocumentFormat> {
312        self.inner.get_document_format()
313    }
314    /// <p>Specify a target type to define the kinds of resources the document can run on. For example, to run a document on EC2 instances, specify the following value: <code>/AWS::EC2::Instance</code>. If you specify a value of '/' the document can run on all types of resources. If you don't specify a value, the document can't run on any resources. For a list of valid resource types, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html">Amazon Web Services resource and property types reference</a> in the <i>CloudFormation User Guide</i>.</p>
315    pub fn target_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
316        self.inner = self.inner.target_type(input.into());
317        self
318    }
319    /// <p>Specify a target type to define the kinds of resources the document can run on. For example, to run a document on EC2 instances, specify the following value: <code>/AWS::EC2::Instance</code>. If you specify a value of '/' the document can run on all types of resources. If you don't specify a value, the document can't run on any resources. For a list of valid resource types, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html">Amazon Web Services resource and property types reference</a> in the <i>CloudFormation User Guide</i>.</p>
320    pub fn set_target_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
321        self.inner = self.inner.set_target_type(input);
322        self
323    }
324    /// <p>Specify a target type to define the kinds of resources the document can run on. For example, to run a document on EC2 instances, specify the following value: <code>/AWS::EC2::Instance</code>. If you specify a value of '/' the document can run on all types of resources. If you don't specify a value, the document can't run on any resources. For a list of valid resource types, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html">Amazon Web Services resource and property types reference</a> in the <i>CloudFormation User Guide</i>.</p>
325    pub fn get_target_type(&self) -> &::std::option::Option<::std::string::String> {
326        self.inner.get_target_type()
327    }
328    ///
329    /// Appends an item to `Tags`.
330    ///
331    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
332    ///
333    /// <p>Optional metadata that you assign to a resource. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag an SSM document to identify the types of targets or the environment where it will run. In this case, you could specify the following key-value pairs:</p>
334    /// <ul>
335    /// <li>
336    /// <p><code>Key=OS,Value=Windows</code></p></li>
337    /// <li>
338    /// <p><code>Key=Environment,Value=Production</code></p></li>
339    /// </ul><note>
340    /// <p>To add tags to an existing SSM document, use the <code>AddTagsToResource</code> operation.</p>
341    /// </note>
342    pub fn tags(mut self, input: crate::types::Tag) -> Self {
343        self.inner = self.inner.tags(input);
344        self
345    }
346    /// <p>Optional metadata that you assign to a resource. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag an SSM document to identify the types of targets or the environment where it will run. In this case, you could specify the following key-value pairs:</p>
347    /// <ul>
348    /// <li>
349    /// <p><code>Key=OS,Value=Windows</code></p></li>
350    /// <li>
351    /// <p><code>Key=Environment,Value=Production</code></p></li>
352    /// </ul><note>
353    /// <p>To add tags to an existing SSM document, use the <code>AddTagsToResource</code> operation.</p>
354    /// </note>
355    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
356        self.inner = self.inner.set_tags(input);
357        self
358    }
359    /// <p>Optional metadata that you assign to a resource. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag an SSM document to identify the types of targets or the environment where it will run. In this case, you could specify the following key-value pairs:</p>
360    /// <ul>
361    /// <li>
362    /// <p><code>Key=OS,Value=Windows</code></p></li>
363    /// <li>
364    /// <p><code>Key=Environment,Value=Production</code></p></li>
365    /// </ul><note>
366    /// <p>To add tags to an existing SSM document, use the <code>AddTagsToResource</code> operation.</p>
367    /// </note>
368    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
369        self.inner.get_tags()
370    }
371}