{-# 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.UpdateGameServer
-- 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)
--
-- __This operation is used with the GameLift FleetIQ solution and game
-- server groups.__
--
-- Updates information about a registered game server to help GameLift
-- FleetIQ to track game server availability. This operation is called by a
-- game server process that is running on an instance in a game server
-- group.
--
-- Use this operation to update the following types of game server
-- information. You can make all three types of updates in the same
-- request:
--
-- -   To update the game server\'s utilization status, identify the game
--     server and game server group and specify the current utilization
--     status. Use this status to identify when game servers are currently
--     hosting games and when they are available to be claimed.
--
-- -   To report health status, identify the game server and game server
--     group and set health check to @HEALTHY@. If a game server does not
--     report health status for a certain length of time, the game server
--     is no longer considered healthy. As a result, it will be eventually
--     deregistered from the game server group to avoid affecting
--     utilization metrics. The best practice is to report health every 60
--     seconds.
--
-- -   To change game server metadata, provide updated game server data.
--
-- Once a game server is successfully updated, the relevant statuses and
-- timestamps are updated.
--
-- __Learn more__
--
-- <https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html GameLift FleetIQ Guide>
--
-- __Related actions__
--
-- RegisterGameServer | ListGameServers | ClaimGameServer |
-- DescribeGameServer | UpdateGameServer | DeregisterGameServer |
-- <https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html All APIs by task>
module Amazonka.GameLift.UpdateGameServer
  ( -- * Creating a Request
    UpdateGameServer (..),
    newUpdateGameServer,

    -- * Request Lenses
    updateGameServer_healthCheck,
    updateGameServer_gameServerData,
    updateGameServer_utilizationStatus,
    updateGameServer_gameServerGroupName,
    updateGameServer_gameServerId,

    -- * Destructuring the Response
    UpdateGameServerResponse (..),
    newUpdateGameServerResponse,

    -- * Response Lenses
    updateGameServerResponse_gameServer,
    updateGameServerResponse_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

-- | /See:/ 'newUpdateGameServer' smart constructor.
data UpdateGameServer = UpdateGameServer'
  { -- | Indicates health status of the game server. A request that includes this
    -- parameter updates the game server\'s /LastHealthCheckTime/ timestamp.
    UpdateGameServer -> Maybe GameServerHealthCheck
healthCheck :: Prelude.Maybe GameServerHealthCheck,
    -- | A set of custom game server properties, formatted as a single string
    -- value. This data is passed to a game client or service when it requests
    -- information on game servers using ListGameServers or ClaimGameServer.
    UpdateGameServer -> Maybe Text
gameServerData :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the game server is available or is currently hosting
    -- gameplay.
    UpdateGameServer -> Maybe GameServerUtilizationStatus
utilizationStatus :: Prelude.Maybe GameServerUtilizationStatus,
    -- | A unique identifier for the game server group where the game server is
    -- running. Use either the GameServerGroup name or ARN value.
    UpdateGameServer -> Text
gameServerGroupName :: Prelude.Text,
    -- | A custom string that uniquely identifies the game server to update.
    UpdateGameServer -> Text
gameServerId :: Prelude.Text
  }
  deriving (UpdateGameServer -> UpdateGameServer -> Bool
(UpdateGameServer -> UpdateGameServer -> Bool)
-> (UpdateGameServer -> UpdateGameServer -> Bool)
-> Eq UpdateGameServer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateGameServer -> UpdateGameServer -> Bool
$c/= :: UpdateGameServer -> UpdateGameServer -> Bool
== :: UpdateGameServer -> UpdateGameServer -> Bool
$c== :: UpdateGameServer -> UpdateGameServer -> Bool
Prelude.Eq, ReadPrec [UpdateGameServer]
ReadPrec UpdateGameServer
Int -> ReadS UpdateGameServer
ReadS [UpdateGameServer]
(Int -> ReadS UpdateGameServer)
-> ReadS [UpdateGameServer]
-> ReadPrec UpdateGameServer
-> ReadPrec [UpdateGameServer]
-> Read UpdateGameServer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateGameServer]
$creadListPrec :: ReadPrec [UpdateGameServer]
readPrec :: ReadPrec UpdateGameServer
$creadPrec :: ReadPrec UpdateGameServer
readList :: ReadS [UpdateGameServer]
$creadList :: ReadS [UpdateGameServer]
readsPrec :: Int -> ReadS UpdateGameServer
$creadsPrec :: Int -> ReadS UpdateGameServer
Prelude.Read, Int -> UpdateGameServer -> ShowS
[UpdateGameServer] -> ShowS
UpdateGameServer -> String
(Int -> UpdateGameServer -> ShowS)
-> (UpdateGameServer -> String)
-> ([UpdateGameServer] -> ShowS)
-> Show UpdateGameServer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateGameServer] -> ShowS
$cshowList :: [UpdateGameServer] -> ShowS
show :: UpdateGameServer -> String
$cshow :: UpdateGameServer -> String
showsPrec :: Int -> UpdateGameServer -> ShowS
$cshowsPrec :: Int -> UpdateGameServer -> ShowS
Prelude.Show, (forall x. UpdateGameServer -> Rep UpdateGameServer x)
-> (forall x. Rep UpdateGameServer x -> UpdateGameServer)
-> Generic UpdateGameServer
forall x. Rep UpdateGameServer x -> UpdateGameServer
forall x. UpdateGameServer -> Rep UpdateGameServer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateGameServer x -> UpdateGameServer
$cfrom :: forall x. UpdateGameServer -> Rep UpdateGameServer x
Prelude.Generic)

-- |
-- Create a value of 'UpdateGameServer' 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:
--
-- 'healthCheck', 'updateGameServer_healthCheck' - Indicates health status of the game server. A request that includes this
-- parameter updates the game server\'s /LastHealthCheckTime/ timestamp.
--
-- 'gameServerData', 'updateGameServer_gameServerData' - A set of custom game server properties, formatted as a single string
-- value. This data is passed to a game client or service when it requests
-- information on game servers using ListGameServers or ClaimGameServer.
--
-- 'utilizationStatus', 'updateGameServer_utilizationStatus' - Indicates whether the game server is available or is currently hosting
-- gameplay.
--
-- 'gameServerGroupName', 'updateGameServer_gameServerGroupName' - A unique identifier for the game server group where the game server is
-- running. Use either the GameServerGroup name or ARN value.
--
-- 'gameServerId', 'updateGameServer_gameServerId' - A custom string that uniquely identifies the game server to update.
newUpdateGameServer ::
  -- | 'gameServerGroupName'
  Prelude.Text ->
  -- | 'gameServerId'
  Prelude.Text ->
  UpdateGameServer
newUpdateGameServer :: Text -> Text -> UpdateGameServer
newUpdateGameServer
  Text
pGameServerGroupName_
  Text
pGameServerId_ =
    UpdateGameServer' :: Maybe GameServerHealthCheck
-> Maybe Text
-> Maybe GameServerUtilizationStatus
-> Text
-> Text
-> UpdateGameServer
UpdateGameServer'
      { $sel:healthCheck:UpdateGameServer' :: Maybe GameServerHealthCheck
healthCheck = Maybe GameServerHealthCheck
forall a. Maybe a
Prelude.Nothing,
        $sel:gameServerData:UpdateGameServer' :: Maybe Text
gameServerData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:utilizationStatus:UpdateGameServer' :: Maybe GameServerUtilizationStatus
utilizationStatus = Maybe GameServerUtilizationStatus
forall a. Maybe a
Prelude.Nothing,
        $sel:gameServerGroupName:UpdateGameServer' :: Text
gameServerGroupName = Text
pGameServerGroupName_,
        $sel:gameServerId:UpdateGameServer' :: Text
gameServerId = Text
pGameServerId_
      }

-- | Indicates health status of the game server. A request that includes this
-- parameter updates the game server\'s /LastHealthCheckTime/ timestamp.
updateGameServer_healthCheck :: Lens.Lens' UpdateGameServer (Prelude.Maybe GameServerHealthCheck)
updateGameServer_healthCheck :: (Maybe GameServerHealthCheck -> f (Maybe GameServerHealthCheck))
-> UpdateGameServer -> f UpdateGameServer
updateGameServer_healthCheck = (UpdateGameServer -> Maybe GameServerHealthCheck)
-> (UpdateGameServer
    -> Maybe GameServerHealthCheck -> UpdateGameServer)
-> Lens
     UpdateGameServer
     UpdateGameServer
     (Maybe GameServerHealthCheck)
     (Maybe GameServerHealthCheck)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGameServer' {Maybe GameServerHealthCheck
healthCheck :: Maybe GameServerHealthCheck
$sel:healthCheck:UpdateGameServer' :: UpdateGameServer -> Maybe GameServerHealthCheck
healthCheck} -> Maybe GameServerHealthCheck
healthCheck) (\s :: UpdateGameServer
s@UpdateGameServer' {} Maybe GameServerHealthCheck
a -> UpdateGameServer
s {$sel:healthCheck:UpdateGameServer' :: Maybe GameServerHealthCheck
healthCheck = Maybe GameServerHealthCheck
a} :: UpdateGameServer)

-- | A set of custom game server properties, formatted as a single string
-- value. This data is passed to a game client or service when it requests
-- information on game servers using ListGameServers or ClaimGameServer.
updateGameServer_gameServerData :: Lens.Lens' UpdateGameServer (Prelude.Maybe Prelude.Text)
updateGameServer_gameServerData :: (Maybe Text -> f (Maybe Text))
-> UpdateGameServer -> f UpdateGameServer
updateGameServer_gameServerData = (UpdateGameServer -> Maybe Text)
-> (UpdateGameServer -> Maybe Text -> UpdateGameServer)
-> Lens UpdateGameServer UpdateGameServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGameServer' {Maybe Text
gameServerData :: Maybe Text
$sel:gameServerData:UpdateGameServer' :: UpdateGameServer -> Maybe Text
gameServerData} -> Maybe Text
gameServerData) (\s :: UpdateGameServer
s@UpdateGameServer' {} Maybe Text
a -> UpdateGameServer
s {$sel:gameServerData:UpdateGameServer' :: Maybe Text
gameServerData = Maybe Text
a} :: UpdateGameServer)

-- | Indicates whether the game server is available or is currently hosting
-- gameplay.
updateGameServer_utilizationStatus :: Lens.Lens' UpdateGameServer (Prelude.Maybe GameServerUtilizationStatus)
updateGameServer_utilizationStatus :: (Maybe GameServerUtilizationStatus
 -> f (Maybe GameServerUtilizationStatus))
-> UpdateGameServer -> f UpdateGameServer
updateGameServer_utilizationStatus = (UpdateGameServer -> Maybe GameServerUtilizationStatus)
-> (UpdateGameServer
    -> Maybe GameServerUtilizationStatus -> UpdateGameServer)
-> Lens
     UpdateGameServer
     UpdateGameServer
     (Maybe GameServerUtilizationStatus)
     (Maybe GameServerUtilizationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGameServer' {Maybe GameServerUtilizationStatus
utilizationStatus :: Maybe GameServerUtilizationStatus
$sel:utilizationStatus:UpdateGameServer' :: UpdateGameServer -> Maybe GameServerUtilizationStatus
utilizationStatus} -> Maybe GameServerUtilizationStatus
utilizationStatus) (\s :: UpdateGameServer
s@UpdateGameServer' {} Maybe GameServerUtilizationStatus
a -> UpdateGameServer
s {$sel:utilizationStatus:UpdateGameServer' :: Maybe GameServerUtilizationStatus
utilizationStatus = Maybe GameServerUtilizationStatus
a} :: UpdateGameServer)

-- | A unique identifier for the game server group where the game server is
-- running. Use either the GameServerGroup name or ARN value.
updateGameServer_gameServerGroupName :: Lens.Lens' UpdateGameServer Prelude.Text
updateGameServer_gameServerGroupName :: (Text -> f Text) -> UpdateGameServer -> f UpdateGameServer
updateGameServer_gameServerGroupName = (UpdateGameServer -> Text)
-> (UpdateGameServer -> Text -> UpdateGameServer)
-> Lens UpdateGameServer UpdateGameServer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGameServer' {Text
gameServerGroupName :: Text
$sel:gameServerGroupName:UpdateGameServer' :: UpdateGameServer -> Text
gameServerGroupName} -> Text
gameServerGroupName) (\s :: UpdateGameServer
s@UpdateGameServer' {} Text
a -> UpdateGameServer
s {$sel:gameServerGroupName:UpdateGameServer' :: Text
gameServerGroupName = Text
a} :: UpdateGameServer)

-- | A custom string that uniquely identifies the game server to update.
updateGameServer_gameServerId :: Lens.Lens' UpdateGameServer Prelude.Text
updateGameServer_gameServerId :: (Text -> f Text) -> UpdateGameServer -> f UpdateGameServer
updateGameServer_gameServerId = (UpdateGameServer -> Text)
-> (UpdateGameServer -> Text -> UpdateGameServer)
-> Lens UpdateGameServer UpdateGameServer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGameServer' {Text
gameServerId :: Text
$sel:gameServerId:UpdateGameServer' :: UpdateGameServer -> Text
gameServerId} -> Text
gameServerId) (\s :: UpdateGameServer
s@UpdateGameServer' {} Text
a -> UpdateGameServer
s {$sel:gameServerId:UpdateGameServer' :: Text
gameServerId = Text
a} :: UpdateGameServer)

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

instance Prelude.NFData UpdateGameServer

instance Core.ToHeaders UpdateGameServer where
  toHeaders :: UpdateGameServer -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateGameServer -> 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.UpdateGameServer" :: 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 UpdateGameServer where
  toJSON :: UpdateGameServer -> Value
toJSON UpdateGameServer' {Maybe Text
Maybe GameServerHealthCheck
Maybe GameServerUtilizationStatus
Text
gameServerId :: Text
gameServerGroupName :: Text
utilizationStatus :: Maybe GameServerUtilizationStatus
gameServerData :: Maybe Text
healthCheck :: Maybe GameServerHealthCheck
$sel:gameServerId:UpdateGameServer' :: UpdateGameServer -> Text
$sel:gameServerGroupName:UpdateGameServer' :: UpdateGameServer -> Text
$sel:utilizationStatus:UpdateGameServer' :: UpdateGameServer -> Maybe GameServerUtilizationStatus
$sel:gameServerData:UpdateGameServer' :: UpdateGameServer -> Maybe Text
$sel:healthCheck:UpdateGameServer' :: UpdateGameServer -> Maybe GameServerHealthCheck
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"HealthCheck" Text -> GameServerHealthCheck -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (GameServerHealthCheck -> Pair)
-> Maybe GameServerHealthCheck -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe GameServerHealthCheck
healthCheck,
            (Text
"GameServerData" 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
gameServerData,
            (Text
"UtilizationStatus" Text -> GameServerUtilizationStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (GameServerUtilizationStatus -> Pair)
-> Maybe GameServerUtilizationStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe GameServerUtilizationStatus
utilizationStatus,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"GameServerGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
gameServerGroupName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"GameServerId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
gameServerId)
          ]
      )

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

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

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

-- |
-- Create a value of 'UpdateGameServerResponse' 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:
--
-- 'gameServer', 'updateGameServerResponse_gameServer' - Object that describes the newly updated game server.
--
-- 'httpStatus', 'updateGameServerResponse_httpStatus' - The response's http status code.
newUpdateGameServerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateGameServerResponse
newUpdateGameServerResponse :: Int -> UpdateGameServerResponse
newUpdateGameServerResponse Int
pHttpStatus_ =
  UpdateGameServerResponse' :: Maybe GameServer -> Int -> UpdateGameServerResponse
UpdateGameServerResponse'
    { $sel:gameServer:UpdateGameServerResponse' :: Maybe GameServer
gameServer =
        Maybe GameServer
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateGameServerResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Object that describes the newly updated game server.
updateGameServerResponse_gameServer :: Lens.Lens' UpdateGameServerResponse (Prelude.Maybe GameServer)
updateGameServerResponse_gameServer :: (Maybe GameServer -> f (Maybe GameServer))
-> UpdateGameServerResponse -> f UpdateGameServerResponse
updateGameServerResponse_gameServer = (UpdateGameServerResponse -> Maybe GameServer)
-> (UpdateGameServerResponse
    -> Maybe GameServer -> UpdateGameServerResponse)
-> Lens
     UpdateGameServerResponse
     UpdateGameServerResponse
     (Maybe GameServer)
     (Maybe GameServer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGameServerResponse' {Maybe GameServer
gameServer :: Maybe GameServer
$sel:gameServer:UpdateGameServerResponse' :: UpdateGameServerResponse -> Maybe GameServer
gameServer} -> Maybe GameServer
gameServer) (\s :: UpdateGameServerResponse
s@UpdateGameServerResponse' {} Maybe GameServer
a -> UpdateGameServerResponse
s {$sel:gameServer:UpdateGameServerResponse' :: Maybe GameServer
gameServer = Maybe GameServer
a} :: UpdateGameServerResponse)

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

instance Prelude.NFData UpdateGameServerResponse