{-# 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 #-}
module Amazonka.GameLift.DeregisterGameServer
(
DeregisterGameServer (..),
newDeregisterGameServer,
deregisterGameServer_gameServerGroupName,
deregisterGameServer_gameServerId,
DeregisterGameServerResponse (..),
newDeregisterGameServerResponse,
)
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
data DeregisterGameServer = DeregisterGameServer'
{
DeregisterGameServer -> Text
gameServerGroupName :: Prelude.Text,
DeregisterGameServer -> Text
gameServerId :: Prelude.Text
}
deriving (DeregisterGameServer -> DeregisterGameServer -> Bool
(DeregisterGameServer -> DeregisterGameServer -> Bool)
-> (DeregisterGameServer -> DeregisterGameServer -> Bool)
-> Eq DeregisterGameServer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterGameServer -> DeregisterGameServer -> Bool
$c/= :: DeregisterGameServer -> DeregisterGameServer -> Bool
== :: DeregisterGameServer -> DeregisterGameServer -> Bool
$c== :: DeregisterGameServer -> DeregisterGameServer -> Bool
Prelude.Eq, ReadPrec [DeregisterGameServer]
ReadPrec DeregisterGameServer
Int -> ReadS DeregisterGameServer
ReadS [DeregisterGameServer]
(Int -> ReadS DeregisterGameServer)
-> ReadS [DeregisterGameServer]
-> ReadPrec DeregisterGameServer
-> ReadPrec [DeregisterGameServer]
-> Read DeregisterGameServer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterGameServer]
$creadListPrec :: ReadPrec [DeregisterGameServer]
readPrec :: ReadPrec DeregisterGameServer
$creadPrec :: ReadPrec DeregisterGameServer
readList :: ReadS [DeregisterGameServer]
$creadList :: ReadS [DeregisterGameServer]
readsPrec :: Int -> ReadS DeregisterGameServer
$creadsPrec :: Int -> ReadS DeregisterGameServer
Prelude.Read, Int -> DeregisterGameServer -> ShowS
[DeregisterGameServer] -> ShowS
DeregisterGameServer -> String
(Int -> DeregisterGameServer -> ShowS)
-> (DeregisterGameServer -> String)
-> ([DeregisterGameServer] -> ShowS)
-> Show DeregisterGameServer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterGameServer] -> ShowS
$cshowList :: [DeregisterGameServer] -> ShowS
show :: DeregisterGameServer -> String
$cshow :: DeregisterGameServer -> String
showsPrec :: Int -> DeregisterGameServer -> ShowS
$cshowsPrec :: Int -> DeregisterGameServer -> ShowS
Prelude.Show, (forall x. DeregisterGameServer -> Rep DeregisterGameServer x)
-> (forall x. Rep DeregisterGameServer x -> DeregisterGameServer)
-> Generic DeregisterGameServer
forall x. Rep DeregisterGameServer x -> DeregisterGameServer
forall x. DeregisterGameServer -> Rep DeregisterGameServer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeregisterGameServer x -> DeregisterGameServer
$cfrom :: forall x. DeregisterGameServer -> Rep DeregisterGameServer x
Prelude.Generic)
newDeregisterGameServer ::
Prelude.Text ->
Prelude.Text ->
DeregisterGameServer
newDeregisterGameServer :: Text -> Text -> DeregisterGameServer
newDeregisterGameServer
Text
pGameServerGroupName_
Text
pGameServerId_ =
DeregisterGameServer' :: Text -> Text -> DeregisterGameServer
DeregisterGameServer'
{ $sel:gameServerGroupName:DeregisterGameServer' :: Text
gameServerGroupName =
Text
pGameServerGroupName_,
$sel:gameServerId:DeregisterGameServer' :: Text
gameServerId = Text
pGameServerId_
}
deregisterGameServer_gameServerGroupName :: Lens.Lens' DeregisterGameServer Prelude.Text
deregisterGameServer_gameServerGroupName :: (Text -> f Text) -> DeregisterGameServer -> f DeregisterGameServer
deregisterGameServer_gameServerGroupName = (DeregisterGameServer -> Text)
-> (DeregisterGameServer -> Text -> DeregisterGameServer)
-> Lens DeregisterGameServer DeregisterGameServer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterGameServer' {Text
gameServerGroupName :: Text
$sel:gameServerGroupName:DeregisterGameServer' :: DeregisterGameServer -> Text
gameServerGroupName} -> Text
gameServerGroupName) (\s :: DeregisterGameServer
s@DeregisterGameServer' {} Text
a -> DeregisterGameServer
s {$sel:gameServerGroupName:DeregisterGameServer' :: Text
gameServerGroupName = Text
a} :: DeregisterGameServer)
deregisterGameServer_gameServerId :: Lens.Lens' DeregisterGameServer Prelude.Text
deregisterGameServer_gameServerId :: (Text -> f Text) -> DeregisterGameServer -> f DeregisterGameServer
deregisterGameServer_gameServerId = (DeregisterGameServer -> Text)
-> (DeregisterGameServer -> Text -> DeregisterGameServer)
-> Lens DeregisterGameServer DeregisterGameServer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterGameServer' {Text
gameServerId :: Text
$sel:gameServerId:DeregisterGameServer' :: DeregisterGameServer -> Text
gameServerId} -> Text
gameServerId) (\s :: DeregisterGameServer
s@DeregisterGameServer' {} Text
a -> DeregisterGameServer
s {$sel:gameServerId:DeregisterGameServer' :: Text
gameServerId = Text
a} :: DeregisterGameServer)
instance Core.AWSRequest DeregisterGameServer where
type
AWSResponse DeregisterGameServer =
DeregisterGameServerResponse
request :: DeregisterGameServer -> Request DeregisterGameServer
request = Service -> DeregisterGameServer -> Request DeregisterGameServer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeregisterGameServer
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeregisterGameServer)))
response =
AWSResponse DeregisterGameServer
-> Logger
-> Service
-> Proxy DeregisterGameServer
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeregisterGameServer)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeregisterGameServer
DeregisterGameServerResponse
DeregisterGameServerResponse'
instance Prelude.Hashable DeregisterGameServer
instance Prelude.NFData DeregisterGameServer
instance Core.ToHeaders DeregisterGameServer where
toHeaders :: DeregisterGameServer -> [Header]
toHeaders =
[Header] -> DeregisterGameServer -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"GameLift.DeregisterGameServer" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeregisterGameServer where
toJSON :: DeregisterGameServer -> Value
toJSON DeregisterGameServer' {Text
gameServerId :: Text
gameServerGroupName :: Text
$sel:gameServerId:DeregisterGameServer' :: DeregisterGameServer -> Text
$sel:gameServerGroupName:DeregisterGameServer' :: DeregisterGameServer -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ 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 DeregisterGameServer where
toPath :: DeregisterGameServer -> ByteString
toPath = ByteString -> DeregisterGameServer -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeregisterGameServer where
toQuery :: DeregisterGameServer -> QueryString
toQuery = QueryString -> DeregisterGameServer -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeregisterGameServerResponse = DeregisterGameServerResponse'
{
}
deriving (DeregisterGameServerResponse
-> DeregisterGameServerResponse -> Bool
(DeregisterGameServerResponse
-> DeregisterGameServerResponse -> Bool)
-> (DeregisterGameServerResponse
-> DeregisterGameServerResponse -> Bool)
-> Eq DeregisterGameServerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterGameServerResponse
-> DeregisterGameServerResponse -> Bool
$c/= :: DeregisterGameServerResponse
-> DeregisterGameServerResponse -> Bool
== :: DeregisterGameServerResponse
-> DeregisterGameServerResponse -> Bool
$c== :: DeregisterGameServerResponse
-> DeregisterGameServerResponse -> Bool
Prelude.Eq, ReadPrec [DeregisterGameServerResponse]
ReadPrec DeregisterGameServerResponse
Int -> ReadS DeregisterGameServerResponse
ReadS [DeregisterGameServerResponse]
(Int -> ReadS DeregisterGameServerResponse)
-> ReadS [DeregisterGameServerResponse]
-> ReadPrec DeregisterGameServerResponse
-> ReadPrec [DeregisterGameServerResponse]
-> Read DeregisterGameServerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterGameServerResponse]
$creadListPrec :: ReadPrec [DeregisterGameServerResponse]
readPrec :: ReadPrec DeregisterGameServerResponse
$creadPrec :: ReadPrec DeregisterGameServerResponse
readList :: ReadS [DeregisterGameServerResponse]
$creadList :: ReadS [DeregisterGameServerResponse]
readsPrec :: Int -> ReadS DeregisterGameServerResponse
$creadsPrec :: Int -> ReadS DeregisterGameServerResponse
Prelude.Read, Int -> DeregisterGameServerResponse -> ShowS
[DeregisterGameServerResponse] -> ShowS
DeregisterGameServerResponse -> String
(Int -> DeregisterGameServerResponse -> ShowS)
-> (DeregisterGameServerResponse -> String)
-> ([DeregisterGameServerResponse] -> ShowS)
-> Show DeregisterGameServerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterGameServerResponse] -> ShowS
$cshowList :: [DeregisterGameServerResponse] -> ShowS
show :: DeregisterGameServerResponse -> String
$cshow :: DeregisterGameServerResponse -> String
showsPrec :: Int -> DeregisterGameServerResponse -> ShowS
$cshowsPrec :: Int -> DeregisterGameServerResponse -> ShowS
Prelude.Show, (forall x.
DeregisterGameServerResponse -> Rep DeregisterGameServerResponse x)
-> (forall x.
Rep DeregisterGameServerResponse x -> DeregisterGameServerResponse)
-> Generic DeregisterGameServerResponse
forall x.
Rep DeregisterGameServerResponse x -> DeregisterGameServerResponse
forall x.
DeregisterGameServerResponse -> Rep DeregisterGameServerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeregisterGameServerResponse x -> DeregisterGameServerResponse
$cfrom :: forall x.
DeregisterGameServerResponse -> Rep DeregisterGameServerResponse x
Prelude.Generic)
newDeregisterGameServerResponse ::
DeregisterGameServerResponse
newDeregisterGameServerResponse :: DeregisterGameServerResponse
newDeregisterGameServerResponse =
DeregisterGameServerResponse
DeregisterGameServerResponse'
instance Prelude.NFData DeregisterGameServerResponse