{-# 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.UpdateGameSessionQueue
-- 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)
--
-- Updates the configuration of a game session queue, which determines how
-- the queue processes new game session requests. To update settings,
-- specify the queue name to be updated and provide the new settings. When
-- updating destinations, provide a complete list of destinations.
--
-- __Learn more__
--
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/queues-intro.html Using Multi-Region Queues>
--
-- __Related actions__
--
-- CreateGameSessionQueue | DescribeGameSessionQueues |
-- UpdateGameSessionQueue | DeleteGameSessionQueue |
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets All APIs by task>
module Amazonka.GameLift.UpdateGameSessionQueue
  ( -- * Creating a Request
    UpdateGameSessionQueue (..),
    newUpdateGameSessionQueue,

    -- * Request Lenses
    updateGameSessionQueue_playerLatencyPolicies,
    updateGameSessionQueue_filterConfiguration,
    updateGameSessionQueue_notificationTarget,
    updateGameSessionQueue_timeoutInSeconds,
    updateGameSessionQueue_destinations,
    updateGameSessionQueue_customEventData,
    updateGameSessionQueue_priorityConfiguration,
    updateGameSessionQueue_name,

    -- * Destructuring the Response
    UpdateGameSessionQueueResponse (..),
    newUpdateGameSessionQueueResponse,

    -- * Response Lenses
    updateGameSessionQueueResponse_gameSessionQueue,
    updateGameSessionQueueResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Represents the input for a request operation.
--
-- /See:/ 'newUpdateGameSessionQueue' smart constructor.
data UpdateGameSessionQueue = UpdateGameSessionQueue'
  { -- | 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.
    -- When updating policies, provide a complete collection of policies.
    UpdateGameSessionQueue -> 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. To remove an existing filter configuration, pass
    -- in an empty set.
    UpdateGameSessionQueue -> 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>.
    UpdateGameSessionQueue -> 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.
    UpdateGameSessionQueue -> 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. When updating this list, provide a complete list
    -- of destinations.
    UpdateGameSessionQueue -> Maybe [GameSessionQueueDestination]
destinations :: Prelude.Maybe [GameSessionQueueDestination],
    -- | Information to be added to all events that are related to this game
    -- session queue.
    UpdateGameSessionQueue -> 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.
    -- To remove an existing priority configuration, pass in an empty set.
    UpdateGameSessionQueue -> Maybe PriorityConfiguration
priorityConfiguration :: Prelude.Maybe PriorityConfiguration,
    -- | A descriptive label that is associated with game session queue. Queue
    -- names must be unique within each Region. You can use either the queue ID
    -- or ARN value.
    UpdateGameSessionQueue -> Text
name :: Prelude.Text
  }
  deriving (UpdateGameSessionQueue -> UpdateGameSessionQueue -> Bool
(UpdateGameSessionQueue -> UpdateGameSessionQueue -> Bool)
-> (UpdateGameSessionQueue -> UpdateGameSessionQueue -> Bool)
-> Eq UpdateGameSessionQueue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateGameSessionQueue -> UpdateGameSessionQueue -> Bool
$c/= :: UpdateGameSessionQueue -> UpdateGameSessionQueue -> Bool
== :: UpdateGameSessionQueue -> UpdateGameSessionQueue -> Bool
$c== :: UpdateGameSessionQueue -> UpdateGameSessionQueue -> Bool
Prelude.Eq, ReadPrec [UpdateGameSessionQueue]
ReadPrec UpdateGameSessionQueue
Int -> ReadS UpdateGameSessionQueue
ReadS [UpdateGameSessionQueue]
(Int -> ReadS UpdateGameSessionQueue)
-> ReadS [UpdateGameSessionQueue]
-> ReadPrec UpdateGameSessionQueue
-> ReadPrec [UpdateGameSessionQueue]
-> Read UpdateGameSessionQueue
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateGameSessionQueue]
$creadListPrec :: ReadPrec [UpdateGameSessionQueue]
readPrec :: ReadPrec UpdateGameSessionQueue
$creadPrec :: ReadPrec UpdateGameSessionQueue
readList :: ReadS [UpdateGameSessionQueue]
$creadList :: ReadS [UpdateGameSessionQueue]
readsPrec :: Int -> ReadS UpdateGameSessionQueue
$creadsPrec :: Int -> ReadS UpdateGameSessionQueue
Prelude.Read, Int -> UpdateGameSessionQueue -> ShowS
[UpdateGameSessionQueue] -> ShowS
UpdateGameSessionQueue -> String
(Int -> UpdateGameSessionQueue -> ShowS)
-> (UpdateGameSessionQueue -> String)
-> ([UpdateGameSessionQueue] -> ShowS)
-> Show UpdateGameSessionQueue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateGameSessionQueue] -> ShowS
$cshowList :: [UpdateGameSessionQueue] -> ShowS
show :: UpdateGameSessionQueue -> String
$cshow :: UpdateGameSessionQueue -> String
showsPrec :: Int -> UpdateGameSessionQueue -> ShowS
$cshowsPrec :: Int -> UpdateGameSessionQueue -> ShowS
Prelude.Show, (forall x. UpdateGameSessionQueue -> Rep UpdateGameSessionQueue x)
-> (forall x.
    Rep UpdateGameSessionQueue x -> UpdateGameSessionQueue)
-> Generic UpdateGameSessionQueue
forall x. Rep UpdateGameSessionQueue x -> UpdateGameSessionQueue
forall x. UpdateGameSessionQueue -> Rep UpdateGameSessionQueue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateGameSessionQueue x -> UpdateGameSessionQueue
$cfrom :: forall x. UpdateGameSessionQueue -> Rep UpdateGameSessionQueue x
Prelude.Generic)

-- |
-- Create a value of 'UpdateGameSessionQueue' 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:
--
-- 'playerLatencyPolicies', 'updateGameSessionQueue_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.
-- When updating policies, provide a complete collection of policies.
--
-- 'filterConfiguration', 'updateGameSessionQueue_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. To remove an existing filter configuration, pass
-- in an empty set.
--
-- 'notificationTarget', 'updateGameSessionQueue_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', 'updateGameSessionQueue_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', 'updateGameSessionQueue_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. When updating this list, provide a complete list
-- of destinations.
--
-- 'customEventData', 'updateGameSessionQueue_customEventData' - Information to be added to all events that are related to this game
-- session queue.
--
-- 'priorityConfiguration', 'updateGameSessionQueue_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.
-- To remove an existing priority configuration, pass in an empty set.
--
-- 'name', 'updateGameSessionQueue_name' - A descriptive label that is associated with game session queue. Queue
-- names must be unique within each Region. You can use either the queue ID
-- or ARN value.
newUpdateGameSessionQueue ::
  -- | 'name'
  Prelude.Text ->
  UpdateGameSessionQueue
newUpdateGameSessionQueue :: Text -> UpdateGameSessionQueue
newUpdateGameSessionQueue Text
pName_ =
  UpdateGameSessionQueue' :: Maybe [PlayerLatencyPolicy]
-> Maybe FilterConfiguration
-> Maybe Text
-> Maybe Natural
-> Maybe [GameSessionQueueDestination]
-> Maybe Text
-> Maybe PriorityConfiguration
-> Text
-> UpdateGameSessionQueue
UpdateGameSessionQueue'
    { $sel:playerLatencyPolicies:UpdateGameSessionQueue' :: Maybe [PlayerLatencyPolicy]
playerLatencyPolicies =
        Maybe [PlayerLatencyPolicy]
forall a. Maybe a
Prelude.Nothing,
      $sel:filterConfiguration:UpdateGameSessionQueue' :: Maybe FilterConfiguration
filterConfiguration = Maybe FilterConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:notificationTarget:UpdateGameSessionQueue' :: Maybe Text
notificationTarget = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:timeoutInSeconds:UpdateGameSessionQueue' :: Maybe Natural
timeoutInSeconds = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:destinations:UpdateGameSessionQueue' :: Maybe [GameSessionQueueDestination]
destinations = Maybe [GameSessionQueueDestination]
forall a. Maybe a
Prelude.Nothing,
      $sel:customEventData:UpdateGameSessionQueue' :: Maybe Text
customEventData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:priorityConfiguration:UpdateGameSessionQueue' :: Maybe PriorityConfiguration
priorityConfiguration = Maybe PriorityConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateGameSessionQueue' :: Text
name = Text
pName_
    }

-- | 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.
-- When updating policies, provide a complete collection of policies.
updateGameSessionQueue_playerLatencyPolicies :: Lens.Lens' UpdateGameSessionQueue (Prelude.Maybe [PlayerLatencyPolicy])
updateGameSessionQueue_playerLatencyPolicies :: (Maybe [PlayerLatencyPolicy] -> f (Maybe [PlayerLatencyPolicy]))
-> UpdateGameSessionQueue -> f UpdateGameSessionQueue
updateGameSessionQueue_playerLatencyPolicies = (UpdateGameSessionQueue -> Maybe [PlayerLatencyPolicy])
-> (UpdateGameSessionQueue
    -> Maybe [PlayerLatencyPolicy] -> UpdateGameSessionQueue)
-> Lens
     UpdateGameSessionQueue
     UpdateGameSessionQueue
     (Maybe [PlayerLatencyPolicy])
     (Maybe [PlayerLatencyPolicy])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGameSessionQueue' {Maybe [PlayerLatencyPolicy]
playerLatencyPolicies :: Maybe [PlayerLatencyPolicy]
$sel:playerLatencyPolicies:UpdateGameSessionQueue' :: UpdateGameSessionQueue -> Maybe [PlayerLatencyPolicy]
playerLatencyPolicies} -> Maybe [PlayerLatencyPolicy]
playerLatencyPolicies) (\s :: UpdateGameSessionQueue
s@UpdateGameSessionQueue' {} Maybe [PlayerLatencyPolicy]
a -> UpdateGameSessionQueue
s {$sel:playerLatencyPolicies:UpdateGameSessionQueue' :: Maybe [PlayerLatencyPolicy]
playerLatencyPolicies = Maybe [PlayerLatencyPolicy]
a} :: UpdateGameSessionQueue) ((Maybe [PlayerLatencyPolicy] -> f (Maybe [PlayerLatencyPolicy]))
 -> UpdateGameSessionQueue -> f UpdateGameSessionQueue)
-> ((Maybe [PlayerLatencyPolicy]
     -> f (Maybe [PlayerLatencyPolicy]))
    -> Maybe [PlayerLatencyPolicy] -> f (Maybe [PlayerLatencyPolicy]))
-> (Maybe [PlayerLatencyPolicy] -> f (Maybe [PlayerLatencyPolicy]))
-> UpdateGameSessionQueue
-> f UpdateGameSessionQueue
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. To remove an existing filter configuration, pass
-- in an empty set.
updateGameSessionQueue_filterConfiguration :: Lens.Lens' UpdateGameSessionQueue (Prelude.Maybe FilterConfiguration)
updateGameSessionQueue_filterConfiguration :: (Maybe FilterConfiguration -> f (Maybe FilterConfiguration))
-> UpdateGameSessionQueue -> f UpdateGameSessionQueue
updateGameSessionQueue_filterConfiguration = (UpdateGameSessionQueue -> Maybe FilterConfiguration)
-> (UpdateGameSessionQueue
    -> Maybe FilterConfiguration -> UpdateGameSessionQueue)
-> Lens
     UpdateGameSessionQueue
     UpdateGameSessionQueue
     (Maybe FilterConfiguration)
     (Maybe FilterConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGameSessionQueue' {Maybe FilterConfiguration
filterConfiguration :: Maybe FilterConfiguration
$sel:filterConfiguration:UpdateGameSessionQueue' :: UpdateGameSessionQueue -> Maybe FilterConfiguration
filterConfiguration} -> Maybe FilterConfiguration
filterConfiguration) (\s :: UpdateGameSessionQueue
s@UpdateGameSessionQueue' {} Maybe FilterConfiguration
a -> UpdateGameSessionQueue
s {$sel:filterConfiguration:UpdateGameSessionQueue' :: Maybe FilterConfiguration
filterConfiguration = Maybe FilterConfiguration
a} :: UpdateGameSessionQueue)

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

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

-- | 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. When updating this list, provide a complete list
-- of destinations.
updateGameSessionQueue_destinations :: Lens.Lens' UpdateGameSessionQueue (Prelude.Maybe [GameSessionQueueDestination])
updateGameSessionQueue_destinations :: (Maybe [GameSessionQueueDestination]
 -> f (Maybe [GameSessionQueueDestination]))
-> UpdateGameSessionQueue -> f UpdateGameSessionQueue
updateGameSessionQueue_destinations = (UpdateGameSessionQueue -> Maybe [GameSessionQueueDestination])
-> (UpdateGameSessionQueue
    -> Maybe [GameSessionQueueDestination] -> UpdateGameSessionQueue)
-> Lens
     UpdateGameSessionQueue
     UpdateGameSessionQueue
     (Maybe [GameSessionQueueDestination])
     (Maybe [GameSessionQueueDestination])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGameSessionQueue' {Maybe [GameSessionQueueDestination]
destinations :: Maybe [GameSessionQueueDestination]
$sel:destinations:UpdateGameSessionQueue' :: UpdateGameSessionQueue -> Maybe [GameSessionQueueDestination]
destinations} -> Maybe [GameSessionQueueDestination]
destinations) (\s :: UpdateGameSessionQueue
s@UpdateGameSessionQueue' {} Maybe [GameSessionQueueDestination]
a -> UpdateGameSessionQueue
s {$sel:destinations:UpdateGameSessionQueue' :: Maybe [GameSessionQueueDestination]
destinations = Maybe [GameSessionQueueDestination]
a} :: UpdateGameSessionQueue) ((Maybe [GameSessionQueueDestination]
  -> f (Maybe [GameSessionQueueDestination]))
 -> UpdateGameSessionQueue -> f UpdateGameSessionQueue)
-> ((Maybe [GameSessionQueueDestination]
     -> f (Maybe [GameSessionQueueDestination]))
    -> Maybe [GameSessionQueueDestination]
    -> f (Maybe [GameSessionQueueDestination]))
-> (Maybe [GameSessionQueueDestination]
    -> f (Maybe [GameSessionQueueDestination]))
-> UpdateGameSessionQueue
-> f UpdateGameSessionQueue
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

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

-- | 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.
-- To remove an existing priority configuration, pass in an empty set.
updateGameSessionQueue_priorityConfiguration :: Lens.Lens' UpdateGameSessionQueue (Prelude.Maybe PriorityConfiguration)
updateGameSessionQueue_priorityConfiguration :: (Maybe PriorityConfiguration -> f (Maybe PriorityConfiguration))
-> UpdateGameSessionQueue -> f UpdateGameSessionQueue
updateGameSessionQueue_priorityConfiguration = (UpdateGameSessionQueue -> Maybe PriorityConfiguration)
-> (UpdateGameSessionQueue
    -> Maybe PriorityConfiguration -> UpdateGameSessionQueue)
-> Lens
     UpdateGameSessionQueue
     UpdateGameSessionQueue
     (Maybe PriorityConfiguration)
     (Maybe PriorityConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGameSessionQueue' {Maybe PriorityConfiguration
priorityConfiguration :: Maybe PriorityConfiguration
$sel:priorityConfiguration:UpdateGameSessionQueue' :: UpdateGameSessionQueue -> Maybe PriorityConfiguration
priorityConfiguration} -> Maybe PriorityConfiguration
priorityConfiguration) (\s :: UpdateGameSessionQueue
s@UpdateGameSessionQueue' {} Maybe PriorityConfiguration
a -> UpdateGameSessionQueue
s {$sel:priorityConfiguration:UpdateGameSessionQueue' :: Maybe PriorityConfiguration
priorityConfiguration = Maybe PriorityConfiguration
a} :: UpdateGameSessionQueue)

-- | A descriptive label that is associated with game session queue. Queue
-- names must be unique within each Region. You can use either the queue ID
-- or ARN value.
updateGameSessionQueue_name :: Lens.Lens' UpdateGameSessionQueue Prelude.Text
updateGameSessionQueue_name :: (Text -> f Text)
-> UpdateGameSessionQueue -> f UpdateGameSessionQueue
updateGameSessionQueue_name = (UpdateGameSessionQueue -> Text)
-> (UpdateGameSessionQueue -> Text -> UpdateGameSessionQueue)
-> Lens UpdateGameSessionQueue UpdateGameSessionQueue Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGameSessionQueue' {Text
name :: Text
$sel:name:UpdateGameSessionQueue' :: UpdateGameSessionQueue -> Text
name} -> Text
name) (\s :: UpdateGameSessionQueue
s@UpdateGameSessionQueue' {} Text
a -> UpdateGameSessionQueue
s {$sel:name:UpdateGameSessionQueue' :: Text
name = Text
a} :: UpdateGameSessionQueue)

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

instance Prelude.Hashable UpdateGameSessionQueue

instance Prelude.NFData UpdateGameSessionQueue

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

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

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

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

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

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

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

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

instance
  Prelude.NFData
    UpdateGameSessionQueueResponse