aws_sdk_ssm/operation/update_maintenance_window_target/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_maintenance_window_target::_update_maintenance_window_target_output::UpdateMaintenanceWindowTargetOutputBuilder;
3
4pub use crate::operation::update_maintenance_window_target::_update_maintenance_window_target_input::UpdateMaintenanceWindowTargetInputBuilder;
5
6impl crate::operation::update_maintenance_window_target::builders::UpdateMaintenanceWindowTargetInputBuilder {
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::update_maintenance_window_target::UpdateMaintenanceWindowTargetOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_maintenance_window_target::UpdateMaintenanceWindowTargetError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_maintenance_window_target();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateMaintenanceWindowTarget`.
24///
25/// <p>Modifies the target of an existing maintenance window. You can change the following:</p>
26/// <ul>
27/// <li>
28/// <p>Name</p></li>
29/// <li>
30/// <p>Description</p></li>
31/// <li>
32/// <p>Owner</p></li>
33/// <li>
34/// <p>IDs for an ID target</p></li>
35/// <li>
36/// <p>Tags for a Tag target</p></li>
37/// <li>
38/// <p>From any supported tag type to another. The three supported tag types are ID target, Tag target, and resource group. For more information, see <code>Target</code>.</p></li>
39/// </ul><note>
40/// <p>If a parameter is null, then the corresponding field isn't modified.</p>
41/// </note>
42#[derive(::std::clone::Clone, ::std::fmt::Debug)]
43pub struct UpdateMaintenanceWindowTargetFluentBuilder {
44    handle: ::std::sync::Arc<crate::client::Handle>,
45    inner: crate::operation::update_maintenance_window_target::builders::UpdateMaintenanceWindowTargetInputBuilder,
46    config_override: ::std::option::Option<crate::config::Builder>,
47}
48impl
49    crate::client::customize::internal::CustomizableSend<
50        crate::operation::update_maintenance_window_target::UpdateMaintenanceWindowTargetOutput,
51        crate::operation::update_maintenance_window_target::UpdateMaintenanceWindowTargetError,
52    > for UpdateMaintenanceWindowTargetFluentBuilder
53{
54    fn send(
55        self,
56        config_override: crate::config::Builder,
57    ) -> crate::client::customize::internal::BoxFuture<
58        crate::client::customize::internal::SendResult<
59            crate::operation::update_maintenance_window_target::UpdateMaintenanceWindowTargetOutput,
60            crate::operation::update_maintenance_window_target::UpdateMaintenanceWindowTargetError,
61        >,
62    > {
63        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
64    }
65}
66impl UpdateMaintenanceWindowTargetFluentBuilder {
67    /// Creates a new `UpdateMaintenanceWindowTargetFluentBuilder`.
68    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
69        Self {
70            handle,
71            inner: ::std::default::Default::default(),
72            config_override: ::std::option::Option::None,
73        }
74    }
75    /// Access the UpdateMaintenanceWindowTarget as a reference.
76    pub fn as_input(&self) -> &crate::operation::update_maintenance_window_target::builders::UpdateMaintenanceWindowTargetInputBuilder {
77        &self.inner
78    }
79    /// Sends the request and returns the response.
80    ///
81    /// If an error occurs, an `SdkError` will be returned with additional details that
82    /// can be matched against.
83    ///
84    /// By default, any retryable failures will be retried twice. Retry behavior
85    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
86    /// set when configuring the client.
87    pub async fn send(
88        self,
89    ) -> ::std::result::Result<
90        crate::operation::update_maintenance_window_target::UpdateMaintenanceWindowTargetOutput,
91        ::aws_smithy_runtime_api::client::result::SdkError<
92            crate::operation::update_maintenance_window_target::UpdateMaintenanceWindowTargetError,
93            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
94        >,
95    > {
96        let input = self
97            .inner
98            .build()
99            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
100        let runtime_plugins = crate::operation::update_maintenance_window_target::UpdateMaintenanceWindowTarget::operation_runtime_plugins(
101            self.handle.runtime_plugins.clone(),
102            &self.handle.conf,
103            self.config_override,
104        );
105        crate::operation::update_maintenance_window_target::UpdateMaintenanceWindowTarget::orchestrate(&runtime_plugins, input).await
106    }
107
108    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
109    pub fn customize(
110        self,
111    ) -> crate::client::customize::CustomizableOperation<
112        crate::operation::update_maintenance_window_target::UpdateMaintenanceWindowTargetOutput,
113        crate::operation::update_maintenance_window_target::UpdateMaintenanceWindowTargetError,
114        Self,
115    > {
116        crate::client::customize::CustomizableOperation::new(self)
117    }
118    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
119        self.set_config_override(::std::option::Option::Some(config_override.into()));
120        self
121    }
122
123    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
124        self.config_override = config_override;
125        self
126    }
127    /// <p>The maintenance window ID with which to modify the target.</p>
128    pub fn window_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.window_id(input.into());
130        self
131    }
132    /// <p>The maintenance window ID with which to modify the target.</p>
133    pub fn set_window_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_window_id(input);
135        self
136    }
137    /// <p>The maintenance window ID with which to modify the target.</p>
138    pub fn get_window_id(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_window_id()
140    }
141    /// <p>The target ID to modify.</p>
142    pub fn window_target_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.window_target_id(input.into());
144        self
145    }
146    /// <p>The target ID to modify.</p>
147    pub fn set_window_target_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_window_target_id(input);
149        self
150    }
151    /// <p>The target ID to modify.</p>
152    pub fn get_window_target_id(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_window_target_id()
154    }
155    ///
156    /// Appends an item to `Targets`.
157    ///
158    /// To override the contents of this collection use [`set_targets`](Self::set_targets).
159    ///
160    /// <p>The targets to add or replace.</p>
161    pub fn targets(mut self, input: crate::types::Target) -> Self {
162        self.inner = self.inner.targets(input);
163        self
164    }
165    /// <p>The targets to add or replace.</p>
166    pub fn set_targets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Target>>) -> Self {
167        self.inner = self.inner.set_targets(input);
168        self
169    }
170    /// <p>The targets to add or replace.</p>
171    pub fn get_targets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Target>> {
172        self.inner.get_targets()
173    }
174    /// <p>User-provided value that will be included in any Amazon CloudWatch Events events raised while running tasks for these targets in this maintenance window.</p>
175    pub fn owner_information(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176        self.inner = self.inner.owner_information(input.into());
177        self
178    }
179    /// <p>User-provided value that will be included in any Amazon CloudWatch Events events raised while running tasks for these targets in this maintenance window.</p>
180    pub fn set_owner_information(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.inner = self.inner.set_owner_information(input);
182        self
183    }
184    /// <p>User-provided value that will be included in any Amazon CloudWatch Events events raised while running tasks for these targets in this maintenance window.</p>
185    pub fn get_owner_information(&self) -> &::std::option::Option<::std::string::String> {
186        self.inner.get_owner_information()
187    }
188    /// <p>A name for the update.</p>
189    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190        self.inner = self.inner.name(input.into());
191        self
192    }
193    /// <p>A name for the update.</p>
194    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195        self.inner = self.inner.set_name(input);
196        self
197    }
198    /// <p>A name for the update.</p>
199    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
200        self.inner.get_name()
201    }
202    /// <p>An optional description for the update.</p>
203    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
204        self.inner = self.inner.description(input.into());
205        self
206    }
207    /// <p>An optional description for the update.</p>
208    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
209        self.inner = self.inner.set_description(input);
210        self
211    }
212    /// <p>An optional description for the update.</p>
213    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
214        self.inner.get_description()
215    }
216    /// <p>If <code>True</code>, then all fields that are required by the <code>RegisterTargetWithMaintenanceWindow</code> operation are also required for this API request. Optional fields that aren't specified are set to null.</p>
217    pub fn replace(mut self, input: bool) -> Self {
218        self.inner = self.inner.replace(input);
219        self
220    }
221    /// <p>If <code>True</code>, then all fields that are required by the <code>RegisterTargetWithMaintenanceWindow</code> operation are also required for this API request. Optional fields that aren't specified are set to null.</p>
222    pub fn set_replace(mut self, input: ::std::option::Option<bool>) -> Self {
223        self.inner = self.inner.set_replace(input);
224        self
225    }
226    /// <p>If <code>True</code>, then all fields that are required by the <code>RegisterTargetWithMaintenanceWindow</code> operation are also required for this API request. Optional fields that aren't specified are set to null.</p>
227    pub fn get_replace(&self) -> &::std::option::Option<bool> {
228        self.inner.get_replace()
229    }
230}