{-# 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.GameSessionQueue
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.GameLift.Types.GameSessionQueue where

import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types.FilterConfiguration
import Amazonka.GameLift.Types.GameSessionQueueDestination
import Amazonka.GameLift.Types.PlayerLatencyPolicy
import Amazonka.GameLift.Types.PriorityConfiguration
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Configuration for a game session placement mechanism that processes
-- requests for new game sessions. A queue can be used on its own or as
-- part of a matchmaking solution.
--
-- __Related actions__
--
-- CreateGameSessionQueue | DescribeGameSessionQueues |
-- UpdateGameSessionQueue
--
-- /See:/ 'newGameSessionQueue' smart constructor.
data GameSessionQueue = GameSessionQueue'
  { -- | The Amazon Resource Name
    -- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
    -- that is assigned to a GameLift game session queue resource and uniquely
    -- identifies it. ARNs are unique across all Regions. Format is
    -- @arn:aws:gamelift:\<region>::gamesessionqueue\/\<queue name>@. In a
    -- GameLift game session queue ARN, the resource ID matches the /Name/
    -- value.
    GameSessionQueue -> Maybe Text
gameSessionQueueArn :: Prelude.Maybe Prelude.Text,
    -- | A set of policies that act as a sliding cap on player latency. FleetIQ
    -- works to deliver low latency for most players in a game session. These
    -- policies ensure that no individual player can be placed into a game with
    -- unreasonably high latency. Use multiple policies to gradually relax
    -- latency requirements a step at a time. Multiple policies are applied
    -- based on their maximum allowed latency, starting with the lowest value.
    GameSessionQueue -> Maybe [PlayerLatencyPolicy]
playerLatencyPolicies :: Prelude.Maybe [PlayerLatencyPolicy],
    -- | A list of locations where a queue is allowed to place new game sessions.
    -- Locations are specified in the form of AWS Region codes, such as
    -- @us-west-2@. If this parameter is not set, game sessions can be placed
    -- in any queue location.
    GameSessionQueue -> Maybe FilterConfiguration
filterConfiguration :: Prelude.Maybe FilterConfiguration,
    -- | An SNS topic ARN that is set up to receive game session placement
    -- notifications. See
    -- <https://docs.aws.amazon.com/gamelift/latest/developerguide/queue-notification.html Setting up notifications for game session placement>.
    GameSessionQueue -> Maybe Text
notificationTarget :: Prelude.Maybe Prelude.Text,
    -- | The maximum time, in seconds, that a new game session placement request
    -- remains in the queue. When a request exceeds this time, the game session
    -- placement changes to a @TIMED_OUT@ status.
    GameSessionQueue -> Maybe Natural
timeoutInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | A list of fleets and\/or fleet aliases that can be used to fulfill game
    -- session placement requests in the queue. Destinations are identified by
    -- either a fleet ARN or a fleet alias ARN, and are listed in order of
    -- placement preference.
    GameSessionQueue -> Maybe [GameSessionQueueDestination]
destinations :: Prelude.Maybe [GameSessionQueueDestination],
    -- | A descriptive label that is associated with game session queue. Queue
    -- names must be unique within each Region.
    GameSessionQueue -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Information that is added to all events that are related to this game
    -- session queue.
    GameSessionQueue -> Maybe Text
customEventData :: Prelude.Maybe Prelude.Text,
    -- | Custom settings to use when prioritizing destinations and locations for
    -- game session placements. This configuration replaces the FleetIQ default
    -- prioritization process. Priority types that are not explicitly named
    -- will be automatically applied at the end of the prioritization process.
    GameSessionQueue -> Maybe PriorityConfiguration
priorityConfiguration :: Prelude.Maybe PriorityConfiguration
  }
  deriving (GameSessionQueue -> GameSessionQueue -> Bool
(GameSessionQueue -> GameSessionQueue -> Bool)
-> (GameSessionQueue -> GameSessionQueue -> Bool)
-> Eq GameSessionQueue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GameSessionQueue -> GameSessionQueue -> Bool
$c/= :: GameSessionQueue -> GameSessionQueue -> Bool
== :: GameSessionQueue -> GameSessionQueue -> Bool
$c== :: GameSessionQueue -> GameSessionQueue -> Bool
Prelude.Eq, ReadPrec [GameSessionQueue]
ReadPrec GameSessionQueue
Int -> ReadS GameSessionQueue
ReadS [GameSessionQueue]
(Int -> ReadS GameSessionQueue)
-> ReadS [GameSessionQueue]
-> ReadPrec GameSessionQueue
-> ReadPrec [GameSessionQueue]
-> Read GameSessionQueue
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GameSessionQueue]
$creadListPrec :: ReadPrec [GameSessionQueue]
readPrec :: ReadPrec GameSessionQueue
$creadPrec :: ReadPrec GameSessionQueue
readList :: ReadS [GameSessionQueue]
$creadList :: ReadS [GameSessionQueue]
readsPrec :: Int -> ReadS GameSessionQueue
$creadsPrec :: Int -> ReadS GameSessionQueue
Prelude.Read, Int -> GameSessionQueue -> ShowS
[GameSessionQueue] -> ShowS
GameSessionQueue -> String
(Int -> GameSessionQueue -> ShowS)
-> (GameSessionQueue -> String)
-> ([GameSessionQueue] -> ShowS)
-> Show GameSessionQueue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GameSessionQueue] -> ShowS
$cshowList :: [GameSessionQueue] -> ShowS
show :: GameSessionQueue -> String
$cshow :: GameSessionQueue -> String
showsPrec :: Int -> GameSessionQueue -> ShowS
$cshowsPrec :: Int -> GameSessionQueue -> ShowS
Prelude.Show, (forall x. GameSessionQueue -> Rep GameSessionQueue x)
-> (forall x. Rep GameSessionQueue x -> GameSessionQueue)
-> Generic GameSessionQueue
forall x. Rep GameSessionQueue x -> GameSessionQueue
forall x. GameSessionQueue -> Rep GameSessionQueue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GameSessionQueue x -> GameSessionQueue
$cfrom :: forall x. GameSessionQueue -> Rep GameSessionQueue x
Prelude.Generic)

-- |
-- Create a value of 'GameSessionQueue' 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:
--
-- 'gameSessionQueueArn', 'gameSessionQueue_gameSessionQueueArn' - The Amazon Resource Name
-- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
-- that is assigned to a GameLift game session queue resource and uniquely
-- identifies it. ARNs are unique across all Regions. Format is
-- @arn:aws:gamelift:\<region>::gamesessionqueue\/\<queue name>@. In a
-- GameLift game session queue ARN, the resource ID matches the /Name/
-- value.
--
-- 'playerLatencyPolicies', 'gameSessionQueue_playerLatencyPolicies' - A set of policies that act as a sliding cap on player latency. FleetIQ
-- works to deliver low latency for most players in a game session. These
-- policies ensure that no individual player can be placed into a game with
-- unreasonably high latency. Use multiple policies to gradually relax
-- latency requirements a step at a time. Multiple policies are applied
-- based on their maximum allowed latency, starting with the lowest value.
--
-- 'filterConfiguration', 'gameSessionQueue_filterConfiguration' - A list of locations where a queue is allowed to place new game sessions.
-- Locations are specified in the form of AWS Region codes, such as
-- @us-west-2@. If this parameter is not set, game sessions can be placed
-- in any queue location.
--
-- 'notificationTarget', 'gameSessionQueue_notificationTarget' - An SNS topic ARN that is set up to receive game session placement
-- notifications. See
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/queue-notification.html Setting up notifications for game session placement>.
--
-- 'timeoutInSeconds', 'gameSessionQueue_timeoutInSeconds' - The maximum time, in seconds, that a new game session placement request
-- remains in the queue. When a request exceeds this time, the game session
-- placement changes to a @TIMED_OUT@ status.
--
-- 'destinations', 'gameSessionQueue_destinations' - A list of fleets and\/or fleet aliases that can be used to fulfill game
-- session placement requests in the queue. Destinations are identified by
-- either a fleet ARN or a fleet alias ARN, and are listed in order of
-- placement preference.
--
-- 'name', 'gameSessionQueue_name' - A descriptive label that is associated with game session queue. Queue
-- names must be unique within each Region.
--
-- 'customEventData', 'gameSessionQueue_customEventData' - Information that is added to all events that are related to this game
-- session queue.
--
-- 'priorityConfiguration', 'gameSessionQueue_priorityConfiguration' - Custom settings to use when prioritizing destinations and locations for
-- game session placements. This configuration replaces the FleetIQ default
-- prioritization process. Priority types that are not explicitly named
-- will be automatically applied at the end of the prioritization process.
newGameSessionQueue ::
  GameSessionQueue
newGameSessionQueue :: GameSessionQueue
newGameSessionQueue =
  GameSessionQueue' :: Maybe Text
-> Maybe [PlayerLatencyPolicy]
-> Maybe FilterConfiguration
-> Maybe Text
-> Maybe Natural
-> Maybe [GameSessionQueueDestination]
-> Maybe Text
-> Maybe Text
-> Maybe PriorityConfiguration
-> GameSessionQueue
GameSessionQueue'
    { $sel:gameSessionQueueArn:GameSessionQueue' :: Maybe Text
gameSessionQueueArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:playerLatencyPolicies:GameSessionQueue' :: Maybe [PlayerLatencyPolicy]
playerLatencyPolicies = Maybe [PlayerLatencyPolicy]
forall a. Maybe a
Prelude.Nothing,
      $sel:filterConfiguration:GameSessionQueue' :: Maybe FilterConfiguration
filterConfiguration = Maybe FilterConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:notificationTarget:GameSessionQueue' :: Maybe Text
notificationTarget = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:timeoutInSeconds:GameSessionQueue' :: Maybe Natural
timeoutInSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:destinations:GameSessionQueue' :: Maybe [GameSessionQueueDestination]
destinations = Maybe [GameSessionQueueDestination]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GameSessionQueue' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customEventData:GameSessionQueue' :: Maybe Text
customEventData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:priorityConfiguration:GameSessionQueue' :: Maybe PriorityConfiguration
priorityConfiguration = Maybe PriorityConfiguration
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name
-- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
-- that is assigned to a GameLift game session queue resource and uniquely
-- identifies it. ARNs are unique across all Regions. Format is
-- @arn:aws:gamelift:\<region>::gamesessionqueue\/\<queue name>@. In a
-- GameLift game session queue ARN, the resource ID matches the /Name/
-- value.
gameSessionQueue_gameSessionQueueArn :: Lens.Lens' GameSessionQueue (Prelude.Maybe Prelude.Text)
gameSessionQueue_gameSessionQueueArn :: (Maybe Text -> f (Maybe Text))
-> GameSessionQueue -> f GameSessionQueue
gameSessionQueue_gameSessionQueueArn = (GameSessionQueue -> Maybe Text)
-> (GameSessionQueue -> Maybe Text -> GameSessionQueue)
-> Lens GameSessionQueue GameSessionQueue (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionQueue' {Maybe Text
gameSessionQueueArn :: Maybe Text
$sel:gameSessionQueueArn:GameSessionQueue' :: GameSessionQueue -> Maybe Text
gameSessionQueueArn} -> Maybe Text
gameSessionQueueArn) (\s :: GameSessionQueue
s@GameSessionQueue' {} Maybe Text
a -> GameSessionQueue
s {$sel:gameSessionQueueArn:GameSessionQueue' :: Maybe Text
gameSessionQueueArn = Maybe Text
a} :: GameSessionQueue)

-- | A set of policies that act as a sliding cap on player latency. FleetIQ
-- works to deliver low latency for most players in a game session. These
-- policies ensure that no individual player can be placed into a game with
-- unreasonably high latency. Use multiple policies to gradually relax
-- latency requirements a step at a time. Multiple policies are applied
-- based on their maximum allowed latency, starting with the lowest value.
gameSessionQueue_playerLatencyPolicies :: Lens.Lens' GameSessionQueue (Prelude.Maybe [PlayerLatencyPolicy])
gameSessionQueue_playerLatencyPolicies :: (Maybe [PlayerLatencyPolicy] -> f (Maybe [PlayerLatencyPolicy]))
-> GameSessionQueue -> f GameSessionQueue
gameSessionQueue_playerLatencyPolicies = (GameSessionQueue -> Maybe [PlayerLatencyPolicy])
-> (GameSessionQueue
    -> Maybe [PlayerLatencyPolicy] -> GameSessionQueue)
-> Lens
     GameSessionQueue
     GameSessionQueue
     (Maybe [PlayerLatencyPolicy])
     (Maybe [PlayerLatencyPolicy])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionQueue' {Maybe [PlayerLatencyPolicy]
playerLatencyPolicies :: Maybe [PlayerLatencyPolicy]
$sel:playerLatencyPolicies:GameSessionQueue' :: GameSessionQueue -> Maybe [PlayerLatencyPolicy]
playerLatencyPolicies} -> Maybe [PlayerLatencyPolicy]
playerLatencyPolicies) (\s :: GameSessionQueue
s@GameSessionQueue' {} Maybe [PlayerLatencyPolicy]
a -> GameSessionQueue
s {$sel:playerLatencyPolicies:GameSessionQueue' :: Maybe [PlayerLatencyPolicy]
playerLatencyPolicies = Maybe [PlayerLatencyPolicy]
a} :: GameSessionQueue) ((Maybe [PlayerLatencyPolicy] -> f (Maybe [PlayerLatencyPolicy]))
 -> GameSessionQueue -> f GameSessionQueue)
-> ((Maybe [PlayerLatencyPolicy]
     -> f (Maybe [PlayerLatencyPolicy]))
    -> Maybe [PlayerLatencyPolicy] -> f (Maybe [PlayerLatencyPolicy]))
-> (Maybe [PlayerLatencyPolicy] -> f (Maybe [PlayerLatencyPolicy]))
-> GameSessionQueue
-> f GameSessionQueue
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PlayerLatencyPolicy]
  [PlayerLatencyPolicy]
  [PlayerLatencyPolicy]
  [PlayerLatencyPolicy]
-> Iso
     (Maybe [PlayerLatencyPolicy])
     (Maybe [PlayerLatencyPolicy])
     (Maybe [PlayerLatencyPolicy])
     (Maybe [PlayerLatencyPolicy])
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 AnIso
  [PlayerLatencyPolicy]
  [PlayerLatencyPolicy]
  [PlayerLatencyPolicy]
  [PlayerLatencyPolicy]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of locations where a queue is allowed to place new game sessions.
-- Locations are specified in the form of AWS Region codes, such as
-- @us-west-2@. If this parameter is not set, game sessions can be placed
-- in any queue location.
gameSessionQueue_filterConfiguration :: Lens.Lens' GameSessionQueue (Prelude.Maybe FilterConfiguration)
gameSessionQueue_filterConfiguration :: (Maybe FilterConfiguration -> f (Maybe FilterConfiguration))
-> GameSessionQueue -> f GameSessionQueue
gameSessionQueue_filterConfiguration = (GameSessionQueue -> Maybe FilterConfiguration)
-> (GameSessionQueue
    -> Maybe FilterConfiguration -> GameSessionQueue)
-> Lens
     GameSessionQueue
     GameSessionQueue
     (Maybe FilterConfiguration)
     (Maybe FilterConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionQueue' {Maybe FilterConfiguration
filterConfiguration :: Maybe FilterConfiguration
$sel:filterConfiguration:GameSessionQueue' :: GameSessionQueue -> Maybe FilterConfiguration
filterConfiguration} -> Maybe FilterConfiguration
filterConfiguration) (\s :: GameSessionQueue
s@GameSessionQueue' {} Maybe FilterConfiguration
a -> GameSessionQueue
s {$sel:filterConfiguration:GameSessionQueue' :: Maybe FilterConfiguration
filterConfiguration = Maybe FilterConfiguration
a} :: GameSessionQueue)

-- | An SNS topic ARN that is set up to receive game session placement
-- notifications. See
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/queue-notification.html Setting up notifications for game session placement>.
gameSessionQueue_notificationTarget :: Lens.Lens' GameSessionQueue (Prelude.Maybe Prelude.Text)
gameSessionQueue_notificationTarget :: (Maybe Text -> f (Maybe Text))
-> GameSessionQueue -> f GameSessionQueue
gameSessionQueue_notificationTarget = (GameSessionQueue -> Maybe Text)
-> (GameSessionQueue -> Maybe Text -> GameSessionQueue)
-> Lens GameSessionQueue GameSessionQueue (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionQueue' {Maybe Text
notificationTarget :: Maybe Text
$sel:notificationTarget:GameSessionQueue' :: GameSessionQueue -> Maybe Text
notificationTarget} -> Maybe Text
notificationTarget) (\s :: GameSessionQueue
s@GameSessionQueue' {} Maybe Text
a -> GameSessionQueue
s {$sel:notificationTarget:GameSessionQueue' :: Maybe Text
notificationTarget = Maybe Text
a} :: GameSessionQueue)

-- | The maximum time, in seconds, that a new game session placement request
-- remains in the queue. When a request exceeds this time, the game session
-- placement changes to a @TIMED_OUT@ status.
gameSessionQueue_timeoutInSeconds :: Lens.Lens' GameSessionQueue (Prelude.Maybe Prelude.Natural)
gameSessionQueue_timeoutInSeconds :: (Maybe Natural -> f (Maybe Natural))
-> GameSessionQueue -> f GameSessionQueue
gameSessionQueue_timeoutInSeconds = (GameSessionQueue -> Maybe Natural)
-> (GameSessionQueue -> Maybe Natural -> GameSessionQueue)
-> Lens
     GameSessionQueue GameSessionQueue (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionQueue' {Maybe Natural
timeoutInSeconds :: Maybe Natural
$sel:timeoutInSeconds:GameSessionQueue' :: GameSessionQueue -> Maybe Natural
timeoutInSeconds} -> Maybe Natural
timeoutInSeconds) (\s :: GameSessionQueue
s@GameSessionQueue' {} Maybe Natural
a -> GameSessionQueue
s {$sel:timeoutInSeconds:GameSessionQueue' :: Maybe Natural
timeoutInSeconds = Maybe Natural
a} :: GameSessionQueue)

-- | A list of fleets and\/or fleet aliases that can be used to fulfill game
-- session placement requests in the queue. Destinations are identified by
-- either a fleet ARN or a fleet alias ARN, and are listed in order of
-- placement preference.
gameSessionQueue_destinations :: Lens.Lens' GameSessionQueue (Prelude.Maybe [GameSessionQueueDestination])
gameSessionQueue_destinations :: (Maybe [GameSessionQueueDestination]
 -> f (Maybe [GameSessionQueueDestination]))
-> GameSessionQueue -> f GameSessionQueue
gameSessionQueue_destinations = (GameSessionQueue -> Maybe [GameSessionQueueDestination])
-> (GameSessionQueue
    -> Maybe [GameSessionQueueDestination] -> GameSessionQueue)
-> Lens
     GameSessionQueue
     GameSessionQueue
     (Maybe [GameSessionQueueDestination])
     (Maybe [GameSessionQueueDestination])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionQueue' {Maybe [GameSessionQueueDestination]
destinations :: Maybe [GameSessionQueueDestination]
$sel:destinations:GameSessionQueue' :: GameSessionQueue -> Maybe [GameSessionQueueDestination]
destinations} -> Maybe [GameSessionQueueDestination]
destinations) (\s :: GameSessionQueue
s@GameSessionQueue' {} Maybe [GameSessionQueueDestination]
a -> GameSessionQueue
s {$sel:destinations:GameSessionQueue' :: Maybe [GameSessionQueueDestination]
destinations = Maybe [GameSessionQueueDestination]
a} :: GameSessionQueue) ((Maybe [GameSessionQueueDestination]
  -> f (Maybe [GameSessionQueueDestination]))
 -> GameSessionQueue -> f GameSessionQueue)
-> ((Maybe [GameSessionQueueDestination]
     -> f (Maybe [GameSessionQueueDestination]))
    -> Maybe [GameSessionQueueDestination]
    -> f (Maybe [GameSessionQueueDestination]))
-> (Maybe [GameSessionQueueDestination]
    -> f (Maybe [GameSessionQueueDestination]))
-> GameSessionQueue
-> f GameSessionQueue
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [GameSessionQueueDestination]
  [GameSessionQueueDestination]
  [GameSessionQueueDestination]
  [GameSessionQueueDestination]
-> Iso
     (Maybe [GameSessionQueueDestination])
     (Maybe [GameSessionQueueDestination])
     (Maybe [GameSessionQueueDestination])
     (Maybe [GameSessionQueueDestination])
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 AnIso
  [GameSessionQueueDestination]
  [GameSessionQueueDestination]
  [GameSessionQueueDestination]
  [GameSessionQueueDestination]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A descriptive label that is associated with game session queue. Queue
-- names must be unique within each Region.
gameSessionQueue_name :: Lens.Lens' GameSessionQueue (Prelude.Maybe Prelude.Text)
gameSessionQueue_name :: (Maybe Text -> f (Maybe Text))
-> GameSessionQueue -> f GameSessionQueue
gameSessionQueue_name = (GameSessionQueue -> Maybe Text)
-> (GameSessionQueue -> Maybe Text -> GameSessionQueue)
-> Lens GameSessionQueue GameSessionQueue (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionQueue' {Maybe Text
name :: Maybe Text
$sel:name:GameSessionQueue' :: GameSessionQueue -> Maybe Text
name} -> Maybe Text
name) (\s :: GameSessionQueue
s@GameSessionQueue' {} Maybe Text
a -> GameSessionQueue
s {$sel:name:GameSessionQueue' :: Maybe Text
name = Maybe Text
a} :: GameSessionQueue)

-- | Information that is added to all events that are related to this game
-- session queue.
gameSessionQueue_customEventData :: Lens.Lens' GameSessionQueue (Prelude.Maybe Prelude.Text)
gameSessionQueue_customEventData :: (Maybe Text -> f (Maybe Text))
-> GameSessionQueue -> f GameSessionQueue
gameSessionQueue_customEventData = (GameSessionQueue -> Maybe Text)
-> (GameSessionQueue -> Maybe Text -> GameSessionQueue)
-> Lens GameSessionQueue GameSessionQueue (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionQueue' {Maybe Text
customEventData :: Maybe Text
$sel:customEventData:GameSessionQueue' :: GameSessionQueue -> Maybe Text
customEventData} -> Maybe Text
customEventData) (\s :: GameSessionQueue
s@GameSessionQueue' {} Maybe Text
a -> GameSessionQueue
s {$sel:customEventData:GameSessionQueue' :: Maybe Text
customEventData = Maybe Text
a} :: GameSessionQueue)

-- | Custom settings to use when prioritizing destinations and locations for
-- game session placements. This configuration replaces the FleetIQ default
-- prioritization process. Priority types that are not explicitly named
-- will be automatically applied at the end of the prioritization process.
gameSessionQueue_priorityConfiguration :: Lens.Lens' GameSessionQueue (Prelude.Maybe PriorityConfiguration)
gameSessionQueue_priorityConfiguration :: (Maybe PriorityConfiguration -> f (Maybe PriorityConfiguration))
-> GameSessionQueue -> f GameSessionQueue
gameSessionQueue_priorityConfiguration = (GameSessionQueue -> Maybe PriorityConfiguration)
-> (GameSessionQueue
    -> Maybe PriorityConfiguration -> GameSessionQueue)
-> Lens
     GameSessionQueue
     GameSessionQueue
     (Maybe PriorityConfiguration)
     (Maybe PriorityConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionQueue' {Maybe PriorityConfiguration
priorityConfiguration :: Maybe PriorityConfiguration
$sel:priorityConfiguration:GameSessionQueue' :: GameSessionQueue -> Maybe PriorityConfiguration
priorityConfiguration} -> Maybe PriorityConfiguration
priorityConfiguration) (\s :: GameSessionQueue
s@GameSessionQueue' {} Maybe PriorityConfiguration
a -> GameSessionQueue
s {$sel:priorityConfiguration:GameSessionQueue' :: Maybe PriorityConfiguration
priorityConfiguration = Maybe PriorityConfiguration
a} :: GameSessionQueue)

instance Core.FromJSON GameSessionQueue where
  parseJSON :: Value -> Parser GameSessionQueue
parseJSON =
    String
-> (Object -> Parser GameSessionQueue)
-> Value
-> Parser GameSessionQueue
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"GameSessionQueue"
      ( \Object
x ->
          Maybe Text
-> Maybe [PlayerLatencyPolicy]
-> Maybe FilterConfiguration
-> Maybe Text
-> Maybe Natural
-> Maybe [GameSessionQueueDestination]
-> Maybe Text
-> Maybe Text
-> Maybe PriorityConfiguration
-> GameSessionQueue
GameSessionQueue'
            (Maybe Text
 -> Maybe [PlayerLatencyPolicy]
 -> Maybe FilterConfiguration
 -> Maybe Text
 -> Maybe Natural
 -> Maybe [GameSessionQueueDestination]
 -> Maybe Text
 -> Maybe Text
 -> Maybe PriorityConfiguration
 -> GameSessionQueue)
-> Parser (Maybe Text)
-> Parser
     (Maybe [PlayerLatencyPolicy]
      -> Maybe FilterConfiguration
      -> Maybe Text
      -> Maybe Natural
      -> Maybe [GameSessionQueueDestination]
      -> Maybe Text
      -> Maybe Text
      -> Maybe PriorityConfiguration
      -> GameSessionQueue)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GameSessionQueueArn")
            Parser
  (Maybe [PlayerLatencyPolicy]
   -> Maybe FilterConfiguration
   -> Maybe Text
   -> Maybe Natural
   -> Maybe [GameSessionQueueDestination]
   -> Maybe Text
   -> Maybe Text
   -> Maybe PriorityConfiguration
   -> GameSessionQueue)
-> Parser (Maybe [PlayerLatencyPolicy])
-> Parser
     (Maybe FilterConfiguration
      -> Maybe Text
      -> Maybe Natural
      -> Maybe [GameSessionQueueDestination]
      -> Maybe Text
      -> Maybe Text
      -> Maybe PriorityConfiguration
      -> GameSessionQueue)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [PlayerLatencyPolicy]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PlayerLatencyPolicies"
                            Parser (Maybe (Maybe [PlayerLatencyPolicy]))
-> Maybe [PlayerLatencyPolicy]
-> Parser (Maybe [PlayerLatencyPolicy])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [PlayerLatencyPolicy]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe FilterConfiguration
   -> Maybe Text
   -> Maybe Natural
   -> Maybe [GameSessionQueueDestination]
   -> Maybe Text
   -> Maybe Text
   -> Maybe PriorityConfiguration
   -> GameSessionQueue)
-> Parser (Maybe FilterConfiguration)
-> Parser
     (Maybe Text
      -> Maybe Natural
      -> Maybe [GameSessionQueueDestination]
      -> Maybe Text
      -> Maybe Text
      -> Maybe PriorityConfiguration
      -> GameSessionQueue)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FilterConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FilterConfiguration")
            Parser
  (Maybe Text
   -> Maybe Natural
   -> Maybe [GameSessionQueueDestination]
   -> Maybe Text
   -> Maybe Text
   -> Maybe PriorityConfiguration
   -> GameSessionQueue)
-> Parser (Maybe Text)
-> Parser
     (Maybe Natural
      -> Maybe [GameSessionQueueDestination]
      -> Maybe Text
      -> Maybe Text
      -> Maybe PriorityConfiguration
      -> GameSessionQueue)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NotificationTarget")
            Parser
  (Maybe Natural
   -> Maybe [GameSessionQueueDestination]
   -> Maybe Text
   -> Maybe Text
   -> Maybe PriorityConfiguration
   -> GameSessionQueue)
-> Parser (Maybe Natural)
-> Parser
     (Maybe [GameSessionQueueDestination]
      -> Maybe Text
      -> Maybe Text
      -> Maybe PriorityConfiguration
      -> GameSessionQueue)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TimeoutInSeconds")
            Parser
  (Maybe [GameSessionQueueDestination]
   -> Maybe Text
   -> Maybe Text
   -> Maybe PriorityConfiguration
   -> GameSessionQueue)
-> Parser (Maybe [GameSessionQueueDestination])
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe PriorityConfiguration -> GameSessionQueue)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe [GameSessionQueueDestination]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Destinations" Parser (Maybe (Maybe [GameSessionQueueDestination]))
-> Maybe [GameSessionQueueDestination]
-> Parser (Maybe [GameSessionQueueDestination])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [GameSessionQueueDestination]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe PriorityConfiguration -> GameSessionQueue)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe PriorityConfiguration -> GameSessionQueue)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser
  (Maybe Text -> Maybe PriorityConfiguration -> GameSessionQueue)
-> Parser (Maybe Text)
-> Parser (Maybe PriorityConfiguration -> GameSessionQueue)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CustomEventData")
            Parser (Maybe PriorityConfiguration -> GameSessionQueue)
-> Parser (Maybe PriorityConfiguration) -> Parser GameSessionQueue
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PriorityConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PriorityConfiguration")
      )

instance Prelude.Hashable GameSessionQueue

instance Prelude.NFData GameSessionQueue