aws_sdk_gamelift/operation/list_compute/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_compute::_list_compute_output::ListComputeOutputBuilder;
3
4pub use crate::operation::list_compute::_list_compute_input::ListComputeInputBuilder;
5
6impl crate::operation::list_compute::builders::ListComputeInputBuilder {
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::list_compute::ListComputeOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_compute::ListComputeError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_compute();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListCompute`.
24///
25/// <p><b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p>
26/// <p>Retrieves information on the compute resources in an Amazon GameLift Servers fleet. Use the pagination parameters to retrieve results in a set of sequential pages.</p>
27/// <p><b>Request options</b></p>
28/// <ul>
29/// <li>
30/// <p>Retrieve a list of all computes in a fleet. Specify a fleet ID.</p></li>
31/// <li>
32/// <p>Retrieve a list of all computes in a specific fleet location. Specify a fleet ID and location.</p></li>
33/// </ul>
34/// <p><b>Results</b></p>
35/// <p>If successful, this operation returns information on a set of computes. Depending on the type of fleet, the result includes the following information:</p>
36/// <ul>
37/// <li>
38/// <p>For a managed EC2 fleet (compute type <code>EC2</code>), this operation returns information about the EC2 instance. Compute names are EC2 instance IDs.</p></li>
39/// <li>
40/// <p>For an Anywhere fleet (compute type <code>ANYWHERE</code>), this operation returns compute names and details from when the compute was registered with <code>RegisterCompute</code>. This includes <code>GameLiftServiceSdkEndpoint</code> or <code>GameLiftAgentEndpoint</code>.</p></li>
41/// </ul>
42#[derive(::std::clone::Clone, ::std::fmt::Debug)]
43pub struct ListComputeFluentBuilder {
44    handle: ::std::sync::Arc<crate::client::Handle>,
45    inner: crate::operation::list_compute::builders::ListComputeInputBuilder,
46    config_override: ::std::option::Option<crate::config::Builder>,
47}
48impl
49    crate::client::customize::internal::CustomizableSend<
50        crate::operation::list_compute::ListComputeOutput,
51        crate::operation::list_compute::ListComputeError,
52    > for ListComputeFluentBuilder
53{
54    fn send(
55        self,
56        config_override: crate::config::Builder,
57    ) -> crate::client::customize::internal::BoxFuture<
58        crate::client::customize::internal::SendResult<
59            crate::operation::list_compute::ListComputeOutput,
60            crate::operation::list_compute::ListComputeError,
61        >,
62    > {
63        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
64    }
65}
66impl ListComputeFluentBuilder {
67    /// Creates a new `ListComputeFluentBuilder`.
68    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
69        Self {
70            handle,
71            inner: ::std::default::Default::default(),
72            config_override: ::std::option::Option::None,
73        }
74    }
75    /// Access the ListCompute as a reference.
76    pub fn as_input(&self) -> &crate::operation::list_compute::builders::ListComputeInputBuilder {
77        &self.inner
78    }
79    /// Sends the request and returns the response.
80    ///
81    /// If an error occurs, an `SdkError` will be returned with additional details that
82    /// can be matched against.
83    ///
84    /// By default, any retryable failures will be retried twice. Retry behavior
85    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
86    /// set when configuring the client.
87    pub async fn send(
88        self,
89    ) -> ::std::result::Result<
90        crate::operation::list_compute::ListComputeOutput,
91        ::aws_smithy_runtime_api::client::result::SdkError<
92            crate::operation::list_compute::ListComputeError,
93            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
94        >,
95    > {
96        let input = self
97            .inner
98            .build()
99            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
100        let runtime_plugins = crate::operation::list_compute::ListCompute::operation_runtime_plugins(
101            self.handle.runtime_plugins.clone(),
102            &self.handle.conf,
103            self.config_override,
104        );
105        crate::operation::list_compute::ListCompute::orchestrate(&runtime_plugins, input).await
106    }
107
108    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
109    pub fn customize(
110        self,
111    ) -> crate::client::customize::CustomizableOperation<
112        crate::operation::list_compute::ListComputeOutput,
113        crate::operation::list_compute::ListComputeError,
114        Self,
115    > {
116        crate::client::customize::CustomizableOperation::new(self)
117    }
118    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
119        self.set_config_override(::std::option::Option::Some(config_override.into()));
120        self
121    }
122
123    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
124        self.config_override = config_override;
125        self
126    }
127    /// Create a paginator for this request
128    ///
129    /// Paginators are used by calling [`send().await`](crate::operation::list_compute::paginator::ListComputePaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
130    pub fn into_paginator(self) -> crate::operation::list_compute::paginator::ListComputePaginator {
131        crate::operation::list_compute::paginator::ListComputePaginator::new(self.handle, self.inner)
132    }
133    /// <p>A unique identifier for the fleet to retrieve compute resources for.</p>
134    pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.fleet_id(input.into());
136        self
137    }
138    /// <p>A unique identifier for the fleet to retrieve compute resources for.</p>
139    pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_fleet_id(input);
141        self
142    }
143    /// <p>A unique identifier for the fleet to retrieve compute resources for.</p>
144    pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_fleet_id()
146    }
147    /// <p>The name of a location to retrieve compute resources for. For an Amazon GameLift Servers Anywhere fleet, use a custom location. For a managed fleet, provide a Amazon Web Services Region or Local Zone code (for example: <code>us-west-2</code> or <code>us-west-2-lax-1</code>).</p>
148    pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.inner = self.inner.location(input.into());
150        self
151    }
152    /// <p>The name of a location to retrieve compute resources for. For an Amazon GameLift Servers Anywhere fleet, use a custom location. For a managed fleet, provide a Amazon Web Services Region or Local Zone code (for example: <code>us-west-2</code> or <code>us-west-2-lax-1</code>).</p>
153    pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_location(input);
155        self
156    }
157    /// <p>The name of a location to retrieve compute resources for. For an Amazon GameLift Servers Anywhere fleet, use a custom location. For a managed fleet, provide a Amazon Web Services Region or Local Zone code (for example: <code>us-west-2</code> or <code>us-west-2-lax-1</code>).</p>
158    pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_location()
160    }
161    /// <p>For computes in a managed container fleet, the name of the deployed container group definition.</p>
162    pub fn container_group_definition_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.container_group_definition_name(input.into());
164        self
165    }
166    /// <p>For computes in a managed container fleet, the name of the deployed container group definition.</p>
167    pub fn set_container_group_definition_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_container_group_definition_name(input);
169        self
170    }
171    /// <p>For computes in a managed container fleet, the name of the deployed container group definition.</p>
172    pub fn get_container_group_definition_name(&self) -> &::std::option::Option<::std::string::String> {
173        self.inner.get_container_group_definition_name()
174    }
175    /// <p>The status of computes in a managed container fleet, based on the success of the latest update deployment.</p>
176    /// <ul>
177    /// <li>
178    /// <p><code>ACTIVE</code> -- The compute is deployed with the correct container definitions. It is ready to process game servers and host game sessions.</p></li>
179    /// <li>
180    /// <p><code>IMPAIRED</code> -- An update deployment to the compute failed, and the compute is deployed with incorrect container definitions.</p></li>
181    /// </ul>
182    pub fn compute_status(mut self, input: crate::types::ListComputeInputStatus) -> Self {
183        self.inner = self.inner.compute_status(input);
184        self
185    }
186    /// <p>The status of computes in a managed container fleet, based on the success of the latest update deployment.</p>
187    /// <ul>
188    /// <li>
189    /// <p><code>ACTIVE</code> -- The compute is deployed with the correct container definitions. It is ready to process game servers and host game sessions.</p></li>
190    /// <li>
191    /// <p><code>IMPAIRED</code> -- An update deployment to the compute failed, and the compute is deployed with incorrect container definitions.</p></li>
192    /// </ul>
193    pub fn set_compute_status(mut self, input: ::std::option::Option<crate::types::ListComputeInputStatus>) -> Self {
194        self.inner = self.inner.set_compute_status(input);
195        self
196    }
197    /// <p>The status of computes in a managed container fleet, based on the success of the latest update deployment.</p>
198    /// <ul>
199    /// <li>
200    /// <p><code>ACTIVE</code> -- The compute is deployed with the correct container definitions. It is ready to process game servers and host game sessions.</p></li>
201    /// <li>
202    /// <p><code>IMPAIRED</code> -- An update deployment to the compute failed, and the compute is deployed with incorrect container definitions.</p></li>
203    /// </ul>
204    pub fn get_compute_status(&self) -> &::std::option::Option<crate::types::ListComputeInputStatus> {
205        self.inner.get_compute_status()
206    }
207    /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages.</p>
208    pub fn limit(mut self, input: i32) -> Self {
209        self.inner = self.inner.limit(input);
210        self
211    }
212    /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages.</p>
213    pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
214        self.inner = self.inner.set_limit(input);
215        self
216    }
217    /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages.</p>
218    pub fn get_limit(&self) -> &::std::option::Option<i32> {
219        self.inner.get_limit()
220    }
221    /// <p>A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.</p>
222    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
223        self.inner = self.inner.next_token(input.into());
224        self
225    }
226    /// <p>A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.</p>
227    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
228        self.inner = self.inner.set_next_token(input);
229        self
230    }
231    /// <p>A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.</p>
232    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
233        self.inner.get_next_token()
234    }
235}