aws_sdk_gamelift/operation/describe_fleet_location_capacity/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_fleet_location_capacity::_describe_fleet_location_capacity_output::DescribeFleetLocationCapacityOutputBuilder;
3
4pub use crate::operation::describe_fleet_location_capacity::_describe_fleet_location_capacity_input::DescribeFleetLocationCapacityInputBuilder;
5
6impl crate::operation::describe_fleet_location_capacity::builders::DescribeFleetLocationCapacityInputBuilder {
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_fleet_location_capacity::DescribeFleetLocationCapacityOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_fleet_location_capacity::DescribeFleetLocationCapacityError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_fleet_location_capacity();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeFleetLocationCapacity`.
24///
25/// <p>Retrieves the resource capacity settings for a fleet location. The data returned includes the current capacity (number of EC2 instances) and some scaling settings for the requested fleet location. For a managed container fleet, this operation also returns counts for game server container groups.</p>
26/// <p>Use this operation to retrieve capacity information for a fleet's remote location or home Region (you can also retrieve home Region capacity by calling <code>DescribeFleetCapacity</code>).</p>
27/// <p>To retrieve capacity data, identify a fleet and location.</p>
28/// <p>If successful, a <code>FleetCapacity</code> object is returned for the requested fleet location.</p>
29/// <p><b>Learn more</b></p>
30/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html">Setting up Amazon GameLift Servers fleets</a></p>
31/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-regions.html"> Amazon GameLift Servers service locations</a> for managed hosting</p>
32/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html#gamelift-metrics-fleet">GameLift metrics for fleets</a></p>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct DescribeFleetLocationCapacityFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::describe_fleet_location_capacity::builders::DescribeFleetLocationCapacityInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::describe_fleet_location_capacity::DescribeFleetLocationCapacityOutput,
42        crate::operation::describe_fleet_location_capacity::DescribeFleetLocationCapacityError,
43    > for DescribeFleetLocationCapacityFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::describe_fleet_location_capacity::DescribeFleetLocationCapacityOutput,
51            crate::operation::describe_fleet_location_capacity::DescribeFleetLocationCapacityError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl DescribeFleetLocationCapacityFluentBuilder {
58    /// Creates a new `DescribeFleetLocationCapacityFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the DescribeFleetLocationCapacity as a reference.
67    pub fn as_input(&self) -> &crate::operation::describe_fleet_location_capacity::builders::DescribeFleetLocationCapacityInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::describe_fleet_location_capacity::DescribeFleetLocationCapacityOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::describe_fleet_location_capacity::DescribeFleetLocationCapacityError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::describe_fleet_location_capacity::DescribeFleetLocationCapacity::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::describe_fleet_location_capacity::DescribeFleetLocationCapacity::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::describe_fleet_location_capacity::DescribeFleetLocationCapacityOutput,
104        crate::operation::describe_fleet_location_capacity::DescribeFleetLocationCapacityError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    /// <p>A unique identifier for the fleet to request location capacity for. You can use either the fleet ID or ARN value.</p>
119    pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.fleet_id(input.into());
121        self
122    }
123    /// <p>A unique identifier for the fleet to request location capacity for. You can use either the fleet ID or ARN value.</p>
124    pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_fleet_id(input);
126        self
127    }
128    /// <p>A unique identifier for the fleet to request location capacity for. You can use either the fleet ID or ARN value.</p>
129    pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_fleet_id()
131    }
132    /// <p>The fleet location to retrieve capacity information for. Specify a location in the form of an Amazon Web Services Region code, such as <code>us-west-2</code>.</p>
133    pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.location(input.into());
135        self
136    }
137    /// <p>The fleet location to retrieve capacity information for. Specify a location in the form of an Amazon Web Services Region code, such as <code>us-west-2</code>.</p>
138    pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_location(input);
140        self
141    }
142    /// <p>The fleet location to retrieve capacity information for. Specify a location in the form of an Amazon Web Services Region code, such as <code>us-west-2</code>.</p>
143    pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_location()
145    }
146}