aws_sdk_ssm/operation/create_activation/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_activation::_create_activation_output::CreateActivationOutputBuilder;
3
4pub use crate::operation::create_activation::_create_activation_input::CreateActivationInputBuilder;
5
6impl crate::operation::create_activation::builders::CreateActivationInputBuilder {
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_activation::CreateActivationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_activation::CreateActivationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_activation();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateActivation`.
24///
25/// <p>Generates an activation code and activation ID you can use to register your on-premises servers, edge devices, or virtual machine (VM) with Amazon Web Services Systems Manager. Registering these machines with Systems Manager makes it possible to manage them using Systems Manager tools. You use the activation code and ID when installing SSM Agent on machines in your hybrid environment. For more information about requirements for managing on-premises machines using Systems Manager, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-hybrid-multicloud.html">Using Amazon Web Services Systems Manager in hybrid and multicloud environments</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p><note>
26/// <p>Amazon Elastic Compute Cloud (Amazon EC2) instances, edge devices, and on-premises servers and VMs that are configured for Systems Manager are all called <i>managed nodes</i>.</p>
27/// </note>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreateActivationFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::create_activation::builders::CreateActivationInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::create_activation::CreateActivationOutput,
37        crate::operation::create_activation::CreateActivationError,
38    > for CreateActivationFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::create_activation::CreateActivationOutput,
46            crate::operation::create_activation::CreateActivationError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl CreateActivationFluentBuilder {
53    /// Creates a new `CreateActivationFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the CreateActivation as a reference.
62    pub fn as_input(&self) -> &crate::operation::create_activation::builders::CreateActivationInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::create_activation::CreateActivationOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::create_activation::CreateActivationError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::create_activation::CreateActivation::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::create_activation::CreateActivation::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::create_activation::CreateActivationOutput,
99        crate::operation::create_activation::CreateActivationError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <p>A user-defined description of the resource that you want to register with Systems Manager.</p><important>
114    /// <p>Don't enter personally identifiable information in this field.</p>
115    /// </important>
116    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.inner = self.inner.description(input.into());
118        self
119    }
120    /// <p>A user-defined description of the resource that you want to register with Systems Manager.</p><important>
121    /// <p>Don't enter personally identifiable information in this field.</p>
122    /// </important>
123    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.inner = self.inner.set_description(input);
125        self
126    }
127    /// <p>A user-defined description of the resource that you want to register with Systems Manager.</p><important>
128    /// <p>Don't enter personally identifiable information in this field.</p>
129    /// </important>
130    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_description()
132    }
133    /// <p>The name of the registered, managed node as it will appear in the Amazon Web Services Systems Manager console or when you use the Amazon Web Services command line tools to list Systems Manager resources.</p><important>
134    /// <p>Don't enter personally identifiable information in this field.</p>
135    /// </important>
136    pub fn default_instance_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.inner = self.inner.default_instance_name(input.into());
138        self
139    }
140    /// <p>The name of the registered, managed node as it will appear in the Amazon Web Services Systems Manager console or when you use the Amazon Web Services command line tools to list Systems Manager resources.</p><important>
141    /// <p>Don't enter personally identifiable information in this field.</p>
142    /// </important>
143    pub fn set_default_instance_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.inner = self.inner.set_default_instance_name(input);
145        self
146    }
147    /// <p>The name of the registered, managed node as it will appear in the Amazon Web Services Systems Manager console or when you use the Amazon Web Services command line tools to list Systems Manager resources.</p><important>
148    /// <p>Don't enter personally identifiable information in this field.</p>
149    /// </important>
150    pub fn get_default_instance_name(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_default_instance_name()
152    }
153    /// <p>The name of the Identity and Access Management (IAM) role that you want to assign to the managed node. This IAM role must provide AssumeRole permissions for the Amazon Web Services Systems Manager service principal <code>ssm.amazonaws.com</code>. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/hybrid-multicloud-service-role.html">Create the IAM service role required for Systems Manager in a hybrid and multicloud environments</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p><note>
154    /// <p>You can't specify an IAM service-linked role for this parameter. You must create a unique role.</p>
155    /// </note>
156    pub fn iam_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157        self.inner = self.inner.iam_role(input.into());
158        self
159    }
160    /// <p>The name of the Identity and Access Management (IAM) role that you want to assign to the managed node. This IAM role must provide AssumeRole permissions for the Amazon Web Services Systems Manager service principal <code>ssm.amazonaws.com</code>. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/hybrid-multicloud-service-role.html">Create the IAM service role required for Systems Manager in a hybrid and multicloud environments</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p><note>
161    /// <p>You can't specify an IAM service-linked role for this parameter. You must create a unique role.</p>
162    /// </note>
163    pub fn set_iam_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.inner = self.inner.set_iam_role(input);
165        self
166    }
167    /// <p>The name of the Identity and Access Management (IAM) role that you want to assign to the managed node. This IAM role must provide AssumeRole permissions for the Amazon Web Services Systems Manager service principal <code>ssm.amazonaws.com</code>. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/hybrid-multicloud-service-role.html">Create the IAM service role required for Systems Manager in a hybrid and multicloud environments</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p><note>
168    /// <p>You can't specify an IAM service-linked role for this parameter. You must create a unique role.</p>
169    /// </note>
170    pub fn get_iam_role(&self) -> &::std::option::Option<::std::string::String> {
171        self.inner.get_iam_role()
172    }
173    /// <p>Specify the maximum number of managed nodes you want to register. The default value is <code>1</code>.</p>
174    pub fn registration_limit(mut self, input: i32) -> Self {
175        self.inner = self.inner.registration_limit(input);
176        self
177    }
178    /// <p>Specify the maximum number of managed nodes you want to register. The default value is <code>1</code>.</p>
179    pub fn set_registration_limit(mut self, input: ::std::option::Option<i32>) -> Self {
180        self.inner = self.inner.set_registration_limit(input);
181        self
182    }
183    /// <p>Specify the maximum number of managed nodes you want to register. The default value is <code>1</code>.</p>
184    pub fn get_registration_limit(&self) -> &::std::option::Option<i32> {
185        self.inner.get_registration_limit()
186    }
187    /// <p>The date by which this activation request should expire, in timestamp format, such as "2024-07-07T00:00:00". You can specify a date up to 30 days in advance. If you don't provide an expiration date, the activation code expires in 24 hours.</p>
188    pub fn expiration_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
189        self.inner = self.inner.expiration_date(input);
190        self
191    }
192    /// <p>The date by which this activation request should expire, in timestamp format, such as "2024-07-07T00:00:00". You can specify a date up to 30 days in advance. If you don't provide an expiration date, the activation code expires in 24 hours.</p>
193    pub fn set_expiration_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
194        self.inner = self.inner.set_expiration_date(input);
195        self
196    }
197    /// <p>The date by which this activation request should expire, in timestamp format, such as "2024-07-07T00:00:00". You can specify a date up to 30 days in advance. If you don't provide an expiration date, the activation code expires in 24 hours.</p>
198    pub fn get_expiration_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
199        self.inner.get_expiration_date()
200    }
201    ///
202    /// Appends an item to `Tags`.
203    ///
204    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
205    ///
206    /// <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 activation to identify which servers or virtual machines (VMs) in your on-premises environment you intend to activate. In this case, you could specify the following key-value pairs:</p>
207    /// <ul>
208    /// <li>
209    /// <p><code>Key=OS,Value=Windows</code></p></li>
210    /// <li>
211    /// <p><code>Key=Environment,Value=Production</code></p></li>
212    /// </ul><important>
213    /// <p>When you install SSM Agent on your on-premises servers and VMs, you specify an activation ID and code. When you specify the activation ID and code, tags assigned to the activation are automatically applied to the on-premises servers or VMs.</p>
214    /// </important>
215    /// <p>You can't add tags to or delete tags from an existing activation. You can tag your on-premises servers, edge devices, and VMs after they connect to Systems Manager for the first time and are assigned a managed node ID. This means they are listed in the Amazon Web Services Systems Manager console with an ID that is prefixed with "mi-". For information about how to add tags to your managed nodes, see <code>AddTagsToResource</code>. For information about how to remove tags from your managed nodes, see <code>RemoveTagsFromResource</code>.</p>
216    pub fn tags(mut self, input: crate::types::Tag) -> Self {
217        self.inner = self.inner.tags(input);
218        self
219    }
220    /// <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 activation to identify which servers or virtual machines (VMs) in your on-premises environment you intend to activate. In this case, you could specify the following key-value pairs:</p>
221    /// <ul>
222    /// <li>
223    /// <p><code>Key=OS,Value=Windows</code></p></li>
224    /// <li>
225    /// <p><code>Key=Environment,Value=Production</code></p></li>
226    /// </ul><important>
227    /// <p>When you install SSM Agent on your on-premises servers and VMs, you specify an activation ID and code. When you specify the activation ID and code, tags assigned to the activation are automatically applied to the on-premises servers or VMs.</p>
228    /// </important>
229    /// <p>You can't add tags to or delete tags from an existing activation. You can tag your on-premises servers, edge devices, and VMs after they connect to Systems Manager for the first time and are assigned a managed node ID. This means they are listed in the Amazon Web Services Systems Manager console with an ID that is prefixed with "mi-". For information about how to add tags to your managed nodes, see <code>AddTagsToResource</code>. For information about how to remove tags from your managed nodes, see <code>RemoveTagsFromResource</code>.</p>
230    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
231        self.inner = self.inner.set_tags(input);
232        self
233    }
234    /// <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 activation to identify which servers or virtual machines (VMs) in your on-premises environment you intend to activate. In this case, you could specify the following key-value pairs:</p>
235    /// <ul>
236    /// <li>
237    /// <p><code>Key=OS,Value=Windows</code></p></li>
238    /// <li>
239    /// <p><code>Key=Environment,Value=Production</code></p></li>
240    /// </ul><important>
241    /// <p>When you install SSM Agent on your on-premises servers and VMs, you specify an activation ID and code. When you specify the activation ID and code, tags assigned to the activation are automatically applied to the on-premises servers or VMs.</p>
242    /// </important>
243    /// <p>You can't add tags to or delete tags from an existing activation. You can tag your on-premises servers, edge devices, and VMs after they connect to Systems Manager for the first time and are assigned a managed node ID. This means they are listed in the Amazon Web Services Systems Manager console with an ID that is prefixed with "mi-". For information about how to add tags to your managed nodes, see <code>AddTagsToResource</code>. For information about how to remove tags from your managed nodes, see <code>RemoveTagsFromResource</code>.</p>
244    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
245        self.inner.get_tags()
246    }
247    ///
248    /// Appends an item to `RegistrationMetadata`.
249    ///
250    /// To override the contents of this collection use [`set_registration_metadata`](Self::set_registration_metadata).
251    ///
252    /// <p>Reserved for internal use.</p>
253    pub fn registration_metadata(mut self, input: crate::types::RegistrationMetadataItem) -> Self {
254        self.inner = self.inner.registration_metadata(input);
255        self
256    }
257    /// <p>Reserved for internal use.</p>
258    pub fn set_registration_metadata(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RegistrationMetadataItem>>) -> Self {
259        self.inner = self.inner.set_registration_metadata(input);
260        self
261    }
262    /// <p>Reserved for internal use.</p>
263    pub fn get_registration_metadata(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RegistrationMetadataItem>> {
264        self.inner.get_registration_metadata()
265    }
266}