{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.GameLift.Types.GameServerGroup
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.GameLift.Types.GameServerGroup where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GameLift.Types.BalancingStrategy
import Amazonka.GameLift.Types.GameServerGroupAction
import Amazonka.GameLift.Types.GameServerGroupStatus
import Amazonka.GameLift.Types.GameServerProtectionPolicy
import Amazonka.GameLift.Types.InstanceDefinition
import qualified Amazonka.Prelude as Prelude

-- | __This data type is used with the GameLift FleetIQ and game server
-- groups.__
--
-- Properties that describe a game server group resource. A game server
-- group manages certain properties related to a corresponding Amazon EC2
-- Auto Scaling group.
--
-- A game server group is created by a successful call to
-- @CreateGameServerGroup@ and deleted by calling @DeleteGameServerGroup@.
-- Game server group activity can be temporarily suspended and resumed by
-- calling @SuspendGameServerGroup@ and @ResumeGameServerGroup@,
-- respectively.
--
-- /See:/ 'newGameServerGroup' smart constructor.
data GameServerGroup = GameServerGroup'
  { -- | A generated unique ID for the Amazon EC2 Auto Scaling group that is
    -- associated with this game server group.
    GameServerGroup -> Maybe Text
autoScalingGroupArn :: Prelude.Maybe Prelude.Text,
    -- | Indicates how GameLift FleetIQ balances the use of Spot Instances and
    -- On-Demand Instances in the game server group. Method options include the
    -- following:
    --
    -- -   @SPOT_ONLY@ - Only Spot Instances are used in the game server group.
    --     If Spot Instances are unavailable or not viable for game hosting,
    --     the game server group provides no hosting capacity until Spot
    --     Instances can again be used. Until then, no new instances are
    --     started, and the existing nonviable Spot Instances are terminated
    --     (after current gameplay ends) and are not replaced.
    --
    -- -   @SPOT_PREFERRED@ - (default value) Spot Instances are used whenever
    --     available in the game server group. If Spot Instances are
    --     unavailable, the game server group continues to provide hosting
    --     capacity by falling back to On-Demand Instances. Existing nonviable
    --     Spot Instances are terminated (after current gameplay ends) and are
    --     replaced with new On-Demand Instances.
    --
    -- -   @ON_DEMAND_ONLY@ - Only On-Demand Instances are used in the game
    --     server group. No Spot Instances are used, even when available, while
    --     this balancing strategy is in force.
    GameServerGroup -> Maybe BalancingStrategy
balancingStrategy :: Prelude.Maybe BalancingStrategy,
    -- | A time stamp indicating when this data object was created. Format is a
    -- number expressed in Unix time as milliseconds (for example
    -- @\"1469498468.057\"@).
    GameServerGroup -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
    -- | A generated unique ID for the game server group.
    GameServerGroup -> Maybe Text
gameServerGroupArn :: Prelude.Maybe Prelude.Text,
    -- | A developer-defined identifier for the game server group. The name is
    -- unique for each Region in each Amazon Web Services account.
    GameServerGroup -> Maybe Text
gameServerGroupName :: Prelude.Maybe Prelude.Text,
    -- | A flag that indicates whether instances in the game server group are
    -- protected from early termination. Unprotected instances that have active
    -- game servers running might be terminated during a scale-down event,
    -- causing players to be dropped from the game. Protected instances cannot
    -- be terminated while there are active game servers running except in the
    -- event of a forced game server group deletion (see ). An exception to
    -- this is with Spot Instances, which can be terminated by Amazon Web
    -- Services regardless of protection status.
    GameServerGroup -> Maybe GameServerProtectionPolicy
gameServerProtectionPolicy :: Prelude.Maybe GameServerProtectionPolicy,
    -- | The set of Amazon EC2 instance types that GameLift FleetIQ can use when
    -- balancing and automatically scaling instances in the corresponding Auto
    -- Scaling group.
    GameServerGroup -> Maybe (NonEmpty InstanceDefinition)
instanceDefinitions :: Prelude.Maybe (Prelude.NonEmpty InstanceDefinition),
    -- | A timestamp that indicates when this game server group was last updated.
    GameServerGroup -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Data.POSIX,
    -- | The Amazon Resource Name
    -- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
    -- for an IAM role that allows Amazon GameLift to access your Amazon EC2
    -- Auto Scaling groups.
    GameServerGroup -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
    -- | The current status of the game server group. Possible statuses include:
    --
    -- -   @NEW@ - GameLift FleetIQ has validated the @CreateGameServerGroup()@
    --     request.
    --
    -- -   @ACTIVATING@ - GameLift FleetIQ is setting up a game server group,
    --     which includes creating an Auto Scaling group in your Amazon Web
    --     Services account.
    --
    -- -   @ACTIVE@ - The game server group has been successfully created.
    --
    -- -   @DELETE_SCHEDULED@ - A request to delete the game server group has
    --     been received.
    --
    -- -   @DELETING@ - GameLift FleetIQ has received a valid
    --     @DeleteGameServerGroup()@ request and is processing it. GameLift
    --     FleetIQ must first complete and release hosts before it deletes the
    --     Auto Scaling group and the game server group.
    --
    -- -   @DELETED@ - The game server group has been successfully deleted.
    --
    -- -   @ERROR@ - The asynchronous processes of activating or deleting a
    --     game server group has failed, resulting in an error state.
    GameServerGroup -> Maybe GameServerGroupStatus
status :: Prelude.Maybe GameServerGroupStatus,
    -- | Additional information about the current game server group status. This
    -- information might provide additional insight on groups that are in
    -- @ERROR@ status.
    GameServerGroup -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text,
    -- | A list of activities that are currently suspended for this game server
    -- group. If this property is empty, all activities are occurring.
    GameServerGroup -> Maybe (NonEmpty GameServerGroupAction)
suspendedActions :: Prelude.Maybe (Prelude.NonEmpty GameServerGroupAction)
  }
  deriving (GameServerGroup -> GameServerGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GameServerGroup -> GameServerGroup -> Bool
$c/= :: GameServerGroup -> GameServerGroup -> Bool
== :: GameServerGroup -> GameServerGroup -> Bool
$c== :: GameServerGroup -> GameServerGroup -> Bool
Prelude.Eq, ReadPrec [GameServerGroup]
ReadPrec GameServerGroup
Int -> ReadS GameServerGroup
ReadS [GameServerGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GameServerGroup]
$creadListPrec :: ReadPrec [GameServerGroup]
readPrec :: ReadPrec GameServerGroup
$creadPrec :: ReadPrec GameServerGroup
readList :: ReadS [GameServerGroup]
$creadList :: ReadS [GameServerGroup]
readsPrec :: Int -> ReadS GameServerGroup
$creadsPrec :: Int -> ReadS GameServerGroup
Prelude.Read, Int -> GameServerGroup -> ShowS
[GameServerGroup] -> ShowS
GameServerGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GameServerGroup] -> ShowS
$cshowList :: [GameServerGroup] -> ShowS
show :: GameServerGroup -> String
$cshow :: GameServerGroup -> String
showsPrec :: Int -> GameServerGroup -> ShowS
$cshowsPrec :: Int -> GameServerGroup -> ShowS
Prelude.Show, forall x. Rep GameServerGroup x -> GameServerGroup
forall x. GameServerGroup -> Rep GameServerGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GameServerGroup x -> GameServerGroup
$cfrom :: forall x. GameServerGroup -> Rep GameServerGroup x
Prelude.Generic)

-- |
-- Create a value of 'GameServerGroup' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'autoScalingGroupArn', 'gameServerGroup_autoScalingGroupArn' - A generated unique ID for the Amazon EC2 Auto Scaling group that is
-- associated with this game server group.
--
-- 'balancingStrategy', 'gameServerGroup_balancingStrategy' - Indicates how GameLift FleetIQ balances the use of Spot Instances and
-- On-Demand Instances in the game server group. Method options include the
-- following:
--
-- -   @SPOT_ONLY@ - Only Spot Instances are used in the game server group.
--     If Spot Instances are unavailable or not viable for game hosting,
--     the game server group provides no hosting capacity until Spot
--     Instances can again be used. Until then, no new instances are
--     started, and the existing nonviable Spot Instances are terminated
--     (after current gameplay ends) and are not replaced.
--
-- -   @SPOT_PREFERRED@ - (default value) Spot Instances are used whenever
--     available in the game server group. If Spot Instances are
--     unavailable, the game server group continues to provide hosting
--     capacity by falling back to On-Demand Instances. Existing nonviable
--     Spot Instances are terminated (after current gameplay ends) and are
--     replaced with new On-Demand Instances.
--
-- -   @ON_DEMAND_ONLY@ - Only On-Demand Instances are used in the game
--     server group. No Spot Instances are used, even when available, while
--     this balancing strategy is in force.
--
-- 'creationTime', 'gameServerGroup_creationTime' - A time stamp indicating when this data object was created. Format is a
-- number expressed in Unix time as milliseconds (for example
-- @\"1469498468.057\"@).
--
-- 'gameServerGroupArn', 'gameServerGroup_gameServerGroupArn' - A generated unique ID for the game server group.
--
-- 'gameServerGroupName', 'gameServerGroup_gameServerGroupName' - A developer-defined identifier for the game server group. The name is
-- unique for each Region in each Amazon Web Services account.
--
-- 'gameServerProtectionPolicy', 'gameServerGroup_gameServerProtectionPolicy' - A flag that indicates whether instances in the game server group are
-- protected from early termination. Unprotected instances that have active
-- game servers running might be terminated during a scale-down event,
-- causing players to be dropped from the game. Protected instances cannot
-- be terminated while there are active game servers running except in the
-- event of a forced game server group deletion (see ). An exception to
-- this is with Spot Instances, which can be terminated by Amazon Web
-- Services regardless of protection status.
--
-- 'instanceDefinitions', 'gameServerGroup_instanceDefinitions' - The set of Amazon EC2 instance types that GameLift FleetIQ can use when
-- balancing and automatically scaling instances in the corresponding Auto
-- Scaling group.
--
-- 'lastUpdatedTime', 'gameServerGroup_lastUpdatedTime' - A timestamp that indicates when this game server group was last updated.
--
-- 'roleArn', 'gameServerGroup_roleArn' - The Amazon Resource Name
-- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
-- for an IAM role that allows Amazon GameLift to access your Amazon EC2
-- Auto Scaling groups.
--
-- 'status', 'gameServerGroup_status' - The current status of the game server group. Possible statuses include:
--
-- -   @NEW@ - GameLift FleetIQ has validated the @CreateGameServerGroup()@
--     request.
--
-- -   @ACTIVATING@ - GameLift FleetIQ is setting up a game server group,
--     which includes creating an Auto Scaling group in your Amazon Web
--     Services account.
--
-- -   @ACTIVE@ - The game server group has been successfully created.
--
-- -   @DELETE_SCHEDULED@ - A request to delete the game server group has
--     been received.
--
-- -   @DELETING@ - GameLift FleetIQ has received a valid
--     @DeleteGameServerGroup()@ request and is processing it. GameLift
--     FleetIQ must first complete and release hosts before it deletes the
--     Auto Scaling group and the game server group.
--
-- -   @DELETED@ - The game server group has been successfully deleted.
--
-- -   @ERROR@ - The asynchronous processes of activating or deleting a
--     game server group has failed, resulting in an error state.
--
-- 'statusReason', 'gameServerGroup_statusReason' - Additional information about the current game server group status. This
-- information might provide additional insight on groups that are in
-- @ERROR@ status.
--
-- 'suspendedActions', 'gameServerGroup_suspendedActions' - A list of activities that are currently suspended for this game server
-- group. If this property is empty, all activities are occurring.
newGameServerGroup ::
  GameServerGroup
newGameServerGroup :: GameServerGroup
newGameServerGroup =
  GameServerGroup'
    { $sel:autoScalingGroupArn:GameServerGroup' :: Maybe Text
autoScalingGroupArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:balancingStrategy:GameServerGroup' :: Maybe BalancingStrategy
balancingStrategy = forall a. Maybe a
Prelude.Nothing,
      $sel:creationTime:GameServerGroup' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:gameServerGroupArn:GameServerGroup' :: Maybe Text
gameServerGroupArn = forall a. Maybe a
Prelude.Nothing,
      $sel:gameServerGroupName:GameServerGroup' :: Maybe Text
gameServerGroupName = forall a. Maybe a
Prelude.Nothing,
      $sel:gameServerProtectionPolicy:GameServerGroup' :: Maybe GameServerProtectionPolicy
gameServerProtectionPolicy = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceDefinitions:GameServerGroup' :: Maybe (NonEmpty InstanceDefinition)
instanceDefinitions = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTime:GameServerGroup' :: Maybe POSIX
lastUpdatedTime = forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:GameServerGroup' :: Maybe Text
roleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:status:GameServerGroup' :: Maybe GameServerGroupStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:statusReason:GameServerGroup' :: Maybe Text
statusReason = forall a. Maybe a
Prelude.Nothing,
      $sel:suspendedActions:GameServerGroup' :: Maybe (NonEmpty GameServerGroupAction)
suspendedActions = forall a. Maybe a
Prelude.Nothing
    }

-- | A generated unique ID for the Amazon EC2 Auto Scaling group that is
-- associated with this game server group.
gameServerGroup_autoScalingGroupArn :: Lens.Lens' GameServerGroup (Prelude.Maybe Prelude.Text)
gameServerGroup_autoScalingGroupArn :: Lens' GameServerGroup (Maybe Text)
gameServerGroup_autoScalingGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServerGroup' {Maybe Text
autoScalingGroupArn :: Maybe Text
$sel:autoScalingGroupArn:GameServerGroup' :: GameServerGroup -> Maybe Text
autoScalingGroupArn} -> Maybe Text
autoScalingGroupArn) (\s :: GameServerGroup
s@GameServerGroup' {} Maybe Text
a -> GameServerGroup
s {$sel:autoScalingGroupArn:GameServerGroup' :: Maybe Text
autoScalingGroupArn = Maybe Text
a} :: GameServerGroup)

-- | Indicates how GameLift FleetIQ balances the use of Spot Instances and
-- On-Demand Instances in the game server group. Method options include the
-- following:
--
-- -   @SPOT_ONLY@ - Only Spot Instances are used in the game server group.
--     If Spot Instances are unavailable or not viable for game hosting,
--     the game server group provides no hosting capacity until Spot
--     Instances can again be used. Until then, no new instances are
--     started, and the existing nonviable Spot Instances are terminated
--     (after current gameplay ends) and are not replaced.
--
-- -   @SPOT_PREFERRED@ - (default value) Spot Instances are used whenever
--     available in the game server group. If Spot Instances are
--     unavailable, the game server group continues to provide hosting
--     capacity by falling back to On-Demand Instances. Existing nonviable
--     Spot Instances are terminated (after current gameplay ends) and are
--     replaced with new On-Demand Instances.
--
-- -   @ON_DEMAND_ONLY@ - Only On-Demand Instances are used in the game
--     server group. No Spot Instances are used, even when available, while
--     this balancing strategy is in force.
gameServerGroup_balancingStrategy :: Lens.Lens' GameServerGroup (Prelude.Maybe BalancingStrategy)
gameServerGroup_balancingStrategy :: Lens' GameServerGroup (Maybe BalancingStrategy)
gameServerGroup_balancingStrategy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServerGroup' {Maybe BalancingStrategy
balancingStrategy :: Maybe BalancingStrategy
$sel:balancingStrategy:GameServerGroup' :: GameServerGroup -> Maybe BalancingStrategy
balancingStrategy} -> Maybe BalancingStrategy
balancingStrategy) (\s :: GameServerGroup
s@GameServerGroup' {} Maybe BalancingStrategy
a -> GameServerGroup
s {$sel:balancingStrategy:GameServerGroup' :: Maybe BalancingStrategy
balancingStrategy = Maybe BalancingStrategy
a} :: GameServerGroup)

-- | A time stamp indicating when this data object was created. Format is a
-- number expressed in Unix time as milliseconds (for example
-- @\"1469498468.057\"@).
gameServerGroup_creationTime :: Lens.Lens' GameServerGroup (Prelude.Maybe Prelude.UTCTime)
gameServerGroup_creationTime :: Lens' GameServerGroup (Maybe UTCTime)
gameServerGroup_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServerGroup' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:GameServerGroup' :: GameServerGroup -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: GameServerGroup
s@GameServerGroup' {} Maybe POSIX
a -> GameServerGroup
s {$sel:creationTime:GameServerGroup' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: GameServerGroup) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A generated unique ID for the game server group.
gameServerGroup_gameServerGroupArn :: Lens.Lens' GameServerGroup (Prelude.Maybe Prelude.Text)
gameServerGroup_gameServerGroupArn :: Lens' GameServerGroup (Maybe Text)
gameServerGroup_gameServerGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServerGroup' {Maybe Text
gameServerGroupArn :: Maybe Text
$sel:gameServerGroupArn:GameServerGroup' :: GameServerGroup -> Maybe Text
gameServerGroupArn} -> Maybe Text
gameServerGroupArn) (\s :: GameServerGroup
s@GameServerGroup' {} Maybe Text
a -> GameServerGroup
s {$sel:gameServerGroupArn:GameServerGroup' :: Maybe Text
gameServerGroupArn = Maybe Text
a} :: GameServerGroup)

-- | A developer-defined identifier for the game server group. The name is
-- unique for each Region in each Amazon Web Services account.
gameServerGroup_gameServerGroupName :: Lens.Lens' GameServerGroup (Prelude.Maybe Prelude.Text)
gameServerGroup_gameServerGroupName :: Lens' GameServerGroup (Maybe Text)
gameServerGroup_gameServerGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServerGroup' {Maybe Text
gameServerGroupName :: Maybe Text
$sel:gameServerGroupName:GameServerGroup' :: GameServerGroup -> Maybe Text
gameServerGroupName} -> Maybe Text
gameServerGroupName) (\s :: GameServerGroup
s@GameServerGroup' {} Maybe Text
a -> GameServerGroup
s {$sel:gameServerGroupName:GameServerGroup' :: Maybe Text
gameServerGroupName = Maybe Text
a} :: GameServerGroup)

-- | A flag that indicates whether instances in the game server group are
-- protected from early termination. Unprotected instances that have active
-- game servers running might be terminated during a scale-down event,
-- causing players to be dropped from the game. Protected instances cannot
-- be terminated while there are active game servers running except in the
-- event of a forced game server group deletion (see ). An exception to
-- this is with Spot Instances, which can be terminated by Amazon Web
-- Services regardless of protection status.
gameServerGroup_gameServerProtectionPolicy :: Lens.Lens' GameServerGroup (Prelude.Maybe GameServerProtectionPolicy)
gameServerGroup_gameServerProtectionPolicy :: Lens' GameServerGroup (Maybe GameServerProtectionPolicy)
gameServerGroup_gameServerProtectionPolicy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServerGroup' {Maybe GameServerProtectionPolicy
gameServerProtectionPolicy :: Maybe GameServerProtectionPolicy
$sel:gameServerProtectionPolicy:GameServerGroup' :: GameServerGroup -> Maybe GameServerProtectionPolicy
gameServerProtectionPolicy} -> Maybe GameServerProtectionPolicy
gameServerProtectionPolicy) (\s :: GameServerGroup
s@GameServerGroup' {} Maybe GameServerProtectionPolicy
a -> GameServerGroup
s {$sel:gameServerProtectionPolicy:GameServerGroup' :: Maybe GameServerProtectionPolicy
gameServerProtectionPolicy = Maybe GameServerProtectionPolicy
a} :: GameServerGroup)

-- | The set of Amazon EC2 instance types that GameLift FleetIQ can use when
-- balancing and automatically scaling instances in the corresponding Auto
-- Scaling group.
gameServerGroup_instanceDefinitions :: Lens.Lens' GameServerGroup (Prelude.Maybe (Prelude.NonEmpty InstanceDefinition))
gameServerGroup_instanceDefinitions :: Lens' GameServerGroup (Maybe (NonEmpty InstanceDefinition))
gameServerGroup_instanceDefinitions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServerGroup' {Maybe (NonEmpty InstanceDefinition)
instanceDefinitions :: Maybe (NonEmpty InstanceDefinition)
$sel:instanceDefinitions:GameServerGroup' :: GameServerGroup -> Maybe (NonEmpty InstanceDefinition)
instanceDefinitions} -> Maybe (NonEmpty InstanceDefinition)
instanceDefinitions) (\s :: GameServerGroup
s@GameServerGroup' {} Maybe (NonEmpty InstanceDefinition)
a -> GameServerGroup
s {$sel:instanceDefinitions:GameServerGroup' :: Maybe (NonEmpty InstanceDefinition)
instanceDefinitions = Maybe (NonEmpty InstanceDefinition)
a} :: GameServerGroup) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A timestamp that indicates when this game server group was last updated.
gameServerGroup_lastUpdatedTime :: Lens.Lens' GameServerGroup (Prelude.Maybe Prelude.UTCTime)
gameServerGroup_lastUpdatedTime :: Lens' GameServerGroup (Maybe UTCTime)
gameServerGroup_lastUpdatedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServerGroup' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:GameServerGroup' :: GameServerGroup -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: GameServerGroup
s@GameServerGroup' {} Maybe POSIX
a -> GameServerGroup
s {$sel:lastUpdatedTime:GameServerGroup' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: GameServerGroup) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The Amazon Resource Name
-- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
-- for an IAM role that allows Amazon GameLift to access your Amazon EC2
-- Auto Scaling groups.
gameServerGroup_roleArn :: Lens.Lens' GameServerGroup (Prelude.Maybe Prelude.Text)
gameServerGroup_roleArn :: Lens' GameServerGroup (Maybe Text)
gameServerGroup_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServerGroup' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:GameServerGroup' :: GameServerGroup -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: GameServerGroup
s@GameServerGroup' {} Maybe Text
a -> GameServerGroup
s {$sel:roleArn:GameServerGroup' :: Maybe Text
roleArn = Maybe Text
a} :: GameServerGroup)

-- | The current status of the game server group. Possible statuses include:
--
-- -   @NEW@ - GameLift FleetIQ has validated the @CreateGameServerGroup()@
--     request.
--
-- -   @ACTIVATING@ - GameLift FleetIQ is setting up a game server group,
--     which includes creating an Auto Scaling group in your Amazon Web
--     Services account.
--
-- -   @ACTIVE@ - The game server group has been successfully created.
--
-- -   @DELETE_SCHEDULED@ - A request to delete the game server group has
--     been received.
--
-- -   @DELETING@ - GameLift FleetIQ has received a valid
--     @DeleteGameServerGroup()@ request and is processing it. GameLift
--     FleetIQ must first complete and release hosts before it deletes the
--     Auto Scaling group and the game server group.
--
-- -   @DELETED@ - The game server group has been successfully deleted.
--
-- -   @ERROR@ - The asynchronous processes of activating or deleting a
--     game server group has failed, resulting in an error state.
gameServerGroup_status :: Lens.Lens' GameServerGroup (Prelude.Maybe GameServerGroupStatus)
gameServerGroup_status :: Lens' GameServerGroup (Maybe GameServerGroupStatus)
gameServerGroup_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServerGroup' {Maybe GameServerGroupStatus
status :: Maybe GameServerGroupStatus
$sel:status:GameServerGroup' :: GameServerGroup -> Maybe GameServerGroupStatus
status} -> Maybe GameServerGroupStatus
status) (\s :: GameServerGroup
s@GameServerGroup' {} Maybe GameServerGroupStatus
a -> GameServerGroup
s {$sel:status:GameServerGroup' :: Maybe GameServerGroupStatus
status = Maybe GameServerGroupStatus
a} :: GameServerGroup)

-- | Additional information about the current game server group status. This
-- information might provide additional insight on groups that are in
-- @ERROR@ status.
gameServerGroup_statusReason :: Lens.Lens' GameServerGroup (Prelude.Maybe Prelude.Text)
gameServerGroup_statusReason :: Lens' GameServerGroup (Maybe Text)
gameServerGroup_statusReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServerGroup' {Maybe Text
statusReason :: Maybe Text
$sel:statusReason:GameServerGroup' :: GameServerGroup -> Maybe Text
statusReason} -> Maybe Text
statusReason) (\s :: GameServerGroup
s@GameServerGroup' {} Maybe Text
a -> GameServerGroup
s {$sel:statusReason:GameServerGroup' :: Maybe Text
statusReason = Maybe Text
a} :: GameServerGroup)

-- | A list of activities that are currently suspended for this game server
-- group. If this property is empty, all activities are occurring.
gameServerGroup_suspendedActions :: Lens.Lens' GameServerGroup (Prelude.Maybe (Prelude.NonEmpty GameServerGroupAction))
gameServerGroup_suspendedActions :: Lens' GameServerGroup (Maybe (NonEmpty GameServerGroupAction))
gameServerGroup_suspendedActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServerGroup' {Maybe (NonEmpty GameServerGroupAction)
suspendedActions :: Maybe (NonEmpty GameServerGroupAction)
$sel:suspendedActions:GameServerGroup' :: GameServerGroup -> Maybe (NonEmpty GameServerGroupAction)
suspendedActions} -> Maybe (NonEmpty GameServerGroupAction)
suspendedActions) (\s :: GameServerGroup
s@GameServerGroup' {} Maybe (NonEmpty GameServerGroupAction)
a -> GameServerGroup
s {$sel:suspendedActions:GameServerGroup' :: Maybe (NonEmpty GameServerGroupAction)
suspendedActions = Maybe (NonEmpty GameServerGroupAction)
a} :: GameServerGroup) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON GameServerGroup where
  parseJSON :: Value -> Parser GameServerGroup
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"GameServerGroup"
      ( \Object
x ->
          Maybe Text
-> Maybe BalancingStrategy
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe GameServerProtectionPolicy
-> Maybe (NonEmpty InstanceDefinition)
-> Maybe POSIX
-> Maybe Text
-> Maybe GameServerGroupStatus
-> Maybe Text
-> Maybe (NonEmpty GameServerGroupAction)
-> GameServerGroup
GameServerGroup'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AutoScalingGroupArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"BalancingStrategy")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"GameServerGroupArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"GameServerGroupName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"GameServerProtectionPolicy")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"InstanceDefinitions")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastUpdatedTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RoleArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StatusReason")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SuspendedActions")
      )

instance Prelude.Hashable GameServerGroup where
  hashWithSalt :: Int -> GameServerGroup -> Int
hashWithSalt Int
_salt GameServerGroup' {Maybe (NonEmpty GameServerGroupAction)
Maybe (NonEmpty InstanceDefinition)
Maybe Text
Maybe POSIX
Maybe BalancingStrategy
Maybe GameServerGroupStatus
Maybe GameServerProtectionPolicy
suspendedActions :: Maybe (NonEmpty GameServerGroupAction)
statusReason :: Maybe Text
status :: Maybe GameServerGroupStatus
roleArn :: Maybe Text
lastUpdatedTime :: Maybe POSIX
instanceDefinitions :: Maybe (NonEmpty InstanceDefinition)
gameServerProtectionPolicy :: Maybe GameServerProtectionPolicy
gameServerGroupName :: Maybe Text
gameServerGroupArn :: Maybe Text
creationTime :: Maybe POSIX
balancingStrategy :: Maybe BalancingStrategy
autoScalingGroupArn :: Maybe Text
$sel:suspendedActions:GameServerGroup' :: GameServerGroup -> Maybe (NonEmpty GameServerGroupAction)
$sel:statusReason:GameServerGroup' :: GameServerGroup -> Maybe Text
$sel:status:GameServerGroup' :: GameServerGroup -> Maybe GameServerGroupStatus
$sel:roleArn:GameServerGroup' :: GameServerGroup -> Maybe Text
$sel:lastUpdatedTime:GameServerGroup' :: GameServerGroup -> Maybe POSIX
$sel:instanceDefinitions:GameServerGroup' :: GameServerGroup -> Maybe (NonEmpty InstanceDefinition)
$sel:gameServerProtectionPolicy:GameServerGroup' :: GameServerGroup -> Maybe GameServerProtectionPolicy
$sel:gameServerGroupName:GameServerGroup' :: GameServerGroup -> Maybe Text
$sel:gameServerGroupArn:GameServerGroup' :: GameServerGroup -> Maybe Text
$sel:creationTime:GameServerGroup' :: GameServerGroup -> Maybe POSIX
$sel:balancingStrategy:GameServerGroup' :: GameServerGroup -> Maybe BalancingStrategy
$sel:autoScalingGroupArn:GameServerGroup' :: GameServerGroup -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
autoScalingGroupArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BalancingStrategy
balancingStrategy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gameServerGroupArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gameServerGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GameServerProtectionPolicy
gameServerProtectionPolicy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty InstanceDefinition)
instanceDefinitions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GameServerGroupStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusReason
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty GameServerGroupAction)
suspendedActions

instance Prelude.NFData GameServerGroup where
  rnf :: GameServerGroup -> ()
rnf GameServerGroup' {Maybe (NonEmpty GameServerGroupAction)
Maybe (NonEmpty InstanceDefinition)
Maybe Text
Maybe POSIX
Maybe BalancingStrategy
Maybe GameServerGroupStatus
Maybe GameServerProtectionPolicy
suspendedActions :: Maybe (NonEmpty GameServerGroupAction)
statusReason :: Maybe Text
status :: Maybe GameServerGroupStatus
roleArn :: Maybe Text
lastUpdatedTime :: Maybe POSIX
instanceDefinitions :: Maybe (NonEmpty InstanceDefinition)
gameServerProtectionPolicy :: Maybe GameServerProtectionPolicy
gameServerGroupName :: Maybe Text
gameServerGroupArn :: Maybe Text
creationTime :: Maybe POSIX
balancingStrategy :: Maybe BalancingStrategy
autoScalingGroupArn :: Maybe Text
$sel:suspendedActions:GameServerGroup' :: GameServerGroup -> Maybe (NonEmpty GameServerGroupAction)
$sel:statusReason:GameServerGroup' :: GameServerGroup -> Maybe Text
$sel:status:GameServerGroup' :: GameServerGroup -> Maybe GameServerGroupStatus
$sel:roleArn:GameServerGroup' :: GameServerGroup -> Maybe Text
$sel:lastUpdatedTime:GameServerGroup' :: GameServerGroup -> Maybe POSIX
$sel:instanceDefinitions:GameServerGroup' :: GameServerGroup -> Maybe (NonEmpty InstanceDefinition)
$sel:gameServerProtectionPolicy:GameServerGroup' :: GameServerGroup -> Maybe GameServerProtectionPolicy
$sel:gameServerGroupName:GameServerGroup' :: GameServerGroup -> Maybe Text
$sel:gameServerGroupArn:GameServerGroup' :: GameServerGroup -> Maybe Text
$sel:creationTime:GameServerGroup' :: GameServerGroup -> Maybe POSIX
$sel:balancingStrategy:GameServerGroup' :: GameServerGroup -> Maybe BalancingStrategy
$sel:autoScalingGroupArn:GameServerGroup' :: GameServerGroup -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
autoScalingGroupArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe BalancingStrategy
balancingStrategy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gameServerGroupArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gameServerGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe GameServerProtectionPolicy
gameServerProtectionPolicy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty InstanceDefinition)
instanceDefinitions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe GameServerGroupStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusReason
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty GameServerGroupAction)
suspendedActions