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::delete_game_server_group::_delete_game_server_group_input::DeleteGameServerGroupInputBuilder;

pub use crate::operation::delete_game_server_group::_delete_game_server_group_output::DeleteGameServerGroupOutputBuilder;

impl crate::operation::delete_game_server_group::builders::DeleteGameServerGroupInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::delete_game_server_group::DeleteGameServerGroupOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::delete_game_server_group::DeleteGameServerGroupError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.delete_game_server_group();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `DeleteGameServerGroup`.
///
/// <p><b>This API works with the following fleet types:</b> EC2 (FleetIQ)</p>
/// <p>Terminates a game server group and permanently deletes the game server group record. You have several options for how these resources are impacted when deleting the game server group. Depending on the type of delete operation selected, this operation might affect these resources:</p>
/// <ul>
/// <li>
/// <p>The game server group</p></li>
/// <li>
/// <p>The corresponding Auto Scaling group</p></li>
/// <li>
/// <p>All game servers that are currently running in the group</p></li>
/// </ul>
/// <p>To delete a game server group, identify the game server group to delete and specify the type of delete operation to initiate. Game server groups can only be deleted if they are in <code>ACTIVE</code> or <code>ERROR</code> status.</p>
/// <p>If the delete request is successful, a series of operations are kicked off. The game server group status is changed to <code>DELETE_SCHEDULED</code>, which prevents new game servers from being registered and stops automatic scaling activity. Once all game servers in the game server group are deregistered, Amazon GameLift Servers FleetIQ can begin deleting resources. If any of the delete operations fail, the game server group is placed in <code>ERROR</code> status.</p>
/// <p>Amazon GameLift Servers FleetIQ emits delete events to Amazon CloudWatch.</p>
/// <p><b>Learn more</b></p>
/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html">Amazon GameLift Servers FleetIQ Guide</a></p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct DeleteGameServerGroupFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::delete_game_server_group::builders::DeleteGameServerGroupInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::delete_game_server_group::DeleteGameServerGroupOutput,
        crate::operation::delete_game_server_group::DeleteGameServerGroupError,
    > for DeleteGameServerGroupFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::delete_game_server_group::DeleteGameServerGroupOutput,
            crate::operation::delete_game_server_group::DeleteGameServerGroupError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl DeleteGameServerGroupFluentBuilder {
    /// Creates a new `DeleteGameServerGroupFluentBuilder`.
    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 DeleteGameServerGroup as a reference.
    pub fn as_input(&self) -> &crate::operation::delete_game_server_group::builders::DeleteGameServerGroupInputBuilder {
        &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::delete_game_server_group::DeleteGameServerGroupOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::delete_game_server_group::DeleteGameServerGroupError,
            ::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::delete_game_server_group::DeleteGameServerGroup::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::delete_game_server_group::DeleteGameServerGroup::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::delete_game_server_group::DeleteGameServerGroupOutput,
        crate::operation::delete_game_server_group::DeleteGameServerGroupError,
        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 game server group. Use either the name or ARN value.</p>
    pub fn game_server_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.game_server_group_name(input.into());
        self
    }
    /// <p>A unique identifier for the game server group. Use either the name or ARN value.</p>
    pub fn set_game_server_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_game_server_group_name(input);
        self
    }
    /// <p>A unique identifier for the game server group. Use either the name or ARN value.</p>
    pub fn get_game_server_group_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_game_server_group_name()
    }
    /// <p>The type of delete to perform. Options include the following:</p>
    /// <ul>
    /// <li>
    /// <p><code>SAFE_DELETE</code> – (default) Terminates the game server group and Amazon EC2 Auto Scaling group only when it has no game servers that are in <code>UTILIZED</code> status.</p></li>
    /// <li>
    /// <p><code>FORCE_DELETE</code> – Terminates the game server group, including all active game servers regardless of their utilization status, and the Amazon EC2 Auto Scaling group.</p></li>
    /// <li>
    /// <p><code>RETAIN</code> – Does a safe delete of the game server group but retains the Amazon EC2 Auto Scaling group as is.</p></li>
    /// </ul>
    pub fn delete_option(mut self, input: crate::types::GameServerGroupDeleteOption) -> Self {
        self.inner = self.inner.delete_option(input);
        self
    }
    /// <p>The type of delete to perform. Options include the following:</p>
    /// <ul>
    /// <li>
    /// <p><code>SAFE_DELETE</code> – (default) Terminates the game server group and Amazon EC2 Auto Scaling group only when it has no game servers that are in <code>UTILIZED</code> status.</p></li>
    /// <li>
    /// <p><code>FORCE_DELETE</code> – Terminates the game server group, including all active game servers regardless of their utilization status, and the Amazon EC2 Auto Scaling group.</p></li>
    /// <li>
    /// <p><code>RETAIN</code> – Does a safe delete of the game server group but retains the Amazon EC2 Auto Scaling group as is.</p></li>
    /// </ul>
    pub fn set_delete_option(mut self, input: ::std::option::Option<crate::types::GameServerGroupDeleteOption>) -> Self {
        self.inner = self.inner.set_delete_option(input);
        self
    }
    /// <p>The type of delete to perform. Options include the following:</p>
    /// <ul>
    /// <li>
    /// <p><code>SAFE_DELETE</code> – (default) Terminates the game server group and Amazon EC2 Auto Scaling group only when it has no game servers that are in <code>UTILIZED</code> status.</p></li>
    /// <li>
    /// <p><code>FORCE_DELETE</code> – Terminates the game server group, including all active game servers regardless of their utilization status, and the Amazon EC2 Auto Scaling group.</p></li>
    /// <li>
    /// <p><code>RETAIN</code> – Does a safe delete of the game server group but retains the Amazon EC2 Auto Scaling group as is.</p></li>
    /// </ul>
    pub fn get_delete_option(&self) -> &::std::option::Option<crate::types::GameServerGroupDeleteOption> {
        self.inner.get_delete_option()
    }
}