aws_sdk_migrationhub/operation/put_resource_attributes/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::put_resource_attributes::_put_resource_attributes_output::PutResourceAttributesOutputBuilder;
3
4pub use crate::operation::put_resource_attributes::_put_resource_attributes_input::PutResourceAttributesInputBuilder;
5
6impl crate::operation::put_resource_attributes::builders::PutResourceAttributesInputBuilder {
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::put_resource_attributes::PutResourceAttributesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::put_resource_attributes::PutResourceAttributesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.put_resource_attributes();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `PutResourceAttributes`.
24///
25/// <p>Provides identifying details of the resource being migrated so that it can be associated in the Application Discovery Service repository. This association occurs asynchronously after <code>PutResourceAttributes</code> returns.</p><important>
26/// <ul>
27/// <li>
28/// <p>Keep in mind that subsequent calls to PutResourceAttributes will override previously stored attributes. For example, if it is first called with a MAC address, but later, it is desired to <i>add</i> an IP address, it will then be required to call it with <i>both</i> the IP and MAC addresses to prevent overriding the MAC address.</p></li>
29/// <li>
30/// <p>Note the instructions regarding the special use case of the <a href="https://docs.aws.amazon.com/migrationhub/latest/ug/API_PutResourceAttributes.html#migrationhub-PutResourceAttributes-request-ResourceAttributeList"> <code>ResourceAttributeList</code> </a> parameter when specifying any "VM" related value.</p></li>
31/// </ul>
32/// </important> <note>
33/// <p>Because this is an asynchronous call, it will always return 200, whether an association occurs or not. To confirm if an association was found based on the provided details, call <code>ListDiscoveredResources</code>.</p>
34/// </note>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct PutResourceAttributesFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::put_resource_attributes::builders::PutResourceAttributesInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::put_resource_attributes::PutResourceAttributesOutput,
44        crate::operation::put_resource_attributes::PutResourceAttributesError,
45    > for PutResourceAttributesFluentBuilder
46{
47    fn send(
48        self,
49        config_override: crate::config::Builder,
50    ) -> crate::client::customize::internal::BoxFuture<
51        crate::client::customize::internal::SendResult<
52            crate::operation::put_resource_attributes::PutResourceAttributesOutput,
53            crate::operation::put_resource_attributes::PutResourceAttributesError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl PutResourceAttributesFluentBuilder {
60    /// Creates a new `PutResourceAttributesFluentBuilder`.
61    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62        Self {
63            handle,
64            inner: ::std::default::Default::default(),
65            config_override: ::std::option::Option::None,
66        }
67    }
68    /// Access the PutResourceAttributes as a reference.
69    pub fn as_input(&self) -> &crate::operation::put_resource_attributes::builders::PutResourceAttributesInputBuilder {
70        &self.inner
71    }
72    /// Sends the request and returns the response.
73    ///
74    /// If an error occurs, an `SdkError` will be returned with additional details that
75    /// can be matched against.
76    ///
77    /// By default, any retryable failures will be retried twice. Retry behavior
78    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79    /// set when configuring the client.
80    pub async fn send(
81        self,
82    ) -> ::std::result::Result<
83        crate::operation::put_resource_attributes::PutResourceAttributesOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::put_resource_attributes::PutResourceAttributesError,
86            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87        >,
88    > {
89        let input = self
90            .inner
91            .build()
92            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93        let runtime_plugins = crate::operation::put_resource_attributes::PutResourceAttributes::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::put_resource_attributes::PutResourceAttributes::orchestrate(&runtime_plugins, input).await
99    }
100
101    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102    pub fn customize(
103        self,
104    ) -> crate::client::customize::CustomizableOperation<
105        crate::operation::put_resource_attributes::PutResourceAttributesOutput,
106        crate::operation::put_resource_attributes::PutResourceAttributesError,
107        Self,
108    > {
109        crate::client::customize::CustomizableOperation::new(self)
110    }
111    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112        self.set_config_override(::std::option::Option::Some(config_override.into()));
113        self
114    }
115
116    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117        self.config_override = config_override;
118        self
119    }
120    /// <p>The name of the ProgressUpdateStream.</p>
121    pub fn progress_update_stream(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.progress_update_stream(input.into());
123        self
124    }
125    /// <p>The name of the ProgressUpdateStream.</p>
126    pub fn set_progress_update_stream(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.inner = self.inner.set_progress_update_stream(input);
128        self
129    }
130    /// <p>The name of the ProgressUpdateStream.</p>
131    pub fn get_progress_update_stream(&self) -> &::std::option::Option<::std::string::String> {
132        self.inner.get_progress_update_stream()
133    }
134    /// <p>Unique identifier that references the migration task. <i>Do not store personal data in this field.</i></p>
135    pub fn migration_task_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.inner = self.inner.migration_task_name(input.into());
137        self
138    }
139    /// <p>Unique identifier that references the migration task. <i>Do not store personal data in this field.</i></p>
140    pub fn set_migration_task_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.inner = self.inner.set_migration_task_name(input);
142        self
143    }
144    /// <p>Unique identifier that references the migration task. <i>Do not store personal data in this field.</i></p>
145    pub fn get_migration_task_name(&self) -> &::std::option::Option<::std::string::String> {
146        self.inner.get_migration_task_name()
147    }
148    ///
149    /// Appends an item to `ResourceAttributeList`.
150    ///
151    /// To override the contents of this collection use [`set_resource_attribute_list`](Self::set_resource_attribute_list).
152    ///
153    /// <p>Information about the resource that is being migrated. This data will be used to map the task to a resource in the Application Discovery Service repository.</p><note>
154    /// <p>Takes the object array of <code>ResourceAttribute</code> where the <code>Type</code> field is reserved for the following values: <code>IPV4_ADDRESS | IPV6_ADDRESS | MAC_ADDRESS | FQDN | VM_MANAGER_ID | VM_MANAGED_OBJECT_REFERENCE | VM_NAME | VM_PATH | BIOS_ID | MOTHERBOARD_SERIAL_NUMBER</code> where the identifying value can be a string up to 256 characters.</p>
155    /// </note> <important>
156    /// <ul>
157    /// <li>
158    /// <p>If any "VM" related value is set for a <code>ResourceAttribute</code> object, it is required that <code>VM_MANAGER_ID</code>, as a minimum, is always set. If <code>VM_MANAGER_ID</code> is not set, then all "VM" fields will be discarded and "VM" fields will not be used for matching the migration task to a server in Application Discovery Service repository. See the <a href="https://docs.aws.amazon.com/migrationhub/latest/ug/API_PutResourceAttributes.html#API_PutResourceAttributes_Examples">Example</a> section below for a use case of specifying "VM" related values.</p></li>
159    /// <li>
160    /// <p>If a server you are trying to match has multiple IP or MAC addresses, you should provide as many as you know in separate type/value pairs passed to the <code>ResourceAttributeList</code> parameter to maximize the chances of matching.</p></li>
161    /// </ul>
162    /// </important>
163    pub fn resource_attribute_list(mut self, input: crate::types::ResourceAttribute) -> Self {
164        self.inner = self.inner.resource_attribute_list(input);
165        self
166    }
167    /// <p>Information about the resource that is being migrated. This data will be used to map the task to a resource in the Application Discovery Service repository.</p><note>
168    /// <p>Takes the object array of <code>ResourceAttribute</code> where the <code>Type</code> field is reserved for the following values: <code>IPV4_ADDRESS | IPV6_ADDRESS | MAC_ADDRESS | FQDN | VM_MANAGER_ID | VM_MANAGED_OBJECT_REFERENCE | VM_NAME | VM_PATH | BIOS_ID | MOTHERBOARD_SERIAL_NUMBER</code> where the identifying value can be a string up to 256 characters.</p>
169    /// </note> <important>
170    /// <ul>
171    /// <li>
172    /// <p>If any "VM" related value is set for a <code>ResourceAttribute</code> object, it is required that <code>VM_MANAGER_ID</code>, as a minimum, is always set. If <code>VM_MANAGER_ID</code> is not set, then all "VM" fields will be discarded and "VM" fields will not be used for matching the migration task to a server in Application Discovery Service repository. See the <a href="https://docs.aws.amazon.com/migrationhub/latest/ug/API_PutResourceAttributes.html#API_PutResourceAttributes_Examples">Example</a> section below for a use case of specifying "VM" related values.</p></li>
173    /// <li>
174    /// <p>If a server you are trying to match has multiple IP or MAC addresses, you should provide as many as you know in separate type/value pairs passed to the <code>ResourceAttributeList</code> parameter to maximize the chances of matching.</p></li>
175    /// </ul>
176    /// </important>
177    pub fn set_resource_attribute_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceAttribute>>) -> Self {
178        self.inner = self.inner.set_resource_attribute_list(input);
179        self
180    }
181    /// <p>Information about the resource that is being migrated. This data will be used to map the task to a resource in the Application Discovery Service repository.</p><note>
182    /// <p>Takes the object array of <code>ResourceAttribute</code> where the <code>Type</code> field is reserved for the following values: <code>IPV4_ADDRESS | IPV6_ADDRESS | MAC_ADDRESS | FQDN | VM_MANAGER_ID | VM_MANAGED_OBJECT_REFERENCE | VM_NAME | VM_PATH | BIOS_ID | MOTHERBOARD_SERIAL_NUMBER</code> where the identifying value can be a string up to 256 characters.</p>
183    /// </note> <important>
184    /// <ul>
185    /// <li>
186    /// <p>If any "VM" related value is set for a <code>ResourceAttribute</code> object, it is required that <code>VM_MANAGER_ID</code>, as a minimum, is always set. If <code>VM_MANAGER_ID</code> is not set, then all "VM" fields will be discarded and "VM" fields will not be used for matching the migration task to a server in Application Discovery Service repository. See the <a href="https://docs.aws.amazon.com/migrationhub/latest/ug/API_PutResourceAttributes.html#API_PutResourceAttributes_Examples">Example</a> section below for a use case of specifying "VM" related values.</p></li>
187    /// <li>
188    /// <p>If a server you are trying to match has multiple IP or MAC addresses, you should provide as many as you know in separate type/value pairs passed to the <code>ResourceAttributeList</code> parameter to maximize the chances of matching.</p></li>
189    /// </ul>
190    /// </important>
191    pub fn get_resource_attribute_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceAttribute>> {
192        self.inner.get_resource_attribute_list()
193    }
194    /// <p>Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.</p>
195    pub fn dry_run(mut self, input: bool) -> Self {
196        self.inner = self.inner.dry_run(input);
197        self
198    }
199    /// <p>Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.</p>
200    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
201        self.inner = self.inner.set_dry_run(input);
202        self
203    }
204    /// <p>Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.</p>
205    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
206        self.inner.get_dry_run()
207    }
208}