{-# 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.UpdateGameSession
-- 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 mutable properties of a game session.
--
-- To update a game session, specify the game session ID and the values you
-- want to change.
--
-- If successful, the updated @GameSession@ object is returned.
--
-- __Related actions__
--
-- CreateGameSession | DescribeGameSessions | DescribeGameSessionDetails |
-- SearchGameSessions | UpdateGameSession | GetGameSessionLogUrl |
-- StartGameSessionPlacement | DescribeGameSessionPlacement |
-- StopGameSessionPlacement |
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets All APIs by task>
module Amazonka.GameLift.UpdateGameSession
  ( -- * Creating a Request
    UpdateGameSession (..),
    newUpdateGameSession,

    -- * Request Lenses
    updateGameSession_maximumPlayerSessionCount,
    updateGameSession_playerSessionCreationPolicy,
    updateGameSession_name,
    updateGameSession_protectionPolicy,
    updateGameSession_gameSessionId,

    -- * Destructuring the Response
    UpdateGameSessionResponse (..),
    newUpdateGameSessionResponse,

    -- * Response Lenses
    updateGameSessionResponse_gameSession,
    updateGameSessionResponse_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:/ 'newUpdateGameSession' smart constructor.
data UpdateGameSession = UpdateGameSession'
  { -- | The maximum number of players that can be connected simultaneously to
    -- the game session.
    UpdateGameSession -> Maybe Natural
maximumPlayerSessionCount :: Prelude.Maybe Prelude.Natural,
    -- | A policy that determines whether the game session is accepting new
    -- players.
    UpdateGameSession -> Maybe PlayerSessionCreationPolicy
playerSessionCreationPolicy :: Prelude.Maybe PlayerSessionCreationPolicy,
    -- | A descriptive label that is associated with a game session. Session
    -- names do not need to be unique.
    UpdateGameSession -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Game session protection policy to apply to this game session only.
    --
    -- -   __NoProtection__ -- The game session can be terminated during a
    --     scale-down event.
    --
    -- -   __FullProtection__ -- If the game session is in an @ACTIVE@ status,
    --     it cannot be terminated during a scale-down event.
    UpdateGameSession -> Maybe ProtectionPolicy
protectionPolicy :: Prelude.Maybe ProtectionPolicy,
    -- | A unique identifier for the game session to update.
    UpdateGameSession -> Text
gameSessionId :: Prelude.Text
  }
  deriving (UpdateGameSession -> UpdateGameSession -> Bool
(UpdateGameSession -> UpdateGameSession -> Bool)
-> (UpdateGameSession -> UpdateGameSession -> Bool)
-> Eq UpdateGameSession
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateGameSession -> UpdateGameSession -> Bool
$c/= :: UpdateGameSession -> UpdateGameSession -> Bool
== :: UpdateGameSession -> UpdateGameSession -> Bool
$c== :: UpdateGameSession -> UpdateGameSession -> Bool
Prelude.Eq, ReadPrec [UpdateGameSession]
ReadPrec UpdateGameSession
Int -> ReadS UpdateGameSession
ReadS [UpdateGameSession]
(Int -> ReadS UpdateGameSession)
-> ReadS [UpdateGameSession]
-> ReadPrec UpdateGameSession
-> ReadPrec [UpdateGameSession]
-> Read UpdateGameSession
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateGameSession]
$creadListPrec :: ReadPrec [UpdateGameSession]
readPrec :: ReadPrec UpdateGameSession
$creadPrec :: ReadPrec UpdateGameSession
readList :: ReadS [UpdateGameSession]
$creadList :: ReadS [UpdateGameSession]
readsPrec :: Int -> ReadS UpdateGameSession
$creadsPrec :: Int -> ReadS UpdateGameSession
Prelude.Read, Int -> UpdateGameSession -> ShowS
[UpdateGameSession] -> ShowS
UpdateGameSession -> String
(Int -> UpdateGameSession -> ShowS)
-> (UpdateGameSession -> String)
-> ([UpdateGameSession] -> ShowS)
-> Show UpdateGameSession
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateGameSession] -> ShowS
$cshowList :: [UpdateGameSession] -> ShowS
show :: UpdateGameSession -> String
$cshow :: UpdateGameSession -> String
showsPrec :: Int -> UpdateGameSession -> ShowS
$cshowsPrec :: Int -> UpdateGameSession -> ShowS
Prelude.Show, (forall x. UpdateGameSession -> Rep UpdateGameSession x)
-> (forall x. Rep UpdateGameSession x -> UpdateGameSession)
-> Generic UpdateGameSession
forall x. Rep UpdateGameSession x -> UpdateGameSession
forall x. UpdateGameSession -> Rep UpdateGameSession x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateGameSession x -> UpdateGameSession
$cfrom :: forall x. UpdateGameSession -> Rep UpdateGameSession x
Prelude.Generic)

-- |
-- Create a value of 'UpdateGameSession' 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:
--
-- 'maximumPlayerSessionCount', 'updateGameSession_maximumPlayerSessionCount' - The maximum number of players that can be connected simultaneously to
-- the game session.
--
-- 'playerSessionCreationPolicy', 'updateGameSession_playerSessionCreationPolicy' - A policy that determines whether the game session is accepting new
-- players.
--
-- 'name', 'updateGameSession_name' - A descriptive label that is associated with a game session. Session
-- names do not need to be unique.
--
-- 'protectionPolicy', 'updateGameSession_protectionPolicy' - Game session protection policy to apply to this game session only.
--
-- -   __NoProtection__ -- The game session can be terminated during a
--     scale-down event.
--
-- -   __FullProtection__ -- If the game session is in an @ACTIVE@ status,
--     it cannot be terminated during a scale-down event.
--
-- 'gameSessionId', 'updateGameSession_gameSessionId' - A unique identifier for the game session to update.
newUpdateGameSession ::
  -- | 'gameSessionId'
  Prelude.Text ->
  UpdateGameSession
newUpdateGameSession :: Text -> UpdateGameSession
newUpdateGameSession Text
pGameSessionId_ =
  UpdateGameSession' :: Maybe Natural
-> Maybe PlayerSessionCreationPolicy
-> Maybe Text
-> Maybe ProtectionPolicy
-> Text
-> UpdateGameSession
UpdateGameSession'
    { $sel:maximumPlayerSessionCount:UpdateGameSession' :: Maybe Natural
maximumPlayerSessionCount =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:playerSessionCreationPolicy:UpdateGameSession' :: Maybe PlayerSessionCreationPolicy
playerSessionCreationPolicy = Maybe PlayerSessionCreationPolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateGameSession' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:protectionPolicy:UpdateGameSession' :: Maybe ProtectionPolicy
protectionPolicy = Maybe ProtectionPolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:gameSessionId:UpdateGameSession' :: Text
gameSessionId = Text
pGameSessionId_
    }

-- | The maximum number of players that can be connected simultaneously to
-- the game session.
updateGameSession_maximumPlayerSessionCount :: Lens.Lens' UpdateGameSession (Prelude.Maybe Prelude.Natural)
updateGameSession_maximumPlayerSessionCount :: (Maybe Natural -> f (Maybe Natural))
-> UpdateGameSession -> f UpdateGameSession
updateGameSession_maximumPlayerSessionCount = (UpdateGameSession -> Maybe Natural)
-> (UpdateGameSession -> Maybe Natural -> UpdateGameSession)
-> Lens
     UpdateGameSession UpdateGameSession (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGameSession' {Maybe Natural
maximumPlayerSessionCount :: Maybe Natural
$sel:maximumPlayerSessionCount:UpdateGameSession' :: UpdateGameSession -> Maybe Natural
maximumPlayerSessionCount} -> Maybe Natural
maximumPlayerSessionCount) (\s :: UpdateGameSession
s@UpdateGameSession' {} Maybe Natural
a -> UpdateGameSession
s {$sel:maximumPlayerSessionCount:UpdateGameSession' :: Maybe Natural
maximumPlayerSessionCount = Maybe Natural
a} :: UpdateGameSession)

-- | A policy that determines whether the game session is accepting new
-- players.
updateGameSession_playerSessionCreationPolicy :: Lens.Lens' UpdateGameSession (Prelude.Maybe PlayerSessionCreationPolicy)
updateGameSession_playerSessionCreationPolicy :: (Maybe PlayerSessionCreationPolicy
 -> f (Maybe PlayerSessionCreationPolicy))
-> UpdateGameSession -> f UpdateGameSession
updateGameSession_playerSessionCreationPolicy = (UpdateGameSession -> Maybe PlayerSessionCreationPolicy)
-> (UpdateGameSession
    -> Maybe PlayerSessionCreationPolicy -> UpdateGameSession)
-> Lens
     UpdateGameSession
     UpdateGameSession
     (Maybe PlayerSessionCreationPolicy)
     (Maybe PlayerSessionCreationPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGameSession' {Maybe PlayerSessionCreationPolicy
playerSessionCreationPolicy :: Maybe PlayerSessionCreationPolicy
$sel:playerSessionCreationPolicy:UpdateGameSession' :: UpdateGameSession -> Maybe PlayerSessionCreationPolicy
playerSessionCreationPolicy} -> Maybe PlayerSessionCreationPolicy
playerSessionCreationPolicy) (\s :: UpdateGameSession
s@UpdateGameSession' {} Maybe PlayerSessionCreationPolicy
a -> UpdateGameSession
s {$sel:playerSessionCreationPolicy:UpdateGameSession' :: Maybe PlayerSessionCreationPolicy
playerSessionCreationPolicy = Maybe PlayerSessionCreationPolicy
a} :: UpdateGameSession)

-- | A descriptive label that is associated with a game session. Session
-- names do not need to be unique.
updateGameSession_name :: Lens.Lens' UpdateGameSession (Prelude.Maybe Prelude.Text)
updateGameSession_name :: (Maybe Text -> f (Maybe Text))
-> UpdateGameSession -> f UpdateGameSession
updateGameSession_name = (UpdateGameSession -> Maybe Text)
-> (UpdateGameSession -> Maybe Text -> UpdateGameSession)
-> Lens
     UpdateGameSession UpdateGameSession (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGameSession' {Maybe Text
name :: Maybe Text
$sel:name:UpdateGameSession' :: UpdateGameSession -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateGameSession
s@UpdateGameSession' {} Maybe Text
a -> UpdateGameSession
s {$sel:name:UpdateGameSession' :: Maybe Text
name = Maybe Text
a} :: UpdateGameSession)

-- | Game session protection policy to apply to this game session only.
--
-- -   __NoProtection__ -- The game session can be terminated during a
--     scale-down event.
--
-- -   __FullProtection__ -- If the game session is in an @ACTIVE@ status,
--     it cannot be terminated during a scale-down event.
updateGameSession_protectionPolicy :: Lens.Lens' UpdateGameSession (Prelude.Maybe ProtectionPolicy)
updateGameSession_protectionPolicy :: (Maybe ProtectionPolicy -> f (Maybe ProtectionPolicy))
-> UpdateGameSession -> f UpdateGameSession
updateGameSession_protectionPolicy = (UpdateGameSession -> Maybe ProtectionPolicy)
-> (UpdateGameSession
    -> Maybe ProtectionPolicy -> UpdateGameSession)
-> Lens
     UpdateGameSession
     UpdateGameSession
     (Maybe ProtectionPolicy)
     (Maybe ProtectionPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGameSession' {Maybe ProtectionPolicy
protectionPolicy :: Maybe ProtectionPolicy
$sel:protectionPolicy:UpdateGameSession' :: UpdateGameSession -> Maybe ProtectionPolicy
protectionPolicy} -> Maybe ProtectionPolicy
protectionPolicy) (\s :: UpdateGameSession
s@UpdateGameSession' {} Maybe ProtectionPolicy
a -> UpdateGameSession
s {$sel:protectionPolicy:UpdateGameSession' :: Maybe ProtectionPolicy
protectionPolicy = Maybe ProtectionPolicy
a} :: UpdateGameSession)

-- | A unique identifier for the game session to update.
updateGameSession_gameSessionId :: Lens.Lens' UpdateGameSession Prelude.Text
updateGameSession_gameSessionId :: (Text -> f Text) -> UpdateGameSession -> f UpdateGameSession
updateGameSession_gameSessionId = (UpdateGameSession -> Text)
-> (UpdateGameSession -> Text -> UpdateGameSession)
-> Lens UpdateGameSession UpdateGameSession Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGameSession' {Text
gameSessionId :: Text
$sel:gameSessionId:UpdateGameSession' :: UpdateGameSession -> Text
gameSessionId} -> Text
gameSessionId) (\s :: UpdateGameSession
s@UpdateGameSession' {} Text
a -> UpdateGameSession
s {$sel:gameSessionId:UpdateGameSession' :: Text
gameSessionId = Text
a} :: UpdateGameSession)

instance Core.AWSRequest UpdateGameSession where
  type
    AWSResponse UpdateGameSession =
      UpdateGameSessionResponse
  request :: UpdateGameSession -> Request UpdateGameSession
request = Service -> UpdateGameSession -> Request UpdateGameSession
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateGameSession
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateGameSession)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateGameSession))
-> Logger
-> Service
-> Proxy UpdateGameSession
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateGameSession)))
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 GameSession -> Int -> UpdateGameSessionResponse
UpdateGameSessionResponse'
            (Maybe GameSession -> Int -> UpdateGameSessionResponse)
-> Either String (Maybe GameSession)
-> Either String (Int -> UpdateGameSessionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe GameSession)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GameSession")
            Either String (Int -> UpdateGameSessionResponse)
-> Either String Int -> Either String UpdateGameSessionResponse
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 UpdateGameSession

instance Prelude.NFData UpdateGameSession

instance Core.ToHeaders UpdateGameSession where
  toHeaders :: UpdateGameSession -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateGameSession -> 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.UpdateGameSession" :: 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 UpdateGameSession where
  toJSON :: UpdateGameSession -> Value
toJSON UpdateGameSession' {Maybe Natural
Maybe Text
Maybe PlayerSessionCreationPolicy
Maybe ProtectionPolicy
Text
gameSessionId :: Text
protectionPolicy :: Maybe ProtectionPolicy
name :: Maybe Text
playerSessionCreationPolicy :: Maybe PlayerSessionCreationPolicy
maximumPlayerSessionCount :: Maybe Natural
$sel:gameSessionId:UpdateGameSession' :: UpdateGameSession -> Text
$sel:protectionPolicy:UpdateGameSession' :: UpdateGameSession -> Maybe ProtectionPolicy
$sel:name:UpdateGameSession' :: UpdateGameSession -> Maybe Text
$sel:playerSessionCreationPolicy:UpdateGameSession' :: UpdateGameSession -> Maybe PlayerSessionCreationPolicy
$sel:maximumPlayerSessionCount:UpdateGameSession' :: UpdateGameSession -> Maybe Natural
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"MaximumPlayerSessionCount" 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
maximumPlayerSessionCount,
            (Text
"PlayerSessionCreationPolicy" Text -> PlayerSessionCreationPolicy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (PlayerSessionCreationPolicy -> Pair)
-> Maybe PlayerSessionCreationPolicy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PlayerSessionCreationPolicy
playerSessionCreationPolicy,
            (Text
"Name" 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
name,
            (Text
"ProtectionPolicy" Text -> ProtectionPolicy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ProtectionPolicy -> Pair) -> Maybe ProtectionPolicy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProtectionPolicy
protectionPolicy,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"GameSessionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
gameSessionId)
          ]
      )

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

instance Core.ToQuery UpdateGameSession where
  toQuery :: UpdateGameSession -> QueryString
toQuery = QueryString -> UpdateGameSession -> 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:/ 'newUpdateGameSessionResponse' smart constructor.
data UpdateGameSessionResponse = UpdateGameSessionResponse'
  { -- | The updated game session properties.
    UpdateGameSessionResponse -> Maybe GameSession
gameSession :: Prelude.Maybe GameSession,
    -- | The response's http status code.
    UpdateGameSessionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateGameSessionResponse -> UpdateGameSessionResponse -> Bool
(UpdateGameSessionResponse -> UpdateGameSessionResponse -> Bool)
-> (UpdateGameSessionResponse -> UpdateGameSessionResponse -> Bool)
-> Eq UpdateGameSessionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateGameSessionResponse -> UpdateGameSessionResponse -> Bool
$c/= :: UpdateGameSessionResponse -> UpdateGameSessionResponse -> Bool
== :: UpdateGameSessionResponse -> UpdateGameSessionResponse -> Bool
$c== :: UpdateGameSessionResponse -> UpdateGameSessionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateGameSessionResponse]
ReadPrec UpdateGameSessionResponse
Int -> ReadS UpdateGameSessionResponse
ReadS [UpdateGameSessionResponse]
(Int -> ReadS UpdateGameSessionResponse)
-> ReadS [UpdateGameSessionResponse]
-> ReadPrec UpdateGameSessionResponse
-> ReadPrec [UpdateGameSessionResponse]
-> Read UpdateGameSessionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateGameSessionResponse]
$creadListPrec :: ReadPrec [UpdateGameSessionResponse]
readPrec :: ReadPrec UpdateGameSessionResponse
$creadPrec :: ReadPrec UpdateGameSessionResponse
readList :: ReadS [UpdateGameSessionResponse]
$creadList :: ReadS [UpdateGameSessionResponse]
readsPrec :: Int -> ReadS UpdateGameSessionResponse
$creadsPrec :: Int -> ReadS UpdateGameSessionResponse
Prelude.Read, Int -> UpdateGameSessionResponse -> ShowS
[UpdateGameSessionResponse] -> ShowS
UpdateGameSessionResponse -> String
(Int -> UpdateGameSessionResponse -> ShowS)
-> (UpdateGameSessionResponse -> String)
-> ([UpdateGameSessionResponse] -> ShowS)
-> Show UpdateGameSessionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateGameSessionResponse] -> ShowS
$cshowList :: [UpdateGameSessionResponse] -> ShowS
show :: UpdateGameSessionResponse -> String
$cshow :: UpdateGameSessionResponse -> String
showsPrec :: Int -> UpdateGameSessionResponse -> ShowS
$cshowsPrec :: Int -> UpdateGameSessionResponse -> ShowS
Prelude.Show, (forall x.
 UpdateGameSessionResponse -> Rep UpdateGameSessionResponse x)
-> (forall x.
    Rep UpdateGameSessionResponse x -> UpdateGameSessionResponse)
-> Generic UpdateGameSessionResponse
forall x.
Rep UpdateGameSessionResponse x -> UpdateGameSessionResponse
forall x.
UpdateGameSessionResponse -> Rep UpdateGameSessionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateGameSessionResponse x -> UpdateGameSessionResponse
$cfrom :: forall x.
UpdateGameSessionResponse -> Rep UpdateGameSessionResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateGameSessionResponse' 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:
--
-- 'gameSession', 'updateGameSessionResponse_gameSession' - The updated game session properties.
--
-- 'httpStatus', 'updateGameSessionResponse_httpStatus' - The response's http status code.
newUpdateGameSessionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateGameSessionResponse
newUpdateGameSessionResponse :: Int -> UpdateGameSessionResponse
newUpdateGameSessionResponse Int
pHttpStatus_ =
  UpdateGameSessionResponse' :: Maybe GameSession -> Int -> UpdateGameSessionResponse
UpdateGameSessionResponse'
    { $sel:gameSession:UpdateGameSessionResponse' :: Maybe GameSession
gameSession =
        Maybe GameSession
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateGameSessionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The updated game session properties.
updateGameSessionResponse_gameSession :: Lens.Lens' UpdateGameSessionResponse (Prelude.Maybe GameSession)
updateGameSessionResponse_gameSession :: (Maybe GameSession -> f (Maybe GameSession))
-> UpdateGameSessionResponse -> f UpdateGameSessionResponse
updateGameSessionResponse_gameSession = (UpdateGameSessionResponse -> Maybe GameSession)
-> (UpdateGameSessionResponse
    -> Maybe GameSession -> UpdateGameSessionResponse)
-> Lens
     UpdateGameSessionResponse
     UpdateGameSessionResponse
     (Maybe GameSession)
     (Maybe GameSession)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGameSessionResponse' {Maybe GameSession
gameSession :: Maybe GameSession
$sel:gameSession:UpdateGameSessionResponse' :: UpdateGameSessionResponse -> Maybe GameSession
gameSession} -> Maybe GameSession
gameSession) (\s :: UpdateGameSessionResponse
s@UpdateGameSessionResponse' {} Maybe GameSession
a -> UpdateGameSessionResponse
s {$sel:gameSession:UpdateGameSessionResponse' :: Maybe GameSession
gameSession = Maybe GameSession
a} :: UpdateGameSessionResponse)

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

instance Prelude.NFData UpdateGameSessionResponse