Skip to main content

aws_sdk_gamelift/types/
_instance_access.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information and credentials that you can use to remotely connect to an instance in an EC2 managed fleet. This data type is returned in response to a call to <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_GetInstanceAccess">https://docs.aws.amazon.com/gamelift/latest/apireference/API_GetInstanceAccess</a>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
6pub struct InstanceAccess {
7    /// <p>A unique identifier for the fleet containing the instance to be accessed.</p>
8    pub fleet_id: ::std::option::Option<::std::string::String>,
9    /// <p>A unique identifier for the instance to be accessed.</p>
10    pub instance_id: ::std::option::Option<::std::string::String>,
11    /// <p>IP address assigned to the instance.</p>
12    pub ip_address: ::std::option::Option<::std::string::String>,
13    /// <p>Operating system that is running on the instance.</p>
14    pub operating_system: ::std::option::Option<crate::types::OperatingSystem>,
15    /// <p>Security credentials that are required to access the instance.</p>
16    pub credentials: ::std::option::Option<crate::types::InstanceCredentials>,
17}
18impl InstanceAccess {
19    /// <p>A unique identifier for the fleet containing the instance to be accessed.</p>
20    pub fn fleet_id(&self) -> ::std::option::Option<&str> {
21        self.fleet_id.as_deref()
22    }
23    /// <p>A unique identifier for the instance to be accessed.</p>
24    pub fn instance_id(&self) -> ::std::option::Option<&str> {
25        self.instance_id.as_deref()
26    }
27    /// <p>IP address assigned to the instance.</p>
28    pub fn ip_address(&self) -> ::std::option::Option<&str> {
29        self.ip_address.as_deref()
30    }
31    /// <p>Operating system that is running on the instance.</p>
32    pub fn operating_system(&self) -> ::std::option::Option<&crate::types::OperatingSystem> {
33        self.operating_system.as_ref()
34    }
35    /// <p>Security credentials that are required to access the instance.</p>
36    pub fn credentials(&self) -> ::std::option::Option<&crate::types::InstanceCredentials> {
37        self.credentials.as_ref()
38    }
39}
40impl ::std::fmt::Debug for InstanceAccess {
41    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
42        let mut formatter = f.debug_struct("InstanceAccess");
43        formatter.field("fleet_id", &self.fleet_id);
44        formatter.field("instance_id", &self.instance_id);
45        formatter.field("ip_address", &"*** Sensitive Data Redacted ***");
46        formatter.field("operating_system", &self.operating_system);
47        formatter.field("credentials", &"*** Sensitive Data Redacted ***");
48        formatter.finish()
49    }
50}
51impl InstanceAccess {
52    /// Creates a new builder-style object to manufacture [`InstanceAccess`](crate::types::InstanceAccess).
53    pub fn builder() -> crate::types::builders::InstanceAccessBuilder {
54        crate::types::builders::InstanceAccessBuilder::default()
55    }
56}
57
58/// A builder for [`InstanceAccess`](crate::types::InstanceAccess).
59#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
60#[non_exhaustive]
61pub struct InstanceAccessBuilder {
62    pub(crate) fleet_id: ::std::option::Option<::std::string::String>,
63    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
64    pub(crate) ip_address: ::std::option::Option<::std::string::String>,
65    pub(crate) operating_system: ::std::option::Option<crate::types::OperatingSystem>,
66    pub(crate) credentials: ::std::option::Option<crate::types::InstanceCredentials>,
67}
68impl InstanceAccessBuilder {
69    /// <p>A unique identifier for the fleet containing the instance to be accessed.</p>
70    pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71        self.fleet_id = ::std::option::Option::Some(input.into());
72        self
73    }
74    /// <p>A unique identifier for the fleet containing the instance to be accessed.</p>
75    pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.fleet_id = input;
77        self
78    }
79    /// <p>A unique identifier for the fleet containing the instance to be accessed.</p>
80    pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
81        &self.fleet_id
82    }
83    /// <p>A unique identifier for the instance to be accessed.</p>
84    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85        self.instance_id = ::std::option::Option::Some(input.into());
86        self
87    }
88    /// <p>A unique identifier for the instance to be accessed.</p>
89    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.instance_id = input;
91        self
92    }
93    /// <p>A unique identifier for the instance to be accessed.</p>
94    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
95        &self.instance_id
96    }
97    /// <p>IP address assigned to the instance.</p>
98    pub fn ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99        self.ip_address = ::std::option::Option::Some(input.into());
100        self
101    }
102    /// <p>IP address assigned to the instance.</p>
103    pub fn set_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104        self.ip_address = input;
105        self
106    }
107    /// <p>IP address assigned to the instance.</p>
108    pub fn get_ip_address(&self) -> &::std::option::Option<::std::string::String> {
109        &self.ip_address
110    }
111    /// <p>Operating system that is running on the instance.</p>
112    pub fn operating_system(mut self, input: crate::types::OperatingSystem) -> Self {
113        self.operating_system = ::std::option::Option::Some(input);
114        self
115    }
116    /// <p>Operating system that is running on the instance.</p>
117    pub fn set_operating_system(mut self, input: ::std::option::Option<crate::types::OperatingSystem>) -> Self {
118        self.operating_system = input;
119        self
120    }
121    /// <p>Operating system that is running on the instance.</p>
122    pub fn get_operating_system(&self) -> &::std::option::Option<crate::types::OperatingSystem> {
123        &self.operating_system
124    }
125    /// <p>Security credentials that are required to access the instance.</p>
126    pub fn credentials(mut self, input: crate::types::InstanceCredentials) -> Self {
127        self.credentials = ::std::option::Option::Some(input);
128        self
129    }
130    /// <p>Security credentials that are required to access the instance.</p>
131    pub fn set_credentials(mut self, input: ::std::option::Option<crate::types::InstanceCredentials>) -> Self {
132        self.credentials = input;
133        self
134    }
135    /// <p>Security credentials that are required to access the instance.</p>
136    pub fn get_credentials(&self) -> &::std::option::Option<crate::types::InstanceCredentials> {
137        &self.credentials
138    }
139    /// Consumes the builder and constructs a [`InstanceAccess`](crate::types::InstanceAccess).
140    pub fn build(self) -> crate::types::InstanceAccess {
141        crate::types::InstanceAccess {
142            fleet_id: self.fleet_id,
143            instance_id: self.instance_id,
144            ip_address: self.ip_address,
145            operating_system: self.operating_system,
146            credentials: self.credentials,
147        }
148    }
149}
150impl ::std::fmt::Debug for InstanceAccessBuilder {
151    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
152        let mut formatter = f.debug_struct("InstanceAccessBuilder");
153        formatter.field("fleet_id", &self.fleet_id);
154        formatter.field("instance_id", &self.instance_id);
155        formatter.field("ip_address", &"*** Sensitive Data Redacted ***");
156        formatter.field("operating_system", &self.operating_system);
157        formatter.field("credentials", &"*** Sensitive Data Redacted ***");
158        formatter.finish()
159    }
160}