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::describe_ec2_instance_limits::_describe_ec2_instance_limits_input::DescribeEc2InstanceLimitsInputBuilder;

pub use crate::operation::describe_ec2_instance_limits::_describe_ec2_instance_limits_output::DescribeEc2InstanceLimitsOutputBuilder;

impl crate::operation::describe_ec2_instance_limits::builders::DescribeEc2InstanceLimitsInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::describe_ec2_instance_limits::DescribeEc2InstanceLimitsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::describe_ec2_instance_limits::DescribeEC2InstanceLimitsError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.describe_ec2_instance_limits();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `DescribeEC2InstanceLimits`.
///
/// <p><b>This API works with the following fleet types:</b> EC2</p>
/// <p>Retrieves the instance limits and current utilization for an Amazon Web Services Region or location. Instance limits control the number of instances, per instance type, per location, that your Amazon Web Services account can use. Learn more at <a href="http://aws.amazon.com/ec2/instance-types/">Amazon EC2 Instance Types</a>. The information returned includes the maximum number of instances allowed and your account's current usage across all fleets. This information can affect your ability to scale your Amazon GameLift Servers fleets. You can request a limit increase for your account by using the <b>Service limits</b> page in the Amazon GameLift Servers console.</p>
/// <p>Instance limits differ based on whether the instances are deployed in a fleet's home Region or in a remote location. For remote locations, limits also differ based on the combination of home Region and remote location. All requests must specify an Amazon Web Services Region (either explicitly or as your default settings). To get the limit for a remote location, you must also specify the location. To learn more about how Amazon GameLift Servers handles locations, see <a href="https://docs.aws.amazon.com/gameliftservers/latest/developerguide/gamelift-regions.html">Amazon GameLift Servers service locations</a>. For example, the following requests all return different results:</p>
/// <ul>
/// <li>
/// <p>Request specifies the Region <code>ap-northeast-1</code> with no location. The result is limits and usage data on all of the fleets that reside in <code>ap-northeast-1</code>, for all instance types that are deployed in <code>ap-northeast-1</code>.</p></li>
/// <li>
/// <p>Request specifies the Region <code>ap-northeast-1</code> with location <code>us-west-2</code>. The result is limits and usage data on all of the fleets that reside in <code>ap-northeast-1</code>, for all instance types that are deployed in <code>us-west-2</code>.</p></li>
/// <li>
/// <p>Request specifies the Region <code>us-east-1</code> with location <code>ap-northeast-1</code>. The result is limits and usage data on all of the fleets that reside in <code>us-east-1</code>, for all instance types that are deployed in <code>ap-northeast-1</code>. These limits do not affect fleets in any other Regions that deploy instances to <code>ap-northeast-1</code>.</p></li>
/// </ul>
/// <p>This operation can be used in the following ways:</p>
/// <ul>
/// <li>
/// <p>To get limit and usage data for all instance types that are deployed in an Amazon Web Services Region by fleets that reside in the same Region: Specify the Region only. Optionally, specify a single instance type to retrieve information for.</p></li>
/// <li>
/// <p>To get limit and usage data for all instance types that are deployed to a remote location by fleets that reside in different Amazon Web Services Region: Provide both the Amazon Web Services Region and the remote location. Optionally, specify a single instance type to retrieve information for.</p></li>
/// </ul>
/// <p>If successful, an <code>EC2InstanceLimits</code> object is returned with limits and usage data for each requested instance type.</p>
/// <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 DescribeEC2InstanceLimitsFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::describe_ec2_instance_limits::builders::DescribeEc2InstanceLimitsInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::describe_ec2_instance_limits::DescribeEc2InstanceLimitsOutput,
        crate::operation::describe_ec2_instance_limits::DescribeEC2InstanceLimitsError,
    > for DescribeEC2InstanceLimitsFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::describe_ec2_instance_limits::DescribeEc2InstanceLimitsOutput,
            crate::operation::describe_ec2_instance_limits::DescribeEC2InstanceLimitsError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl DescribeEC2InstanceLimitsFluentBuilder {
    /// Creates a new `DescribeEC2InstanceLimitsFluentBuilder`.
    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 DescribeEC2InstanceLimits as a reference.
    pub fn as_input(&self) -> &crate::operation::describe_ec2_instance_limits::builders::DescribeEc2InstanceLimitsInputBuilder {
        &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::describe_ec2_instance_limits::DescribeEc2InstanceLimitsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::describe_ec2_instance_limits::DescribeEC2InstanceLimitsError,
            ::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::describe_ec2_instance_limits::DescribeEC2InstanceLimits::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::describe_ec2_instance_limits::DescribeEC2InstanceLimits::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::describe_ec2_instance_limits::DescribeEc2InstanceLimitsOutput,
        crate::operation::describe_ec2_instance_limits::DescribeEC2InstanceLimitsError,
        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>Name of an Amazon EC2 instance type that is supported in Amazon GameLift Servers. A fleet instance type determines the computing resources of each instance in the fleet, including CPU, memory, storage, and networking capacity. Do not specify a value for this parameter to retrieve limits for all instance types.</p>
    pub fn ec2_instance_type(mut self, input: crate::types::Ec2InstanceType) -> Self {
        self.inner = self.inner.ec2_instance_type(input);
        self
    }
    /// <p>Name of an Amazon EC2 instance type that is supported in Amazon GameLift Servers. A fleet instance type determines the computing resources of each instance in the fleet, including CPU, memory, storage, and networking capacity. Do not specify a value for this parameter to retrieve limits for all instance types.</p>
    pub fn set_ec2_instance_type(mut self, input: ::std::option::Option<crate::types::Ec2InstanceType>) -> Self {
        self.inner = self.inner.set_ec2_instance_type(input);
        self
    }
    /// <p>Name of an Amazon EC2 instance type that is supported in Amazon GameLift Servers. A fleet instance type determines the computing resources of each instance in the fleet, including CPU, memory, storage, and networking capacity. Do not specify a value for this parameter to retrieve limits for all instance types.</p>
    pub fn get_ec2_instance_type(&self) -> &::std::option::Option<crate::types::Ec2InstanceType> {
        self.inner.get_ec2_instance_type()
    }
    /// <p>The name of a remote location to request instance limits for, in the form of an Amazon Web Services Region code such as <code>us-west-2</code>.</p>
    pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.location(input.into());
        self
    }
    /// <p>The name of a remote location to request instance limits for, in the form of an Amazon Web Services Region code such as <code>us-west-2</code>.</p>
    pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_location(input);
        self
    }
    /// <p>The name of a remote location to request instance limits for, in the form of an Amazon Web Services Region code such as <code>us-west-2</code>.</p>
    pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_location()
    }
}