aws_sdk_gamelift/operation/update_fleet_attributes/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_fleet_attributes::_update_fleet_attributes_output::UpdateFleetAttributesOutputBuilder;
3
4pub use crate::operation::update_fleet_attributes::_update_fleet_attributes_input::UpdateFleetAttributesInputBuilder;
5
6impl crate::operation::update_fleet_attributes::builders::UpdateFleetAttributesInputBuilder {
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_fleet_attributes::UpdateFleetAttributesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_fleet_attributes::UpdateFleetAttributesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_fleet_attributes();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateFleetAttributes`.
24///
25/// <p><b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p>
26/// <p>Updates a fleet's mutable attributes, such as game session protection and resource creation limits.</p>
27/// <p>To update fleet attributes, specify the fleet ID and the property values that you want to change. If successful, Amazon GameLift Servers returns the identifiers for the updated fleet.</p><note>
28/// <p>A managed fleet's runtime environment, which depends on the fleet's Amazon Machine Image {AMI} version, can't be updated. You must create a new fleet. As a best practice, we recommend replacing your managed fleets every 30 days to maintain a secure and up-to-date runtime environment for your hosted game servers. For guidance, see <a href="https://docs.aws.amazon.com/gameliftservers/latest/developerguide/security-best-practices.html"> Security best practices for Amazon GameLift Servers</a>.</p>
29/// </note>
30/// <p><b>Learn more</b></p>
31/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html">Setting up Amazon GameLift Servers fleets</a></p>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct UpdateFleetAttributesFluentBuilder {
34    handle: ::std::sync::Arc<crate::client::Handle>,
35    inner: crate::operation::update_fleet_attributes::builders::UpdateFleetAttributesInputBuilder,
36    config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39    crate::client::customize::internal::CustomizableSend<
40        crate::operation::update_fleet_attributes::UpdateFleetAttributesOutput,
41        crate::operation::update_fleet_attributes::UpdateFleetAttributesError,
42    > for UpdateFleetAttributesFluentBuilder
43{
44    fn send(
45        self,
46        config_override: crate::config::Builder,
47    ) -> crate::client::customize::internal::BoxFuture<
48        crate::client::customize::internal::SendResult<
49            crate::operation::update_fleet_attributes::UpdateFleetAttributesOutput,
50            crate::operation::update_fleet_attributes::UpdateFleetAttributesError,
51        >,
52    > {
53        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54    }
55}
56impl UpdateFleetAttributesFluentBuilder {
57    /// Creates a new `UpdateFleetAttributesFluentBuilder`.
58    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
59        Self {
60            handle,
61            inner: ::std::default::Default::default(),
62            config_override: ::std::option::Option::None,
63        }
64    }
65    /// Access the UpdateFleetAttributes as a reference.
66    pub fn as_input(&self) -> &crate::operation::update_fleet_attributes::builders::UpdateFleetAttributesInputBuilder {
67        &self.inner
68    }
69    /// Sends the request and returns the response.
70    ///
71    /// If an error occurs, an `SdkError` will be returned with additional details that
72    /// can be matched against.
73    ///
74    /// By default, any retryable failures will be retried twice. Retry behavior
75    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76    /// set when configuring the client.
77    pub async fn send(
78        self,
79    ) -> ::std::result::Result<
80        crate::operation::update_fleet_attributes::UpdateFleetAttributesOutput,
81        ::aws_smithy_runtime_api::client::result::SdkError<
82            crate::operation::update_fleet_attributes::UpdateFleetAttributesError,
83            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84        >,
85    > {
86        let input = self
87            .inner
88            .build()
89            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90        let runtime_plugins = crate::operation::update_fleet_attributes::UpdateFleetAttributes::operation_runtime_plugins(
91            self.handle.runtime_plugins.clone(),
92            &self.handle.conf,
93            self.config_override,
94        );
95        crate::operation::update_fleet_attributes::UpdateFleetAttributes::orchestrate(&runtime_plugins, input).await
96    }
97
98    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99    pub fn customize(
100        self,
101    ) -> crate::client::customize::CustomizableOperation<
102        crate::operation::update_fleet_attributes::UpdateFleetAttributesOutput,
103        crate::operation::update_fleet_attributes::UpdateFleetAttributesError,
104        Self,
105    > {
106        crate::client::customize::CustomizableOperation::new(self)
107    }
108    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109        self.set_config_override(::std::option::Option::Some(config_override.into()));
110        self
111    }
112
113    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114        self.config_override = config_override;
115        self
116    }
117    /// <p>A unique identifier for the fleet to update attribute metadata for. You can use either the fleet ID or ARN value.</p>
118    pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.inner = self.inner.fleet_id(input.into());
120        self
121    }
122    /// <p>A unique identifier for the fleet to update attribute metadata for. You can use either the fleet ID or ARN value.</p>
123    pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.inner = self.inner.set_fleet_id(input);
125        self
126    }
127    /// <p>A unique identifier for the fleet to update attribute metadata for. You can use either the fleet ID or ARN value.</p>
128    pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
129        self.inner.get_fleet_id()
130    }
131    /// <p>A descriptive label that is associated with a fleet. Fleet names do not need to be unique.</p>
132    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.name(input.into());
134        self
135    }
136    /// <p>A descriptive label that is associated with a fleet. Fleet names do not need to be unique.</p>
137    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_name(input);
139        self
140    }
141    /// <p>A descriptive label that is associated with a fleet. Fleet names do not need to be unique.</p>
142    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_name()
144    }
145    /// <p>A human-readable description of a fleet.</p>
146    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.description(input.into());
148        self
149    }
150    /// <p>A human-readable description of a fleet.</p>
151    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_description(input);
153        self
154    }
155    /// <p>A human-readable description of a fleet.</p>
156    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
157        self.inner.get_description()
158    }
159    /// <p>The game session protection policy to apply to all new game sessions created in this fleet. Game sessions that already exist are not affected. You can set protection for individual game sessions using <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateGameSession.html">UpdateGameSession</a> .</p>
160    /// <ul>
161    /// <li>
162    /// <p><b>NoProtection</b> -- The game session can be terminated during a scale-down event.</p></li>
163    /// <li>
164    /// <p><b>FullProtection</b> -- If the game session is in an <code>ACTIVE</code> status, it cannot be terminated during a scale-down event.</p></li>
165    /// </ul>
166    pub fn new_game_session_protection_policy(mut self, input: crate::types::ProtectionPolicy) -> Self {
167        self.inner = self.inner.new_game_session_protection_policy(input);
168        self
169    }
170    /// <p>The game session protection policy to apply to all new game sessions created in this fleet. Game sessions that already exist are not affected. You can set protection for individual game sessions using <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateGameSession.html">UpdateGameSession</a> .</p>
171    /// <ul>
172    /// <li>
173    /// <p><b>NoProtection</b> -- The game session can be terminated during a scale-down event.</p></li>
174    /// <li>
175    /// <p><b>FullProtection</b> -- If the game session is in an <code>ACTIVE</code> status, it cannot be terminated during a scale-down event.</p></li>
176    /// </ul>
177    pub fn set_new_game_session_protection_policy(mut self, input: ::std::option::Option<crate::types::ProtectionPolicy>) -> Self {
178        self.inner = self.inner.set_new_game_session_protection_policy(input);
179        self
180    }
181    /// <p>The game session protection policy to apply to all new game sessions created in this fleet. Game sessions that already exist are not affected. You can set protection for individual game sessions using <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateGameSession.html">UpdateGameSession</a> .</p>
182    /// <ul>
183    /// <li>
184    /// <p><b>NoProtection</b> -- The game session can be terminated during a scale-down event.</p></li>
185    /// <li>
186    /// <p><b>FullProtection</b> -- If the game session is in an <code>ACTIVE</code> status, it cannot be terminated during a scale-down event.</p></li>
187    /// </ul>
188    pub fn get_new_game_session_protection_policy(&self) -> &::std::option::Option<crate::types::ProtectionPolicy> {
189        self.inner.get_new_game_session_protection_policy()
190    }
191    /// <p>Policy settings that limit the number of game sessions an individual player can create over a span of time.</p>
192    pub fn resource_creation_limit_policy(mut self, input: crate::types::ResourceCreationLimitPolicy) -> Self {
193        self.inner = self.inner.resource_creation_limit_policy(input);
194        self
195    }
196    /// <p>Policy settings that limit the number of game sessions an individual player can create over a span of time.</p>
197    pub fn set_resource_creation_limit_policy(mut self, input: ::std::option::Option<crate::types::ResourceCreationLimitPolicy>) -> Self {
198        self.inner = self.inner.set_resource_creation_limit_policy(input);
199        self
200    }
201    /// <p>Policy settings that limit the number of game sessions an individual player can create over a span of time.</p>
202    pub fn get_resource_creation_limit_policy(&self) -> &::std::option::Option<crate::types::ResourceCreationLimitPolicy> {
203        self.inner.get_resource_creation_limit_policy()
204    }
205    ///
206    /// Appends an item to `MetricGroups`.
207    ///
208    /// To override the contents of this collection use [`set_metric_groups`](Self::set_metric_groups).
209    ///
210    /// <p>The name of a metric group to add this fleet to. Use a metric group in Amazon CloudWatch to aggregate the metrics from multiple fleets. Provide an existing metric group name, or create a new metric group by providing a new name. A fleet can only be in one metric group at a time.</p>
211    pub fn metric_groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212        self.inner = self.inner.metric_groups(input.into());
213        self
214    }
215    /// <p>The name of a metric group to add this fleet to. Use a metric group in Amazon CloudWatch to aggregate the metrics from multiple fleets. Provide an existing metric group name, or create a new metric group by providing a new name. A fleet can only be in one metric group at a time.</p>
216    pub fn set_metric_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
217        self.inner = self.inner.set_metric_groups(input);
218        self
219    }
220    /// <p>The name of a metric group to add this fleet to. Use a metric group in Amazon CloudWatch to aggregate the metrics from multiple fleets. Provide an existing metric group name, or create a new metric group by providing a new name. A fleet can only be in one metric group at a time.</p>
221    pub fn get_metric_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
222        self.inner.get_metric_groups()
223    }
224    /// <p>Amazon GameLift Servers Anywhere configuration options.</p>
225    pub fn anywhere_configuration(mut self, input: crate::types::AnywhereConfiguration) -> Self {
226        self.inner = self.inner.anywhere_configuration(input);
227        self
228    }
229    /// <p>Amazon GameLift Servers Anywhere configuration options.</p>
230    pub fn set_anywhere_configuration(mut self, input: ::std::option::Option<crate::types::AnywhereConfiguration>) -> Self {
231        self.inner = self.inner.set_anywhere_configuration(input);
232        self
233    }
234    /// <p>Amazon GameLift Servers Anywhere configuration options.</p>
235    pub fn get_anywhere_configuration(&self) -> &::std::option::Option<crate::types::AnywhereConfiguration> {
236        self.inner.get_anywhere_configuration()
237    }
238}