{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.CreateGameSessionQueue
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a placement queue that processes requests for new game sessions.
-- A queue uses FleetIQ algorithms to determine the best placement
-- locations and find an available game server there, then prompts the game
-- server process to start a new game session.
--
-- A game session queue is configured with a set of destinations (GameLift
-- fleets or aliases), which determine the locations where the queue can
-- place new game sessions. These destinations can span multiple fleet
-- types (Spot and On-Demand), instance types, and Amazon Web Services
-- Regions. If the queue includes multi-location fleets, the queue is able
-- to place game sessions in all of a fleet\'s remote locations. You can
-- opt to filter out individual locations if needed.
--
-- The queue configuration also determines how FleetIQ selects the best
-- available placement for a new game session. Before searching for an
-- available game server, FleetIQ first prioritizes the queue\'s
-- destinations and locations, with the best placement locations on top.
-- You can set up the queue to use the FleetIQ default prioritization or
-- provide an alternate set of priorities.
--
-- To create a new queue, provide a name, timeout value, and a list of
-- destinations. Optionally, specify a sort configuration and\/or a filter,
-- and define a set of latency cap policies. You can also include the ARN
-- for an Amazon Simple Notification Service (SNS) topic to receive
-- notifications of game session placement activity. Notifications using
-- SNS or CloudWatch events is the preferred way to track placement
-- activity.
--
-- If successful, a new @GameSessionQueue@ object is returned with an
-- assigned queue ARN. New game session requests, which are submitted to
-- queue with
-- <https://docs.aws.amazon.com/gamelift/latest/apireference/API_StartGameSessionPlacement.html StartGameSessionPlacement>
-- or
-- <https://docs.aws.amazon.com/gamelift/latest/apireference/API_StartMatchmaking.html StartMatchmaking>,
-- reference a queue\'s name or ARN.
--
-- __Learn more__
--
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/queues-design.html Design a game session queue>
--
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/queues-creating.html Create a game session queue>
--
-- __Related actions__
--
-- <https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateGameSessionQueue.html CreateGameSessionQueue>
-- |
-- <https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeGameSessionQueues.html DescribeGameSessionQueues>
-- |
-- <https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateGameSessionQueue.html UpdateGameSessionQueue>
-- |
-- <https://docs.aws.amazon.com/gamelift/latest/apireference/API_DeleteGameSessionQueue.html DeleteGameSessionQueue>
-- |
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets All APIs by task>
module Amazonka.GameLift.CreateGameSessionQueue
  ( -- * Creating a Request
    CreateGameSessionQueue (..),
    newCreateGameSessionQueue,

    -- * Request Lenses
    createGameSessionQueue_customEventData,
    createGameSessionQueue_destinations,
    createGameSessionQueue_filterConfiguration,
    createGameSessionQueue_notificationTarget,
    createGameSessionQueue_playerLatencyPolicies,
    createGameSessionQueue_priorityConfiguration,
    createGameSessionQueue_tags,
    createGameSessionQueue_timeoutInSeconds,
    createGameSessionQueue_name,

    -- * Destructuring the Response
    CreateGameSessionQueueResponse (..),
    newCreateGameSessionQueueResponse,

    -- * Response Lenses
    createGameSessionQueueResponse_gameSessionQueue,
    createGameSessionQueueResponse_httpStatus,
  )
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
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateGameSessionQueue' smart constructor.
data CreateGameSessionQueue = CreateGameSessionQueue'
  { -- | Information to be added to all events that are related to this game
    -- session queue.
    CreateGameSessionQueue -> Maybe Text
customEventData :: Prelude.Maybe Prelude.Text,
    -- | 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.
    CreateGameSessionQueue -> Maybe [GameSessionQueueDestination]
destinations :: Prelude.Maybe [GameSessionQueueDestination],
    -- | A list of locations where a queue is allowed to place new game sessions.
    -- Locations are specified in the form of Amazon Web Services Region codes,
    -- such as @us-west-2@. If this parameter is not set, game sessions can be
    -- placed in any queue location.
    CreateGameSessionQueue -> 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>.
    CreateGameSessionQueue -> Maybe Text
notificationTarget :: 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.
    CreateGameSessionQueue -> Maybe [PlayerLatencyPolicy]
playerLatencyPolicies :: Prelude.Maybe [PlayerLatencyPolicy],
    -- | 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.
    CreateGameSessionQueue -> Maybe PriorityConfiguration
priorityConfiguration :: Prelude.Maybe PriorityConfiguration,
    -- | A list of labels to assign to the new game session queue resource. Tags
    -- are developer-defined key-value pairs. Tagging Amazon Web Services
    -- resources are useful for resource management, access management and cost
    -- allocation. For more information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>
    -- in the /Amazon Web Services General Reference/.
    CreateGameSessionQueue -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | 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.
    CreateGameSessionQueue -> Maybe Natural
timeoutInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | A descriptive label that is associated with game session queue. Queue
    -- names must be unique within each Region.
    CreateGameSessionQueue -> Text
name :: Prelude.Text
  }
  deriving (CreateGameSessionQueue -> CreateGameSessionQueue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateGameSessionQueue -> CreateGameSessionQueue -> Bool
$c/= :: CreateGameSessionQueue -> CreateGameSessionQueue -> Bool
== :: CreateGameSessionQueue -> CreateGameSessionQueue -> Bool
$c== :: CreateGameSessionQueue -> CreateGameSessionQueue -> Bool
Prelude.Eq, ReadPrec [CreateGameSessionQueue]
ReadPrec CreateGameSessionQueue
Int -> ReadS CreateGameSessionQueue
ReadS [CreateGameSessionQueue]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateGameSessionQueue]
$creadListPrec :: ReadPrec [CreateGameSessionQueue]
readPrec :: ReadPrec CreateGameSessionQueue
$creadPrec :: ReadPrec CreateGameSessionQueue
readList :: ReadS [CreateGameSessionQueue]
$creadList :: ReadS [CreateGameSessionQueue]
readsPrec :: Int -> ReadS CreateGameSessionQueue
$creadsPrec :: Int -> ReadS CreateGameSessionQueue
Prelude.Read, Int -> CreateGameSessionQueue -> ShowS
[CreateGameSessionQueue] -> ShowS
CreateGameSessionQueue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateGameSessionQueue] -> ShowS
$cshowList :: [CreateGameSessionQueue] -> ShowS
show :: CreateGameSessionQueue -> String
$cshow :: CreateGameSessionQueue -> String
showsPrec :: Int -> CreateGameSessionQueue -> ShowS
$cshowsPrec :: Int -> CreateGameSessionQueue -> ShowS
Prelude.Show, forall x. Rep CreateGameSessionQueue x -> CreateGameSessionQueue
forall x. CreateGameSessionQueue -> Rep CreateGameSessionQueue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateGameSessionQueue x -> CreateGameSessionQueue
$cfrom :: forall x. CreateGameSessionQueue -> Rep CreateGameSessionQueue x
Prelude.Generic)

-- |
-- Create a value of 'CreateGameSessionQueue' 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:
--
-- 'customEventData', 'createGameSessionQueue_customEventData' - Information to be added to all events that are related to this game
-- session queue.
--
-- 'destinations', 'createGameSessionQueue_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.
--
-- 'filterConfiguration', 'createGameSessionQueue_filterConfiguration' - A list of locations where a queue is allowed to place new game sessions.
-- Locations are specified in the form of Amazon Web Services Region codes,
-- such as @us-west-2@. If this parameter is not set, game sessions can be
-- placed in any queue location.
--
-- 'notificationTarget', 'createGameSessionQueue_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>.
--
-- 'playerLatencyPolicies', 'createGameSessionQueue_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.
--
-- 'priorityConfiguration', 'createGameSessionQueue_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.
--
-- 'tags', 'createGameSessionQueue_tags' - A list of labels to assign to the new game session queue resource. Tags
-- are developer-defined key-value pairs. Tagging Amazon Web Services
-- resources are useful for resource management, access management and cost
-- allocation. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>
-- in the /Amazon Web Services General Reference/.
--
-- 'timeoutInSeconds', 'createGameSessionQueue_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.
--
-- 'name', 'createGameSessionQueue_name' - A descriptive label that is associated with game session queue. Queue
-- names must be unique within each Region.
newCreateGameSessionQueue ::
  -- | 'name'
  Prelude.Text ->
  CreateGameSessionQueue
newCreateGameSessionQueue :: Text -> CreateGameSessionQueue
newCreateGameSessionQueue Text
pName_ =
  CreateGameSessionQueue'
    { $sel:customEventData:CreateGameSessionQueue' :: Maybe Text
customEventData =
        forall a. Maybe a
Prelude.Nothing,
      $sel:destinations:CreateGameSessionQueue' :: Maybe [GameSessionQueueDestination]
destinations = forall a. Maybe a
Prelude.Nothing,
      $sel:filterConfiguration:CreateGameSessionQueue' :: Maybe FilterConfiguration
filterConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:notificationTarget:CreateGameSessionQueue' :: Maybe Text
notificationTarget = forall a. Maybe a
Prelude.Nothing,
      $sel:playerLatencyPolicies:CreateGameSessionQueue' :: Maybe [PlayerLatencyPolicy]
playerLatencyPolicies = forall a. Maybe a
Prelude.Nothing,
      $sel:priorityConfiguration:CreateGameSessionQueue' :: Maybe PriorityConfiguration
priorityConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateGameSessionQueue' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:timeoutInSeconds:CreateGameSessionQueue' :: Maybe Natural
timeoutInSeconds = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateGameSessionQueue' :: Text
name = Text
pName_
    }

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

-- | 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.
createGameSessionQueue_destinations :: Lens.Lens' CreateGameSessionQueue (Prelude.Maybe [GameSessionQueueDestination])
createGameSessionQueue_destinations :: Lens' CreateGameSessionQueue (Maybe [GameSessionQueueDestination])
createGameSessionQueue_destinations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSessionQueue' {Maybe [GameSessionQueueDestination]
destinations :: Maybe [GameSessionQueueDestination]
$sel:destinations:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe [GameSessionQueueDestination]
destinations} -> Maybe [GameSessionQueueDestination]
destinations) (\s :: CreateGameSessionQueue
s@CreateGameSessionQueue' {} Maybe [GameSessionQueueDestination]
a -> CreateGameSessionQueue
s {$sel:destinations:CreateGameSessionQueue' :: Maybe [GameSessionQueueDestination]
destinations = Maybe [GameSessionQueueDestination]
a} :: CreateGameSessionQueue) 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 list of locations where a queue is allowed to place new game sessions.
-- Locations are specified in the form of Amazon Web Services Region codes,
-- such as @us-west-2@. If this parameter is not set, game sessions can be
-- placed in any queue location.
createGameSessionQueue_filterConfiguration :: Lens.Lens' CreateGameSessionQueue (Prelude.Maybe FilterConfiguration)
createGameSessionQueue_filterConfiguration :: Lens' CreateGameSessionQueue (Maybe FilterConfiguration)
createGameSessionQueue_filterConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSessionQueue' {Maybe FilterConfiguration
filterConfiguration :: Maybe FilterConfiguration
$sel:filterConfiguration:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe FilterConfiguration
filterConfiguration} -> Maybe FilterConfiguration
filterConfiguration) (\s :: CreateGameSessionQueue
s@CreateGameSessionQueue' {} Maybe FilterConfiguration
a -> CreateGameSessionQueue
s {$sel:filterConfiguration:CreateGameSessionQueue' :: Maybe FilterConfiguration
filterConfiguration = Maybe FilterConfiguration
a} :: CreateGameSessionQueue)

-- | 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>.
createGameSessionQueue_notificationTarget :: Lens.Lens' CreateGameSessionQueue (Prelude.Maybe Prelude.Text)
createGameSessionQueue_notificationTarget :: Lens' CreateGameSessionQueue (Maybe Text)
createGameSessionQueue_notificationTarget = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSessionQueue' {Maybe Text
notificationTarget :: Maybe Text
$sel:notificationTarget:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe Text
notificationTarget} -> Maybe Text
notificationTarget) (\s :: CreateGameSessionQueue
s@CreateGameSessionQueue' {} Maybe Text
a -> CreateGameSessionQueue
s {$sel:notificationTarget:CreateGameSessionQueue' :: Maybe Text
notificationTarget = Maybe Text
a} :: CreateGameSessionQueue)

-- | 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.
createGameSessionQueue_playerLatencyPolicies :: Lens.Lens' CreateGameSessionQueue (Prelude.Maybe [PlayerLatencyPolicy])
createGameSessionQueue_playerLatencyPolicies :: Lens' CreateGameSessionQueue (Maybe [PlayerLatencyPolicy])
createGameSessionQueue_playerLatencyPolicies = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSessionQueue' {Maybe [PlayerLatencyPolicy]
playerLatencyPolicies :: Maybe [PlayerLatencyPolicy]
$sel:playerLatencyPolicies:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe [PlayerLatencyPolicy]
playerLatencyPolicies} -> Maybe [PlayerLatencyPolicy]
playerLatencyPolicies) (\s :: CreateGameSessionQueue
s@CreateGameSessionQueue' {} Maybe [PlayerLatencyPolicy]
a -> CreateGameSessionQueue
s {$sel:playerLatencyPolicies:CreateGameSessionQueue' :: Maybe [PlayerLatencyPolicy]
playerLatencyPolicies = Maybe [PlayerLatencyPolicy]
a} :: CreateGameSessionQueue) 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

-- | 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.
createGameSessionQueue_priorityConfiguration :: Lens.Lens' CreateGameSessionQueue (Prelude.Maybe PriorityConfiguration)
createGameSessionQueue_priorityConfiguration :: Lens' CreateGameSessionQueue (Maybe PriorityConfiguration)
createGameSessionQueue_priorityConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSessionQueue' {Maybe PriorityConfiguration
priorityConfiguration :: Maybe PriorityConfiguration
$sel:priorityConfiguration:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe PriorityConfiguration
priorityConfiguration} -> Maybe PriorityConfiguration
priorityConfiguration) (\s :: CreateGameSessionQueue
s@CreateGameSessionQueue' {} Maybe PriorityConfiguration
a -> CreateGameSessionQueue
s {$sel:priorityConfiguration:CreateGameSessionQueue' :: Maybe PriorityConfiguration
priorityConfiguration = Maybe PriorityConfiguration
a} :: CreateGameSessionQueue)

-- | A list of labels to assign to the new game session queue resource. Tags
-- are developer-defined key-value pairs. Tagging Amazon Web Services
-- resources are useful for resource management, access management and cost
-- allocation. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>
-- in the /Amazon Web Services General Reference/.
createGameSessionQueue_tags :: Lens.Lens' CreateGameSessionQueue (Prelude.Maybe [Tag])
createGameSessionQueue_tags :: Lens' CreateGameSessionQueue (Maybe [Tag])
createGameSessionQueue_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSessionQueue' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateGameSessionQueue
s@CreateGameSessionQueue' {} Maybe [Tag]
a -> CreateGameSessionQueue
s {$sel:tags:CreateGameSessionQueue' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateGameSessionQueue) 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

-- | 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.
createGameSessionQueue_timeoutInSeconds :: Lens.Lens' CreateGameSessionQueue (Prelude.Maybe Prelude.Natural)
createGameSessionQueue_timeoutInSeconds :: Lens' CreateGameSessionQueue (Maybe Natural)
createGameSessionQueue_timeoutInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSessionQueue' {Maybe Natural
timeoutInSeconds :: Maybe Natural
$sel:timeoutInSeconds:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe Natural
timeoutInSeconds} -> Maybe Natural
timeoutInSeconds) (\s :: CreateGameSessionQueue
s@CreateGameSessionQueue' {} Maybe Natural
a -> CreateGameSessionQueue
s {$sel:timeoutInSeconds:CreateGameSessionQueue' :: Maybe Natural
timeoutInSeconds = Maybe Natural
a} :: CreateGameSessionQueue)

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

instance Core.AWSRequest CreateGameSessionQueue where
  type
    AWSResponse CreateGameSessionQueue =
      CreateGameSessionQueueResponse
  request :: (Service -> Service)
-> CreateGameSessionQueue -> Request CreateGameSessionQueue
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateGameSessionQueue
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateGameSessionQueue)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe GameSessionQueue -> Int -> CreateGameSessionQueueResponse
CreateGameSessionQueueResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"GameSessionQueue")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateGameSessionQueue where
  hashWithSalt :: Int -> CreateGameSessionQueue -> Int
hashWithSalt Int
_salt CreateGameSessionQueue' {Maybe Natural
Maybe [GameSessionQueueDestination]
Maybe [PlayerLatencyPolicy]
Maybe [Tag]
Maybe Text
Maybe FilterConfiguration
Maybe PriorityConfiguration
Text
name :: Text
timeoutInSeconds :: Maybe Natural
tags :: Maybe [Tag]
priorityConfiguration :: Maybe PriorityConfiguration
playerLatencyPolicies :: Maybe [PlayerLatencyPolicy]
notificationTarget :: Maybe Text
filterConfiguration :: Maybe FilterConfiguration
destinations :: Maybe [GameSessionQueueDestination]
customEventData :: Maybe Text
$sel:name:CreateGameSessionQueue' :: CreateGameSessionQueue -> Text
$sel:timeoutInSeconds:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe Natural
$sel:tags:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe [Tag]
$sel:priorityConfiguration:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe PriorityConfiguration
$sel:playerLatencyPolicies:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe [PlayerLatencyPolicy]
$sel:notificationTarget:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe Text
$sel:filterConfiguration:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe FilterConfiguration
$sel:destinations:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe [GameSessionQueueDestination]
$sel:customEventData:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
customEventData
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [GameSessionQueueDestination]
destinations
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FilterConfiguration
filterConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
notificationTarget
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [PlayerLatencyPolicy]
playerLatencyPolicies
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PriorityConfiguration
priorityConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
timeoutInSeconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData CreateGameSessionQueue where
  rnf :: CreateGameSessionQueue -> ()
rnf CreateGameSessionQueue' {Maybe Natural
Maybe [GameSessionQueueDestination]
Maybe [PlayerLatencyPolicy]
Maybe [Tag]
Maybe Text
Maybe FilterConfiguration
Maybe PriorityConfiguration
Text
name :: Text
timeoutInSeconds :: Maybe Natural
tags :: Maybe [Tag]
priorityConfiguration :: Maybe PriorityConfiguration
playerLatencyPolicies :: Maybe [PlayerLatencyPolicy]
notificationTarget :: Maybe Text
filterConfiguration :: Maybe FilterConfiguration
destinations :: Maybe [GameSessionQueueDestination]
customEventData :: Maybe Text
$sel:name:CreateGameSessionQueue' :: CreateGameSessionQueue -> Text
$sel:timeoutInSeconds:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe Natural
$sel:tags:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe [Tag]
$sel:priorityConfiguration:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe PriorityConfiguration
$sel:playerLatencyPolicies:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe [PlayerLatencyPolicy]
$sel:notificationTarget:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe Text
$sel:filterConfiguration:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe FilterConfiguration
$sel:destinations:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe [GameSessionQueueDestination]
$sel:customEventData:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
customEventData
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [GameSessionQueueDestination]
destinations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FilterConfiguration
filterConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
notificationTarget
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [PlayerLatencyPolicy]
playerLatencyPolicies
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PriorityConfiguration
priorityConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
timeoutInSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

instance Data.ToHeaders CreateGameSessionQueue where
  toHeaders :: CreateGameSessionQueue -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"GameLift.CreateGameSessionQueue" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateGameSessionQueue where
  toJSON :: CreateGameSessionQueue -> Value
toJSON CreateGameSessionQueue' {Maybe Natural
Maybe [GameSessionQueueDestination]
Maybe [PlayerLatencyPolicy]
Maybe [Tag]
Maybe Text
Maybe FilterConfiguration
Maybe PriorityConfiguration
Text
name :: Text
timeoutInSeconds :: Maybe Natural
tags :: Maybe [Tag]
priorityConfiguration :: Maybe PriorityConfiguration
playerLatencyPolicies :: Maybe [PlayerLatencyPolicy]
notificationTarget :: Maybe Text
filterConfiguration :: Maybe FilterConfiguration
destinations :: Maybe [GameSessionQueueDestination]
customEventData :: Maybe Text
$sel:name:CreateGameSessionQueue' :: CreateGameSessionQueue -> Text
$sel:timeoutInSeconds:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe Natural
$sel:tags:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe [Tag]
$sel:priorityConfiguration:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe PriorityConfiguration
$sel:playerLatencyPolicies:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe [PlayerLatencyPolicy]
$sel:notificationTarget:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe Text
$sel:filterConfiguration:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe FilterConfiguration
$sel:destinations:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe [GameSessionQueueDestination]
$sel:customEventData:CreateGameSessionQueue' :: CreateGameSessionQueue -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"CustomEventData" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
customEventData,
            (Key
"Destinations" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [GameSessionQueueDestination]
destinations,
            (Key
"FilterConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FilterConfiguration
filterConfiguration,
            (Key
"NotificationTarget" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
notificationTarget,
            (Key
"PlayerLatencyPolicies" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PlayerLatencyPolicy]
playerLatencyPolicies,
            (Key
"PriorityConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PriorityConfiguration
priorityConfiguration,
            (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            (Key
"TimeoutInSeconds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
timeoutInSeconds,
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
          ]
      )

instance Data.ToPath CreateGameSessionQueue where
  toPath :: CreateGameSessionQueue -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery CreateGameSessionQueue where
  toQuery :: CreateGameSessionQueue -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateGameSessionQueueResponse' smart constructor.
data CreateGameSessionQueueResponse = CreateGameSessionQueueResponse'
  { -- | An object that describes the newly created game session queue.
    CreateGameSessionQueueResponse -> Maybe GameSessionQueue
gameSessionQueue :: Prelude.Maybe GameSessionQueue,
    -- | The response's http status code.
    CreateGameSessionQueueResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateGameSessionQueueResponse
-> CreateGameSessionQueueResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateGameSessionQueueResponse
-> CreateGameSessionQueueResponse -> Bool
$c/= :: CreateGameSessionQueueResponse
-> CreateGameSessionQueueResponse -> Bool
== :: CreateGameSessionQueueResponse
-> CreateGameSessionQueueResponse -> Bool
$c== :: CreateGameSessionQueueResponse
-> CreateGameSessionQueueResponse -> Bool
Prelude.Eq, ReadPrec [CreateGameSessionQueueResponse]
ReadPrec CreateGameSessionQueueResponse
Int -> ReadS CreateGameSessionQueueResponse
ReadS [CreateGameSessionQueueResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateGameSessionQueueResponse]
$creadListPrec :: ReadPrec [CreateGameSessionQueueResponse]
readPrec :: ReadPrec CreateGameSessionQueueResponse
$creadPrec :: ReadPrec CreateGameSessionQueueResponse
readList :: ReadS [CreateGameSessionQueueResponse]
$creadList :: ReadS [CreateGameSessionQueueResponse]
readsPrec :: Int -> ReadS CreateGameSessionQueueResponse
$creadsPrec :: Int -> ReadS CreateGameSessionQueueResponse
Prelude.Read, Int -> CreateGameSessionQueueResponse -> ShowS
[CreateGameSessionQueueResponse] -> ShowS
CreateGameSessionQueueResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateGameSessionQueueResponse] -> ShowS
$cshowList :: [CreateGameSessionQueueResponse] -> ShowS
show :: CreateGameSessionQueueResponse -> String
$cshow :: CreateGameSessionQueueResponse -> String
showsPrec :: Int -> CreateGameSessionQueueResponse -> ShowS
$cshowsPrec :: Int -> CreateGameSessionQueueResponse -> ShowS
Prelude.Show, forall x.
Rep CreateGameSessionQueueResponse x
-> CreateGameSessionQueueResponse
forall x.
CreateGameSessionQueueResponse
-> Rep CreateGameSessionQueueResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateGameSessionQueueResponse x
-> CreateGameSessionQueueResponse
$cfrom :: forall x.
CreateGameSessionQueueResponse
-> Rep CreateGameSessionQueueResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateGameSessionQueueResponse' 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:
--
-- 'gameSessionQueue', 'createGameSessionQueueResponse_gameSessionQueue' - An object that describes the newly created game session queue.
--
-- 'httpStatus', 'createGameSessionQueueResponse_httpStatus' - The response's http status code.
newCreateGameSessionQueueResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateGameSessionQueueResponse
newCreateGameSessionQueueResponse :: Int -> CreateGameSessionQueueResponse
newCreateGameSessionQueueResponse Int
pHttpStatus_ =
  CreateGameSessionQueueResponse'
    { $sel:gameSessionQueue:CreateGameSessionQueueResponse' :: Maybe GameSessionQueue
gameSessionQueue =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateGameSessionQueueResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An object that describes the newly created game session queue.
createGameSessionQueueResponse_gameSessionQueue :: Lens.Lens' CreateGameSessionQueueResponse (Prelude.Maybe GameSessionQueue)
createGameSessionQueueResponse_gameSessionQueue :: Lens' CreateGameSessionQueueResponse (Maybe GameSessionQueue)
createGameSessionQueueResponse_gameSessionQueue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSessionQueueResponse' {Maybe GameSessionQueue
gameSessionQueue :: Maybe GameSessionQueue
$sel:gameSessionQueue:CreateGameSessionQueueResponse' :: CreateGameSessionQueueResponse -> Maybe GameSessionQueue
gameSessionQueue} -> Maybe GameSessionQueue
gameSessionQueue) (\s :: CreateGameSessionQueueResponse
s@CreateGameSessionQueueResponse' {} Maybe GameSessionQueue
a -> CreateGameSessionQueueResponse
s {$sel:gameSessionQueue:CreateGameSessionQueueResponse' :: Maybe GameSessionQueue
gameSessionQueue = Maybe GameSessionQueue
a} :: CreateGameSessionQueueResponse)

-- | The response's http status code.
createGameSessionQueueResponse_httpStatus :: Lens.Lens' CreateGameSessionQueueResponse Prelude.Int
createGameSessionQueueResponse_httpStatus :: Lens' CreateGameSessionQueueResponse Int
createGameSessionQueueResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSessionQueueResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateGameSessionQueueResponse' :: CreateGameSessionQueueResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateGameSessionQueueResponse
s@CreateGameSessionQueueResponse' {} Int
a -> CreateGameSessionQueueResponse
s {$sel:httpStatus:CreateGameSessionQueueResponse' :: Int
httpStatus = Int
a} :: CreateGameSessionQueueResponse)

instance
  Prelude.NFData
    CreateGameSessionQueueResponse
  where
  rnf :: CreateGameSessionQueueResponse -> ()
rnf CreateGameSessionQueueResponse' {Int
Maybe GameSessionQueue
httpStatus :: Int
gameSessionQueue :: Maybe GameSessionQueue
$sel:httpStatus:CreateGameSessionQueueResponse' :: CreateGameSessionQueueResponse -> Int
$sel:gameSessionQueue:CreateGameSessionQueueResponse' :: CreateGameSessionQueueResponse -> Maybe GameSessionQueue
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe GameSessionQueue
gameSessionQueue
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus