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