aws_sdk_gamelift/operation/get_instance_access/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_instance_access::_get_instance_access_output::GetInstanceAccessOutputBuilder;
3
4pub use crate::operation::get_instance_access::_get_instance_access_input::GetInstanceAccessInputBuilder;
5
6impl crate::operation::get_instance_access::builders::GetInstanceAccessInputBuilder {
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_instance_access::GetInstanceAccessOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_instance_access::GetInstanceAccessError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_instance_access();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetInstanceAccess`.
24///
25/// <p><b>This API works with the following fleet types:</b> EC2</p>
26/// <p>Requests authorization to remotely connect to an instance in an Amazon GameLift Servers managed fleet. Use this operation to connect to instances with game servers that use Amazon GameLift Servers server SDK 4.x or earlier. To connect to instances with game servers that use server SDK 5.x or later, call <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_GetComputeAccess">https://docs.aws.amazon.com/gamelift/latest/apireference/API_GetComputeAccess</a>.</p>
27/// <p>To request access to an instance, specify IDs for the instance and the fleet it belongs to. You can retrieve instance IDs for a fleet by calling <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeInstances.html">DescribeInstances</a> with the fleet ID.</p>
28/// <p>If successful, this operation returns an IP address and credentials. The returned credentials match the operating system of the instance, as follows:</p>
29/// <ul>
30/// <li>
31/// <p>For a Windows instance: returns a user name and secret (password) for use with a Windows Remote Desktop client.</p></li>
32/// <li>
33/// <p>For a Linux instance: returns a user name and secret (RSA private key) for use with an SSH client. You must save the secret to a <code>.pem</code> file. If you're using the CLI, see the example <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_GetInstanceAccess.html#API_GetInstanceAccess_Examples"> Get credentials for a Linux instance</a> for tips on automatically saving the secret to a <code>.pem</code> file.</p></li>
34/// </ul>
35/// <p><b>Learn more</b></p>
36/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-remote-access.html">Remotely connect to fleet instances</a></p>
37/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creating-debug.html">Debug fleet issues</a></p>
38/// <p><b>Related actions</b></p>
39/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets">All APIs by task</a></p>
40#[derive(::std::clone::Clone, ::std::fmt::Debug)]
41pub struct GetInstanceAccessFluentBuilder {
42    handle: ::std::sync::Arc<crate::client::Handle>,
43    inner: crate::operation::get_instance_access::builders::GetInstanceAccessInputBuilder,
44    config_override: ::std::option::Option<crate::config::Builder>,
45}
46impl
47    crate::client::customize::internal::CustomizableSend<
48        crate::operation::get_instance_access::GetInstanceAccessOutput,
49        crate::operation::get_instance_access::GetInstanceAccessError,
50    > for GetInstanceAccessFluentBuilder
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_instance_access::GetInstanceAccessOutput,
58            crate::operation::get_instance_access::GetInstanceAccessError,
59        >,
60    > {
61        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
62    }
63}
64impl GetInstanceAccessFluentBuilder {
65    /// Creates a new `GetInstanceAccessFluentBuilder`.
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 GetInstanceAccess as a reference.
74    pub fn as_input(&self) -> &crate::operation::get_instance_access::builders::GetInstanceAccessInputBuilder {
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_instance_access::GetInstanceAccessOutput,
89        ::aws_smithy_runtime_api::client::result::SdkError<
90            crate::operation::get_instance_access::GetInstanceAccessError,
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_instance_access::GetInstanceAccess::operation_runtime_plugins(
99            self.handle.runtime_plugins.clone(),
100            &self.handle.conf,
101            self.config_override,
102        );
103        crate::operation::get_instance_access::GetInstanceAccess::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_instance_access::GetInstanceAccessOutput,
111        crate::operation::get_instance_access::GetInstanceAccessError,
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 contains the instance you want to access. You can request access to instances in EC2 fleets with the following statuses: <code>ACTIVATING</code>, <code>ACTIVE</code>, or <code>ERROR</code>. Use either a fleet ID or an ARN value.</p><note>
126    /// <p>You can access fleets in <code>ERROR</code> status for a short period of time before Amazon GameLift Servers deletes them.</p>
127    /// </note>
128    pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.fleet_id(input.into());
130        self
131    }
132    /// <p>A unique identifier for the fleet that contains the instance you want to access. You can request access to instances in EC2 fleets with the following statuses: <code>ACTIVATING</code>, <code>ACTIVE</code>, or <code>ERROR</code>. Use either a fleet ID or an ARN value.</p><note>
133    /// <p>You can access fleets in <code>ERROR</code> status for a short period of time before Amazon GameLift Servers deletes them.</p>
134    /// </note>
135    pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_fleet_id(input);
137        self
138    }
139    /// <p>A unique identifier for the fleet that contains the instance you want to access. You can request access to instances in EC2 fleets with the following statuses: <code>ACTIVATING</code>, <code>ACTIVE</code>, or <code>ERROR</code>. Use either a fleet ID or an ARN value.</p><note>
140    /// <p>You can access fleets in <code>ERROR</code> status for a short period of time before Amazon GameLift Servers deletes them.</p>
141    /// </note>
142    pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_fleet_id()
144    }
145    /// <p>A unique identifier for the instance you want to access. You can access an instance in any status.</p>
146    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.instance_id(input.into());
148        self
149    }
150    /// <p>A unique identifier for the instance you want to access. You can access an instance in any status.</p>
151    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_instance_id(input);
153        self
154    }
155    /// <p>A unique identifier for the instance you want to access. You can access an instance in any status.</p>
156    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
157        self.inner.get_instance_id()
158    }
159}