aws_sdk_gamelift/operation/get_compute_access/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_compute_access::_get_compute_access_output::GetComputeAccessOutputBuilder;
3
4pub use crate::operation::get_compute_access::_get_compute_access_input::GetComputeAccessInputBuilder;
5
6impl crate::operation::get_compute_access::builders::GetComputeAccessInputBuilder {
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::get_compute_access::GetComputeAccessOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_compute_access::GetComputeAccessError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_compute_access();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetComputeAccess`.
24///
25/// <p>Requests authorization to remotely connect to a hosting resource in a Amazon GameLift Servers managed fleet. This operation is not used with Amazon GameLift Servers Anywhere fleets.</p>
26/// <p><b>Request options</b></p>
27/// <p>Provide the fleet ID and compute name. The compute name varies depending on the type of fleet.</p>
28/// <ul>
29/// <li>
30/// <p>For a compute in a managed EC2 fleet, provide an instance ID. Each instance in the fleet is a compute.</p></li>
31/// <li>
32/// <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>
33/// </ul>
34/// <p><b>Results</b></p>
35/// <p>If successful, this operation returns a set of temporary Amazon Web Services credentials, including a two-part access key and a session token.</p>
36/// <ul>
37/// <li>
38/// <p>With a managed EC2 fleet (where compute type is <code>EC2</code>), use these credentials with Amazon EC2 Systems Manager (SSM) to start a session with the compute. For more details, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-sessions-start.html#sessions-start-cli"> Starting a session (CLI)</a> in the <i>Amazon EC2 Systems Manager User Guide</i>.</p></li>
39/// </ul>
40#[derive(::std::clone::Clone, ::std::fmt::Debug)]
41pub struct GetComputeAccessFluentBuilder {
42    handle: ::std::sync::Arc<crate::client::Handle>,
43    inner: crate::operation::get_compute_access::builders::GetComputeAccessInputBuilder,
44    config_override: ::std::option::Option<crate::config::Builder>,
45}
46impl
47    crate::client::customize::internal::CustomizableSend<
48        crate::operation::get_compute_access::GetComputeAccessOutput,
49        crate::operation::get_compute_access::GetComputeAccessError,
50    > for GetComputeAccessFluentBuilder
51{
52    fn send(
53        self,
54        config_override: crate::config::Builder,
55    ) -> crate::client::customize::internal::BoxFuture<
56        crate::client::customize::internal::SendResult<
57            crate::operation::get_compute_access::GetComputeAccessOutput,
58            crate::operation::get_compute_access::GetComputeAccessError,
59        >,
60    > {
61        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
62    }
63}
64impl GetComputeAccessFluentBuilder {
65    /// Creates a new `GetComputeAccessFluentBuilder`.
66    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
67        Self {
68            handle,
69            inner: ::std::default::Default::default(),
70            config_override: ::std::option::Option::None,
71        }
72    }
73    /// Access the GetComputeAccess as a reference.
74    pub fn as_input(&self) -> &crate::operation::get_compute_access::builders::GetComputeAccessInputBuilder {
75        &self.inner
76    }
77    /// Sends the request and returns the response.
78    ///
79    /// If an error occurs, an `SdkError` will be returned with additional details that
80    /// can be matched against.
81    ///
82    /// By default, any retryable failures will be retried twice. Retry behavior
83    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
84    /// set when configuring the client.
85    pub async fn send(
86        self,
87    ) -> ::std::result::Result<
88        crate::operation::get_compute_access::GetComputeAccessOutput,
89        ::aws_smithy_runtime_api::client::result::SdkError<
90            crate::operation::get_compute_access::GetComputeAccessError,
91            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
92        >,
93    > {
94        let input = self
95            .inner
96            .build()
97            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
98        let runtime_plugins = crate::operation::get_compute_access::GetComputeAccess::operation_runtime_plugins(
99            self.handle.runtime_plugins.clone(),
100            &self.handle.conf,
101            self.config_override,
102        );
103        crate::operation::get_compute_access::GetComputeAccess::orchestrate(&runtime_plugins, input).await
104    }
105
106    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
107    pub fn customize(
108        self,
109    ) -> crate::client::customize::CustomizableOperation<
110        crate::operation::get_compute_access::GetComputeAccessOutput,
111        crate::operation::get_compute_access::GetComputeAccessError,
112        Self,
113    > {
114        crate::client::customize::CustomizableOperation::new(self)
115    }
116    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
117        self.set_config_override(::std::option::Option::Some(config_override.into()));
118        self
119    }
120
121    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
122        self.config_override = config_override;
123        self
124    }
125    /// <p>A unique identifier for the fleet that holds the compute resource that you want to connect to. You can use either the fleet ID or ARN value.</p>
126    pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.fleet_id(input.into());
128        self
129    }
130    /// <p>A unique identifier for the fleet that holds the compute resource that you want to connect to. You can use either the fleet ID or ARN value.</p>
131    pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_fleet_id(input);
133        self
134    }
135    /// <p>A unique identifier for the fleet that holds the compute resource that you want to connect to. You can use either the fleet ID or ARN value.</p>
136    pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_fleet_id()
138    }
139    /// <p>A unique identifier for the compute resource that you want to connect to. For an EC2 fleet, use an instance ID. For a managed container fleet, use a compute name. You can retrieve a fleet's compute names by calling <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListCompute.html">ListCompute</a>.</p>
140    pub fn compute_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.compute_name(input.into());
142        self
143    }
144    /// <p>A unique identifier for the compute resource that you want to connect to. For an EC2 fleet, use an instance ID. For a managed container fleet, use a compute name. You can retrieve a fleet's compute names by calling <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListCompute.html">ListCompute</a>.</p>
145    pub fn set_compute_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_compute_name(input);
147        self
148    }
149    /// <p>A unique identifier for the compute resource that you want to connect to. For an EC2 fleet, use an instance ID. For a managed container fleet, use a compute name. You can retrieve a fleet's compute names by calling <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListCompute.html">ListCompute</a>.</p>
150    pub fn get_compute_name(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_compute_name()
152    }
153}