aws_sdk_gamelift/operation/describe_compute/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_compute::_describe_compute_output::DescribeComputeOutputBuilder;
3
4pub use crate::operation::describe_compute::_describe_compute_input::DescribeComputeInputBuilder;
5
6impl crate::operation::describe_compute::builders::DescribeComputeInputBuilder {
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_compute::DescribeComputeOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_compute::DescribeComputeError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_compute();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeCompute`.
24///
25/// <p><b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p>
26/// <p>Retrieves properties for a specific compute resource in an Amazon GameLift Servers fleet. You can list all computes in a fleet by calling <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListCompute.html">ListCompute</a>.</p>
27/// <p><b>Request options</b></p>
28/// <p>Provide the fleet ID and compute name. The compute name varies depending on the type of fleet.</p>
29/// <ul>
30/// <li>
31/// <p>For a compute in a managed EC2 fleet, provide an instance ID. Each instance in the fleet is a compute.</p></li>
32/// <li>
33/// <p>For a compute in a managed container fleet, provide a compute name. In a container fleet, each game server container group on a fleet instance is assigned a compute name.</p></li>
34/// <li>
35/// <p>For a compute in an Anywhere fleet, provide a registered compute name. Anywhere fleet computes are created when you register a hosting resource with the fleet.</p></li>
36/// </ul>
37/// <p><b>Results</b></p>
38/// <p>If successful, this operation returns details for the requested compute resource. Depending on the fleet's compute type, the result includes the following information:</p>
39/// <ul>
40/// <li>
41/// <p>For a managed EC2 fleet, this operation returns information about the EC2 instance.</p></li>
42/// <li>
43/// <p>For an Anywhere fleet, this operation returns information about the registered compute.</p></li>
44/// </ul>
45#[derive(::std::clone::Clone, ::std::fmt::Debug)]
46pub struct DescribeComputeFluentBuilder {
47    handle: ::std::sync::Arc<crate::client::Handle>,
48    inner: crate::operation::describe_compute::builders::DescribeComputeInputBuilder,
49    config_override: ::std::option::Option<crate::config::Builder>,
50}
51impl
52    crate::client::customize::internal::CustomizableSend<
53        crate::operation::describe_compute::DescribeComputeOutput,
54        crate::operation::describe_compute::DescribeComputeError,
55    > for DescribeComputeFluentBuilder
56{
57    fn send(
58        self,
59        config_override: crate::config::Builder,
60    ) -> crate::client::customize::internal::BoxFuture<
61        crate::client::customize::internal::SendResult<
62            crate::operation::describe_compute::DescribeComputeOutput,
63            crate::operation::describe_compute::DescribeComputeError,
64        >,
65    > {
66        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
67    }
68}
69impl DescribeComputeFluentBuilder {
70    /// Creates a new `DescribeComputeFluentBuilder`.
71    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
72        Self {
73            handle,
74            inner: ::std::default::Default::default(),
75            config_override: ::std::option::Option::None,
76        }
77    }
78    /// Access the DescribeCompute as a reference.
79    pub fn as_input(&self) -> &crate::operation::describe_compute::builders::DescribeComputeInputBuilder {
80        &self.inner
81    }
82    /// Sends the request and returns the response.
83    ///
84    /// If an error occurs, an `SdkError` will be returned with additional details that
85    /// can be matched against.
86    ///
87    /// By default, any retryable failures will be retried twice. Retry behavior
88    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
89    /// set when configuring the client.
90    pub async fn send(
91        self,
92    ) -> ::std::result::Result<
93        crate::operation::describe_compute::DescribeComputeOutput,
94        ::aws_smithy_runtime_api::client::result::SdkError<
95            crate::operation::describe_compute::DescribeComputeError,
96            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
97        >,
98    > {
99        let input = self
100            .inner
101            .build()
102            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
103        let runtime_plugins = crate::operation::describe_compute::DescribeCompute::operation_runtime_plugins(
104            self.handle.runtime_plugins.clone(),
105            &self.handle.conf,
106            self.config_override,
107        );
108        crate::operation::describe_compute::DescribeCompute::orchestrate(&runtime_plugins, input).await
109    }
110
111    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
112    pub fn customize(
113        self,
114    ) -> crate::client::customize::CustomizableOperation<
115        crate::operation::describe_compute::DescribeComputeOutput,
116        crate::operation::describe_compute::DescribeComputeError,
117        Self,
118    > {
119        crate::client::customize::CustomizableOperation::new(self)
120    }
121    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
122        self.set_config_override(::std::option::Option::Some(config_override.into()));
123        self
124    }
125
126    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
127        self.config_override = config_override;
128        self
129    }
130    /// <p>A unique identifier for the fleet that the compute belongs to. You can use either the fleet ID or ARN value.</p>
131    pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.inner = self.inner.fleet_id(input.into());
133        self
134    }
135    /// <p>A unique identifier for the fleet that the compute belongs to. You can use either the fleet ID or ARN value.</p>
136    pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.inner = self.inner.set_fleet_id(input);
138        self
139    }
140    /// <p>A unique identifier for the fleet that the compute belongs to. You can use either the fleet ID or ARN value.</p>
141    pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
142        self.inner.get_fleet_id()
143    }
144    /// <p>The unique identifier of the compute resource to retrieve properties for. For a managed container fleet or Anywhere fleet, use a compute name. For an EC2 fleet, use an instance ID. To retrieve a fleet's compute identifiers, call <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListCompute.html">ListCompute</a>.</p>
145    pub fn compute_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.inner = self.inner.compute_name(input.into());
147        self
148    }
149    /// <p>The unique identifier of the compute resource to retrieve properties for. For a managed container fleet or Anywhere fleet, use a compute name. For an EC2 fleet, use an instance ID. To retrieve a fleet's compute identifiers, call <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListCompute.html">ListCompute</a>.</p>
150    pub fn set_compute_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.inner = self.inner.set_compute_name(input);
152        self
153    }
154    /// <p>The unique identifier of the compute resource to retrieve properties for. For a managed container fleet or Anywhere fleet, use a compute name. For an EC2 fleet, use an instance ID. To retrieve a fleet's compute identifiers, call <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListCompute.html">ListCompute</a>.</p>
155    pub fn get_compute_name(&self) -> &::std::option::Option<::std::string::String> {
156        self.inner.get_compute_name()
157    }
158}