aws_sdk_gamelift/operation/describe_ec2_instance_limits/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_ec2_instance_limits::_describe_ec2_instance_limits_output::DescribeEc2InstanceLimitsOutputBuilder;
3
4pub use crate::operation::describe_ec2_instance_limits::_describe_ec2_instance_limits_input::DescribeEc2InstanceLimitsInputBuilder;
5
6impl crate::operation::describe_ec2_instance_limits::builders::DescribeEc2InstanceLimitsInputBuilder {
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::describe_ec2_instance_limits::DescribeEc2InstanceLimitsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_ec2_instance_limits::DescribeEC2InstanceLimitsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_ec2_instance_limits();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeEC2InstanceLimits`.
24///
25/// <p><b>This API works with the following fleet types:</b> EC2</p>
26/// <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>
27/// <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. For example, the following requests all return different results:</p>
28/// <ul>
29/// <li>
30/// <p>Request specifies the Region <code>ap-northeast-1</code> with no location. The result is limits and usage data on all instance types that are deployed in <code>us-east-2</code>, by all of the fleets that reside in <code>ap-northeast-1</code>.</p></li>
31/// <li>
32/// <p>Request specifies the Region <code>us-east-1</code> with location <code>ca-central-1</code>. The result is limits and usage data on all instance types that are deployed in <code>ca-central-1</code>, by all of the fleets that reside in <code>us-east-2</code>. These limits do not affect fleets in any other Regions that deploy instances to <code>ca-central-1</code>.</p></li>
33/// <li>
34/// <p>Request specifies the Region <code>eu-west-1</code> with location <code>ca-central-1</code>. The result is limits and usage data on all instance types that are deployed in <code>ca-central-1</code>, by all of the fleets that reside in <code>eu-west-1</code>.</p></li>
35/// </ul>
36/// <p>This operation can be used in the following ways:</p>
37/// <ul>
38/// <li>
39/// <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>
40/// <li>
41/// <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>
42/// </ul>
43/// <p>If successful, an <code>EC2InstanceLimits</code> object is returned with limits and usage data for each requested instance type.</p>
44/// <p><b>Learn more</b></p>
45/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html">Setting up Amazon GameLift Servers fleets</a></p>
46#[derive(::std::clone::Clone, ::std::fmt::Debug)]
47pub struct DescribeEC2InstanceLimitsFluentBuilder {
48    handle: ::std::sync::Arc<crate::client::Handle>,
49    inner: crate::operation::describe_ec2_instance_limits::builders::DescribeEc2InstanceLimitsInputBuilder,
50    config_override: ::std::option::Option<crate::config::Builder>,
51}
52impl
53    crate::client::customize::internal::CustomizableSend<
54        crate::operation::describe_ec2_instance_limits::DescribeEc2InstanceLimitsOutput,
55        crate::operation::describe_ec2_instance_limits::DescribeEC2InstanceLimitsError,
56    > for DescribeEC2InstanceLimitsFluentBuilder
57{
58    fn send(
59        self,
60        config_override: crate::config::Builder,
61    ) -> crate::client::customize::internal::BoxFuture<
62        crate::client::customize::internal::SendResult<
63            crate::operation::describe_ec2_instance_limits::DescribeEc2InstanceLimitsOutput,
64            crate::operation::describe_ec2_instance_limits::DescribeEC2InstanceLimitsError,
65        >,
66    > {
67        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
68    }
69}
70impl DescribeEC2InstanceLimitsFluentBuilder {
71    /// Creates a new `DescribeEC2InstanceLimitsFluentBuilder`.
72    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
73        Self {
74            handle,
75            inner: ::std::default::Default::default(),
76            config_override: ::std::option::Option::None,
77        }
78    }
79    /// Access the DescribeEC2InstanceLimits as a reference.
80    pub fn as_input(&self) -> &crate::operation::describe_ec2_instance_limits::builders::DescribeEc2InstanceLimitsInputBuilder {
81        &self.inner
82    }
83    /// Sends the request and returns the response.
84    ///
85    /// If an error occurs, an `SdkError` will be returned with additional details that
86    /// can be matched against.
87    ///
88    /// By default, any retryable failures will be retried twice. Retry behavior
89    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
90    /// set when configuring the client.
91    pub async fn send(
92        self,
93    ) -> ::std::result::Result<
94        crate::operation::describe_ec2_instance_limits::DescribeEc2InstanceLimitsOutput,
95        ::aws_smithy_runtime_api::client::result::SdkError<
96            crate::operation::describe_ec2_instance_limits::DescribeEC2InstanceLimitsError,
97            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
98        >,
99    > {
100        let input = self
101            .inner
102            .build()
103            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
104        let runtime_plugins = crate::operation::describe_ec2_instance_limits::DescribeEC2InstanceLimits::operation_runtime_plugins(
105            self.handle.runtime_plugins.clone(),
106            &self.handle.conf,
107            self.config_override,
108        );
109        crate::operation::describe_ec2_instance_limits::DescribeEC2InstanceLimits::orchestrate(&runtime_plugins, input).await
110    }
111
112    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
113    pub fn customize(
114        self,
115    ) -> crate::client::customize::CustomizableOperation<
116        crate::operation::describe_ec2_instance_limits::DescribeEc2InstanceLimitsOutput,
117        crate::operation::describe_ec2_instance_limits::DescribeEC2InstanceLimitsError,
118        Self,
119    > {
120        crate::client::customize::CustomizableOperation::new(self)
121    }
122    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
123        self.set_config_override(::std::option::Option::Some(config_override.into()));
124        self
125    }
126
127    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
128        self.config_override = config_override;
129        self
130    }
131    /// <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>
132    pub fn ec2_instance_type(mut self, input: crate::types::Ec2InstanceType) -> Self {
133        self.inner = self.inner.ec2_instance_type(input);
134        self
135    }
136    /// <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>
137    pub fn set_ec2_instance_type(mut self, input: ::std::option::Option<crate::types::Ec2InstanceType>) -> Self {
138        self.inner = self.inner.set_ec2_instance_type(input);
139        self
140    }
141    /// <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>
142    pub fn get_ec2_instance_type(&self) -> &::std::option::Option<crate::types::Ec2InstanceType> {
143        self.inner.get_ec2_instance_type()
144    }
145    /// <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>
146    pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.location(input.into());
148        self
149    }
150    /// <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>
151    pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_location(input);
153        self
154    }
155    /// <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>
156    pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
157        self.inner.get_location()
158    }
159}