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::list_compute::_list_compute_input::ListComputeInputBuilder;

pub use crate::operation::list_compute::_list_compute_output::ListComputeOutputBuilder;

impl crate::operation::list_compute::builders::ListComputeInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::list_compute::ListComputeOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::list_compute::ListComputeError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.list_compute();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `ListCompute`.
///
/// <p><b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p>
/// <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>
/// <p><b>Request options</b></p>
/// <ul>
/// <li>
/// <p>Retrieve a list of all computes in a fleet. Specify a fleet ID.</p></li>
/// <li>
/// <p>Retrieve a list of all computes in a specific fleet location. Specify a fleet ID and location.</p></li>
/// </ul>
/// <p><b>Results</b></p>
/// <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>
/// <ul>
/// <li>
/// <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>
/// <li>
/// <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>
/// </ul>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ListComputeFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::list_compute::builders::ListComputeInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::list_compute::ListComputeOutput,
        crate::operation::list_compute::ListComputeError,
    > for ListComputeFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::list_compute::ListComputeOutput,
            crate::operation::list_compute::ListComputeError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl ListComputeFluentBuilder {
    /// Creates a new `ListComputeFluentBuilder`.
    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 ListCompute as a reference.
    pub fn as_input(&self) -> &crate::operation::list_compute::builders::ListComputeInputBuilder {
        &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::list_compute::ListComputeOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::list_compute::ListComputeError,
            ::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::list_compute::ListCompute::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::list_compute::ListCompute::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::list_compute::ListComputeOutput,
        crate::operation::list_compute::ListComputeError,
        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
    }
    /// Create a paginator for this request
    ///
    /// 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).
    pub fn into_paginator(self) -> crate::operation::list_compute::paginator::ListComputePaginator {
        crate::operation::list_compute::paginator::ListComputePaginator::new(self.handle, self.inner)
    }
    /// <p>A unique identifier for the fleet to retrieve compute resources for.</p>
    pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.fleet_id(input.into());
        self
    }
    /// <p>A unique identifier for the fleet to retrieve compute resources for.</p>
    pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_fleet_id(input);
        self
    }
    /// <p>A unique identifier for the fleet to retrieve compute resources for.</p>
    pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_fleet_id()
    }
    /// <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>
    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 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>
    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 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>
    pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_location()
    }
    /// <p>For computes in a managed container fleet, the name of the deployed container group definition.</p>
    pub fn container_group_definition_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.container_group_definition_name(input.into());
        self
    }
    /// <p>For computes in a managed container fleet, the name of the deployed container group definition.</p>
    pub fn set_container_group_definition_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_container_group_definition_name(input);
        self
    }
    /// <p>For computes in a managed container fleet, the name of the deployed container group definition.</p>
    pub fn get_container_group_definition_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_container_group_definition_name()
    }
    /// <p>The status of computes in a managed container fleet, based on the success of the latest update deployment.</p>
    /// <ul>
    /// <li>
    /// <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>
    /// <li>
    /// <p><code>IMPAIRED</code> -- An update deployment to the compute failed, and the compute is deployed with incorrect container definitions.</p></li>
    /// </ul>
    pub fn compute_status(mut self, input: crate::types::ListComputeInputStatus) -> Self {
        self.inner = self.inner.compute_status(input);
        self
    }
    /// <p>The status of computes in a managed container fleet, based on the success of the latest update deployment.</p>
    /// <ul>
    /// <li>
    /// <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>
    /// <li>
    /// <p><code>IMPAIRED</code> -- An update deployment to the compute failed, and the compute is deployed with incorrect container definitions.</p></li>
    /// </ul>
    pub fn set_compute_status(mut self, input: ::std::option::Option<crate::types::ListComputeInputStatus>) -> Self {
        self.inner = self.inner.set_compute_status(input);
        self
    }
    /// <p>The status of computes in a managed container fleet, based on the success of the latest update deployment.</p>
    /// <ul>
    /// <li>
    /// <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>
    /// <li>
    /// <p><code>IMPAIRED</code> -- An update deployment to the compute failed, and the compute is deployed with incorrect container definitions.</p></li>
    /// </ul>
    pub fn get_compute_status(&self) -> &::std::option::Option<crate::types::ListComputeInputStatus> {
        self.inner.get_compute_status()
    }
    /// <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>
    pub fn limit(mut self, input: i32) -> Self {
        self.inner = self.inner.limit(input);
        self
    }
    /// <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>
    pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_limit(input);
        self
    }
    /// <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>
    pub fn get_limit(&self) -> &::std::option::Option<i32> {
        self.inner.get_limit()
    }
    /// <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>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.next_token(input.into());
        self
    }
    /// <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>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_next_token(input);
        self
    }
    /// <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>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_next_token()
    }
}