aws-sdk-gamelift 0.26.0

AWS SDK for Amazon GameLift
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Represents an EC2 instance of virtual computing resources that hosts one or more game servers. In GameLift, a fleet can contain zero or more instances.</p>
/// <p> <b>Related actions</b> </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Instance {
    /// <p>A unique identifier for the fleet that the instance is in.</p>
    #[doc(hidden)]
    pub fleet_id: std::option::Option<std::string::String>,
    /// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html">ARN</a>) that is assigned to a GameLift fleet resource and uniquely identifies it. ARNs are unique across all Regions. Format is <code>arn:aws:gamelift:
    /// <region>
    /// ::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912
    /// </region></code>.</p>
    #[doc(hidden)]
    pub fleet_arn: std::option::Option<std::string::String>,
    /// <p>A unique identifier for the instance.</p>
    #[doc(hidden)]
    pub instance_id: std::option::Option<std::string::String>,
    /// <p>IP address that is assigned to the instance.</p>
    #[doc(hidden)]
    pub ip_address: std::option::Option<std::string::String>,
    /// <p>The DNS identifier assigned to the instance that is running the game session. Values have the following format:</p>
    /// <ul>
    /// <li> <p>TLS-enabled fleets: <code>
    /// <unique identifier>
    /// .
    /// <region identifier>
    /// .amazongamelift.com
    /// </region>
    /// </unique></code>.</p> </li>
    /// <li> <p>Non-TLS-enabled fleets: <code>ec2-
    /// <unique identifier>
    /// .compute.amazonaws.com
    /// </unique></code>. (See <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses">Amazon EC2 Instance IP Addressing</a>.)</p> </li>
    /// </ul>
    /// <p>When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.</p>
    #[doc(hidden)]
    pub dns_name: std::option::Option<std::string::String>,
    /// <p>Operating system that is running on this instance. </p>
    #[doc(hidden)]
    pub operating_system: std::option::Option<crate::types::OperatingSystem>,
    /// <p>Amazon EC2 instance type that defines the computing resources of this instance. </p>
    #[doc(hidden)]
    pub r#type: std::option::Option<crate::types::Ec2InstanceType>,
    /// <p>Current status of the instance. Possible statuses include the following:</p>
    /// <ul>
    /// <li> <p> <b>PENDING</b> -- The instance is in the process of being created and launching server processes as defined in the fleet's run-time configuration. </p> </li>
    /// <li> <p> <b>ACTIVE</b> -- The instance has been successfully created and at least one server process has successfully launched and reported back to GameLift that it is ready to host a game session. The instance is now considered ready to host game sessions. </p> </li>
    /// <li> <p> <b>TERMINATING</b> -- The instance is in the process of shutting down. This may happen to reduce capacity during a scaling down event or to recycle resources in the event of a problem.</p> </li>
    /// </ul>
    #[doc(hidden)]
    pub status: std::option::Option<crate::types::InstanceStatus>,
    /// <p>A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example <code>"1469498468.057"</code>).</p>
    #[doc(hidden)]
    pub creation_time: std::option::Option<aws_smithy_types::DateTime>,
    /// <p>The fleet location of the instance, expressed as an Amazon Web Services Region code, such as <code>us-west-2</code>. </p>
    #[doc(hidden)]
    pub location: std::option::Option<std::string::String>,
}
impl Instance {
    /// <p>A unique identifier for the fleet that the instance is in.</p>
    pub fn fleet_id(&self) -> std::option::Option<&str> {
        self.fleet_id.as_deref()
    }
    /// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html">ARN</a>) that is assigned to a GameLift fleet resource and uniquely identifies it. ARNs are unique across all Regions. Format is <code>arn:aws:gamelift:
    /// <region>
    /// ::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912
    /// </region></code>.</p>
    pub fn fleet_arn(&self) -> std::option::Option<&str> {
        self.fleet_arn.as_deref()
    }
    /// <p>A unique identifier for the instance.</p>
    pub fn instance_id(&self) -> std::option::Option<&str> {
        self.instance_id.as_deref()
    }
    /// <p>IP address that is assigned to the instance.</p>
    pub fn ip_address(&self) -> std::option::Option<&str> {
        self.ip_address.as_deref()
    }
    /// <p>The DNS identifier assigned to the instance that is running the game session. Values have the following format:</p>
    /// <ul>
    /// <li> <p>TLS-enabled fleets: <code>
    /// <unique identifier>
    /// .
    /// <region identifier>
    /// .amazongamelift.com
    /// </region>
    /// </unique></code>.</p> </li>
    /// <li> <p>Non-TLS-enabled fleets: <code>ec2-
    /// <unique identifier>
    /// .compute.amazonaws.com
    /// </unique></code>. (See <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses">Amazon EC2 Instance IP Addressing</a>.)</p> </li>
    /// </ul>
    /// <p>When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.</p>
    pub fn dns_name(&self) -> std::option::Option<&str> {
        self.dns_name.as_deref()
    }
    /// <p>Operating system that is running on this instance. </p>
    pub fn operating_system(&self) -> std::option::Option<&crate::types::OperatingSystem> {
        self.operating_system.as_ref()
    }
    /// <p>Amazon EC2 instance type that defines the computing resources of this instance. </p>
    pub fn r#type(&self) -> std::option::Option<&crate::types::Ec2InstanceType> {
        self.r#type.as_ref()
    }
    /// <p>Current status of the instance. Possible statuses include the following:</p>
    /// <ul>
    /// <li> <p> <b>PENDING</b> -- The instance is in the process of being created and launching server processes as defined in the fleet's run-time configuration. </p> </li>
    /// <li> <p> <b>ACTIVE</b> -- The instance has been successfully created and at least one server process has successfully launched and reported back to GameLift that it is ready to host a game session. The instance is now considered ready to host game sessions. </p> </li>
    /// <li> <p> <b>TERMINATING</b> -- The instance is in the process of shutting down. This may happen to reduce capacity during a scaling down event or to recycle resources in the event of a problem.</p> </li>
    /// </ul>
    pub fn status(&self) -> std::option::Option<&crate::types::InstanceStatus> {
        self.status.as_ref()
    }
    /// <p>A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example <code>"1469498468.057"</code>).</p>
    pub fn creation_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
        self.creation_time.as_ref()
    }
    /// <p>The fleet location of the instance, expressed as an Amazon Web Services Region code, such as <code>us-west-2</code>. </p>
    pub fn location(&self) -> std::option::Option<&str> {
        self.location.as_deref()
    }
}
impl Instance {
    /// Creates a new builder-style object to manufacture [`Instance`](crate::types::Instance).
    pub fn builder() -> crate::types::builders::InstanceBuilder {
        crate::types::builders::InstanceBuilder::default()
    }
}

/// A builder for [`Instance`](crate::types::Instance).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct InstanceBuilder {
    pub(crate) fleet_id: std::option::Option<std::string::String>,
    pub(crate) fleet_arn: std::option::Option<std::string::String>,
    pub(crate) instance_id: std::option::Option<std::string::String>,
    pub(crate) ip_address: std::option::Option<std::string::String>,
    pub(crate) dns_name: std::option::Option<std::string::String>,
    pub(crate) operating_system: std::option::Option<crate::types::OperatingSystem>,
    pub(crate) r#type: std::option::Option<crate::types::Ec2InstanceType>,
    pub(crate) status: std::option::Option<crate::types::InstanceStatus>,
    pub(crate) creation_time: std::option::Option<aws_smithy_types::DateTime>,
    pub(crate) location: std::option::Option<std::string::String>,
}
impl InstanceBuilder {
    /// <p>A unique identifier for the fleet that the instance is in.</p>
    pub fn fleet_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.fleet_id = Some(input.into());
        self
    }
    /// <p>A unique identifier for the fleet that the instance is in.</p>
    pub fn set_fleet_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.fleet_id = input;
        self
    }
    /// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html">ARN</a>) that is assigned to a GameLift fleet resource and uniquely identifies it. ARNs are unique across all Regions. Format is <code>arn:aws:gamelift:
    /// <region>
    /// ::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912
    /// </region></code>.</p>
    pub fn fleet_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.fleet_arn = Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html">ARN</a>) that is assigned to a GameLift fleet resource and uniquely identifies it. ARNs are unique across all Regions. Format is <code>arn:aws:gamelift:
    /// <region>
    /// ::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912
    /// </region></code>.</p>
    pub fn set_fleet_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.fleet_arn = input;
        self
    }
    /// <p>A unique identifier for the instance.</p>
    pub fn instance_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.instance_id = Some(input.into());
        self
    }
    /// <p>A unique identifier for the instance.</p>
    pub fn set_instance_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.instance_id = input;
        self
    }
    /// <p>IP address that is assigned to the instance.</p>
    pub fn ip_address(mut self, input: impl Into<std::string::String>) -> Self {
        self.ip_address = Some(input.into());
        self
    }
    /// <p>IP address that is assigned to the instance.</p>
    pub fn set_ip_address(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.ip_address = input;
        self
    }
    /// <p>The DNS identifier assigned to the instance that is running the game session. Values have the following format:</p>
    /// <ul>
    /// <li> <p>TLS-enabled fleets: <code>
    /// <unique identifier>
    /// .
    /// <region identifier>
    /// .amazongamelift.com
    /// </region>
    /// </unique></code>.</p> </li>
    /// <li> <p>Non-TLS-enabled fleets: <code>ec2-
    /// <unique identifier>
    /// .compute.amazonaws.com
    /// </unique></code>. (See <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses">Amazon EC2 Instance IP Addressing</a>.)</p> </li>
    /// </ul>
    /// <p>When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.</p>
    pub fn dns_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.dns_name = Some(input.into());
        self
    }
    /// <p>The DNS identifier assigned to the instance that is running the game session. Values have the following format:</p>
    /// <ul>
    /// <li> <p>TLS-enabled fleets: <code>
    /// <unique identifier>
    /// .
    /// <region identifier>
    /// .amazongamelift.com
    /// </region>
    /// </unique></code>.</p> </li>
    /// <li> <p>Non-TLS-enabled fleets: <code>ec2-
    /// <unique identifier>
    /// .compute.amazonaws.com
    /// </unique></code>. (See <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses">Amazon EC2 Instance IP Addressing</a>.)</p> </li>
    /// </ul>
    /// <p>When connecting to a game session that is running on a TLS-enabled fleet, you must use the DNS name, not the IP address.</p>
    pub fn set_dns_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.dns_name = input;
        self
    }
    /// <p>Operating system that is running on this instance. </p>
    pub fn operating_system(mut self, input: crate::types::OperatingSystem) -> Self {
        self.operating_system = Some(input);
        self
    }
    /// <p>Operating system that is running on this instance. </p>
    pub fn set_operating_system(
        mut self,
        input: std::option::Option<crate::types::OperatingSystem>,
    ) -> Self {
        self.operating_system = input;
        self
    }
    /// <p>Amazon EC2 instance type that defines the computing resources of this instance. </p>
    pub fn r#type(mut self, input: crate::types::Ec2InstanceType) -> Self {
        self.r#type = Some(input);
        self
    }
    /// <p>Amazon EC2 instance type that defines the computing resources of this instance. </p>
    pub fn set_type(mut self, input: std::option::Option<crate::types::Ec2InstanceType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>Current status of the instance. Possible statuses include the following:</p>
    /// <ul>
    /// <li> <p> <b>PENDING</b> -- The instance is in the process of being created and launching server processes as defined in the fleet's run-time configuration. </p> </li>
    /// <li> <p> <b>ACTIVE</b> -- The instance has been successfully created and at least one server process has successfully launched and reported back to GameLift that it is ready to host a game session. The instance is now considered ready to host game sessions. </p> </li>
    /// <li> <p> <b>TERMINATING</b> -- The instance is in the process of shutting down. This may happen to reduce capacity during a scaling down event or to recycle resources in the event of a problem.</p> </li>
    /// </ul>
    pub fn status(mut self, input: crate::types::InstanceStatus) -> Self {
        self.status = Some(input);
        self
    }
    /// <p>Current status of the instance. Possible statuses include the following:</p>
    /// <ul>
    /// <li> <p> <b>PENDING</b> -- The instance is in the process of being created and launching server processes as defined in the fleet's run-time configuration. </p> </li>
    /// <li> <p> <b>ACTIVE</b> -- The instance has been successfully created and at least one server process has successfully launched and reported back to GameLift that it is ready to host a game session. The instance is now considered ready to host game sessions. </p> </li>
    /// <li> <p> <b>TERMINATING</b> -- The instance is in the process of shutting down. This may happen to reduce capacity during a scaling down event or to recycle resources in the event of a problem.</p> </li>
    /// </ul>
    pub fn set_status(mut self, input: std::option::Option<crate::types::InstanceStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example <code>"1469498468.057"</code>).</p>
    pub fn creation_time(mut self, input: aws_smithy_types::DateTime) -> Self {
        self.creation_time = Some(input);
        self
    }
    /// <p>A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example <code>"1469498468.057"</code>).</p>
    pub fn set_creation_time(
        mut self,
        input: std::option::Option<aws_smithy_types::DateTime>,
    ) -> Self {
        self.creation_time = input;
        self
    }
    /// <p>The fleet location of the instance, expressed as an Amazon Web Services Region code, such as <code>us-west-2</code>. </p>
    pub fn location(mut self, input: impl Into<std::string::String>) -> Self {
        self.location = Some(input.into());
        self
    }
    /// <p>The fleet location of the instance, expressed as an Amazon Web Services Region code, such as <code>us-west-2</code>. </p>
    pub fn set_location(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.location = input;
        self
    }
    /// Consumes the builder and constructs a [`Instance`](crate::types::Instance).
    pub fn build(self) -> crate::types::Instance {
        crate::types::Instance {
            fleet_id: self.fleet_id,
            fleet_arn: self.fleet_arn,
            instance_id: self.instance_id,
            ip_address: self.ip_address,
            dns_name: self.dns_name,
            operating_system: self.operating_system,
            r#type: self.r#type,
            status: self.status,
            creation_time: self.creation_time,
            location: self.location,
        }
    }
}