aws-sdk-gamelift 1.119.0

AWS SDK for Amazon GameLift
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_fleet_attributes::_update_fleet_attributes_input::UpdateFleetAttributesInputBuilder;

pub use crate::operation::update_fleet_attributes::_update_fleet_attributes_output::UpdateFleetAttributesOutputBuilder;

impl crate::operation::update_fleet_attributes::builders::UpdateFleetAttributesInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::update_fleet_attributes::UpdateFleetAttributesOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_fleet_attributes::UpdateFleetAttributesError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.update_fleet_attributes();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `UpdateFleetAttributes`.
///
/// <p><b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p>
/// <p>Updates a fleet's mutable attributes, such as game session protection and resource creation limits.</p>
/// <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>
/// <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>
/// </note>
/// <p><b>Learn more</b></p>
/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html">Setting up Amazon GameLift Servers fleets</a></p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateFleetAttributesFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::update_fleet_attributes::builders::UpdateFleetAttributesInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::update_fleet_attributes::UpdateFleetAttributesOutput,
        crate::operation::update_fleet_attributes::UpdateFleetAttributesError,
    > for UpdateFleetAttributesFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::update_fleet_attributes::UpdateFleetAttributesOutput,
            crate::operation::update_fleet_attributes::UpdateFleetAttributesError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl UpdateFleetAttributesFluentBuilder {
    /// Creates a new `UpdateFleetAttributesFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the UpdateFleetAttributes as a reference.
    pub fn as_input(&self) -> &crate::operation::update_fleet_attributes::builders::UpdateFleetAttributesInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::update_fleet_attributes::UpdateFleetAttributesOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_fleet_attributes::UpdateFleetAttributesError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::update_fleet_attributes::UpdateFleetAttributes::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::update_fleet_attributes::UpdateFleetAttributes::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::update_fleet_attributes::UpdateFleetAttributesOutput,
        crate::operation::update_fleet_attributes::UpdateFleetAttributesError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>A unique identifier for the fleet to update attribute metadata for. You can use either the fleet ID or ARN value.</p>
    pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.fleet_id(input.into());
        self
    }
    /// <p>A unique identifier for the fleet to update attribute metadata for. You can use either the fleet ID or ARN value.</p>
    pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_fleet_id(input);
        self
    }
    /// <p>A unique identifier for the fleet to update attribute metadata for. You can use either the fleet ID or ARN value.</p>
    pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_fleet_id()
    }
    /// <p>A descriptive label that is associated with a fleet. Fleet names do not need to be unique.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// <p>A descriptive label that is associated with a fleet. Fleet names do not need to be unique.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// <p>A descriptive label that is associated with a fleet. Fleet names do not need to be unique.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>A human-readable description of a fleet.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// <p>A human-readable description of a fleet.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// <p>A human-readable description of a fleet.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// <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>
    /// <ul>
    /// <li>
    /// <p><b>NoProtection</b> -- The game session can be terminated during a scale-down event.</p></li>
    /// <li>
    /// <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>
    /// </ul>
    pub fn new_game_session_protection_policy(mut self, input: crate::types::ProtectionPolicy) -> Self {
        self.inner = self.inner.new_game_session_protection_policy(input);
        self
    }
    /// <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>
    /// <ul>
    /// <li>
    /// <p><b>NoProtection</b> -- The game session can be terminated during a scale-down event.</p></li>
    /// <li>
    /// <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>
    /// </ul>
    pub fn set_new_game_session_protection_policy(mut self, input: ::std::option::Option<crate::types::ProtectionPolicy>) -> Self {
        self.inner = self.inner.set_new_game_session_protection_policy(input);
        self
    }
    /// <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>
    /// <ul>
    /// <li>
    /// <p><b>NoProtection</b> -- The game session can be terminated during a scale-down event.</p></li>
    /// <li>
    /// <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>
    /// </ul>
    pub fn get_new_game_session_protection_policy(&self) -> &::std::option::Option<crate::types::ProtectionPolicy> {
        self.inner.get_new_game_session_protection_policy()
    }
    /// <p>Policy settings that limit the number of game sessions an individual player can create over a span of time.</p>
    pub fn resource_creation_limit_policy(mut self, input: crate::types::ResourceCreationLimitPolicy) -> Self {
        self.inner = self.inner.resource_creation_limit_policy(input);
        self
    }
    /// <p>Policy settings that limit the number of game sessions an individual player can create over a span of time.</p>
    pub fn set_resource_creation_limit_policy(mut self, input: ::std::option::Option<crate::types::ResourceCreationLimitPolicy>) -> Self {
        self.inner = self.inner.set_resource_creation_limit_policy(input);
        self
    }
    /// <p>Policy settings that limit the number of game sessions an individual player can create over a span of time.</p>
    pub fn get_resource_creation_limit_policy(&self) -> &::std::option::Option<crate::types::ResourceCreationLimitPolicy> {
        self.inner.get_resource_creation_limit_policy()
    }
    ///
    /// Appends an item to `MetricGroups`.
    ///
    /// To override the contents of this collection use [`set_metric_groups`](Self::set_metric_groups).
    ///
    /// <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>
    pub fn metric_groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.metric_groups(input.into());
        self
    }
    /// <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>
    pub fn set_metric_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_metric_groups(input);
        self
    }
    /// <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>
    pub fn get_metric_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_metric_groups()
    }
    /// <p>Amazon GameLift Servers Anywhere configuration options.</p>
    pub fn anywhere_configuration(mut self, input: crate::types::AnywhereConfiguration) -> Self {
        self.inner = self.inner.anywhere_configuration(input);
        self
    }
    /// <p>Amazon GameLift Servers Anywhere configuration options.</p>
    pub fn set_anywhere_configuration(mut self, input: ::std::option::Option<crate::types::AnywhereConfiguration>) -> Self {
        self.inner = self.inner.set_anywhere_configuration(input);
        self
    }
    /// <p>Amazon GameLift Servers Anywhere configuration options.</p>
    pub fn get_anywhere_configuration(&self) -> &::std::option::Option<crate::types::AnywhereConfiguration> {
        self.inner.get_anywhere_configuration()
    }
}