{-# 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.DeleteGameServerGroup
(
DeleteGameServerGroup (..),
newDeleteGameServerGroup,
deleteGameServerGroup_deleteOption,
deleteGameServerGroup_gameServerGroupName,
DeleteGameServerGroupResponse (..),
newDeleteGameServerGroupResponse,
deleteGameServerGroupResponse_gameServerGroup,
deleteGameServerGroupResponse_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
data DeleteGameServerGroup = DeleteGameServerGroup'
{
DeleteGameServerGroup -> Maybe GameServerGroupDeleteOption
deleteOption :: Prelude.Maybe GameServerGroupDeleteOption,
DeleteGameServerGroup -> Text
gameServerGroupName :: Prelude.Text
}
deriving (DeleteGameServerGroup -> DeleteGameServerGroup -> Bool
(DeleteGameServerGroup -> DeleteGameServerGroup -> Bool)
-> (DeleteGameServerGroup -> DeleteGameServerGroup -> Bool)
-> Eq DeleteGameServerGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteGameServerGroup -> DeleteGameServerGroup -> Bool
$c/= :: DeleteGameServerGroup -> DeleteGameServerGroup -> Bool
== :: DeleteGameServerGroup -> DeleteGameServerGroup -> Bool
$c== :: DeleteGameServerGroup -> DeleteGameServerGroup -> Bool
Prelude.Eq, ReadPrec [DeleteGameServerGroup]
ReadPrec DeleteGameServerGroup
Int -> ReadS DeleteGameServerGroup
ReadS [DeleteGameServerGroup]
(Int -> ReadS DeleteGameServerGroup)
-> ReadS [DeleteGameServerGroup]
-> ReadPrec DeleteGameServerGroup
-> ReadPrec [DeleteGameServerGroup]
-> Read DeleteGameServerGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteGameServerGroup]
$creadListPrec :: ReadPrec [DeleteGameServerGroup]
readPrec :: ReadPrec DeleteGameServerGroup
$creadPrec :: ReadPrec DeleteGameServerGroup
readList :: ReadS [DeleteGameServerGroup]
$creadList :: ReadS [DeleteGameServerGroup]
readsPrec :: Int -> ReadS DeleteGameServerGroup
$creadsPrec :: Int -> ReadS DeleteGameServerGroup
Prelude.Read, Int -> DeleteGameServerGroup -> ShowS
[DeleteGameServerGroup] -> ShowS
DeleteGameServerGroup -> String
(Int -> DeleteGameServerGroup -> ShowS)
-> (DeleteGameServerGroup -> String)
-> ([DeleteGameServerGroup] -> ShowS)
-> Show DeleteGameServerGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteGameServerGroup] -> ShowS
$cshowList :: [DeleteGameServerGroup] -> ShowS
show :: DeleteGameServerGroup -> String
$cshow :: DeleteGameServerGroup -> String
showsPrec :: Int -> DeleteGameServerGroup -> ShowS
$cshowsPrec :: Int -> DeleteGameServerGroup -> ShowS
Prelude.Show, (forall x. DeleteGameServerGroup -> Rep DeleteGameServerGroup x)
-> (forall x. Rep DeleteGameServerGroup x -> DeleteGameServerGroup)
-> Generic DeleteGameServerGroup
forall x. Rep DeleteGameServerGroup x -> DeleteGameServerGroup
forall x. DeleteGameServerGroup -> Rep DeleteGameServerGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteGameServerGroup x -> DeleteGameServerGroup
$cfrom :: forall x. DeleteGameServerGroup -> Rep DeleteGameServerGroup x
Prelude.Generic)
newDeleteGameServerGroup ::
Prelude.Text ->
DeleteGameServerGroup
newDeleteGameServerGroup :: Text -> DeleteGameServerGroup
newDeleteGameServerGroup Text
pGameServerGroupName_ =
DeleteGameServerGroup' :: Maybe GameServerGroupDeleteOption -> Text -> DeleteGameServerGroup
DeleteGameServerGroup'
{ $sel:deleteOption:DeleteGameServerGroup' :: Maybe GameServerGroupDeleteOption
deleteOption =
Maybe GameServerGroupDeleteOption
forall a. Maybe a
Prelude.Nothing,
$sel:gameServerGroupName:DeleteGameServerGroup' :: Text
gameServerGroupName = Text
pGameServerGroupName_
}
deleteGameServerGroup_deleteOption :: Lens.Lens' DeleteGameServerGroup (Prelude.Maybe GameServerGroupDeleteOption)
deleteGameServerGroup_deleteOption :: (Maybe GameServerGroupDeleteOption
-> f (Maybe GameServerGroupDeleteOption))
-> DeleteGameServerGroup -> f DeleteGameServerGroup
deleteGameServerGroup_deleteOption = (DeleteGameServerGroup -> Maybe GameServerGroupDeleteOption)
-> (DeleteGameServerGroup
-> Maybe GameServerGroupDeleteOption -> DeleteGameServerGroup)
-> Lens
DeleteGameServerGroup
DeleteGameServerGroup
(Maybe GameServerGroupDeleteOption)
(Maybe GameServerGroupDeleteOption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGameServerGroup' {Maybe GameServerGroupDeleteOption
deleteOption :: Maybe GameServerGroupDeleteOption
$sel:deleteOption:DeleteGameServerGroup' :: DeleteGameServerGroup -> Maybe GameServerGroupDeleteOption
deleteOption} -> Maybe GameServerGroupDeleteOption
deleteOption) (\s :: DeleteGameServerGroup
s@DeleteGameServerGroup' {} Maybe GameServerGroupDeleteOption
a -> DeleteGameServerGroup
s {$sel:deleteOption:DeleteGameServerGroup' :: Maybe GameServerGroupDeleteOption
deleteOption = Maybe GameServerGroupDeleteOption
a} :: DeleteGameServerGroup)
deleteGameServerGroup_gameServerGroupName :: Lens.Lens' DeleteGameServerGroup Prelude.Text
deleteGameServerGroup_gameServerGroupName :: (Text -> f Text)
-> DeleteGameServerGroup -> f DeleteGameServerGroup
deleteGameServerGroup_gameServerGroupName = (DeleteGameServerGroup -> Text)
-> (DeleteGameServerGroup -> Text -> DeleteGameServerGroup)
-> Lens DeleteGameServerGroup DeleteGameServerGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGameServerGroup' {Text
gameServerGroupName :: Text
$sel:gameServerGroupName:DeleteGameServerGroup' :: DeleteGameServerGroup -> Text
gameServerGroupName} -> Text
gameServerGroupName) (\s :: DeleteGameServerGroup
s@DeleteGameServerGroup' {} Text
a -> DeleteGameServerGroup
s {$sel:gameServerGroupName:DeleteGameServerGroup' :: Text
gameServerGroupName = Text
a} :: DeleteGameServerGroup)
instance Core.AWSRequest DeleteGameServerGroup where
type
AWSResponse DeleteGameServerGroup =
DeleteGameServerGroupResponse
request :: DeleteGameServerGroup -> Request DeleteGameServerGroup
request = Service -> DeleteGameServerGroup -> Request DeleteGameServerGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteGameServerGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteGameServerGroup)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteGameServerGroup))
-> Logger
-> Service
-> Proxy DeleteGameServerGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteGameServerGroup)))
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 GameServerGroup -> Int -> DeleteGameServerGroupResponse
DeleteGameServerGroupResponse'
(Maybe GameServerGroup -> Int -> DeleteGameServerGroupResponse)
-> Either String (Maybe GameServerGroup)
-> Either String (Int -> DeleteGameServerGroupResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe GameServerGroup)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GameServerGroup")
Either String (Int -> DeleteGameServerGroupResponse)
-> Either String Int -> Either String DeleteGameServerGroupResponse
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 DeleteGameServerGroup
instance Prelude.NFData DeleteGameServerGroup
instance Core.ToHeaders DeleteGameServerGroup where
toHeaders :: DeleteGameServerGroup -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteGameServerGroup -> 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.DeleteGameServerGroup" ::
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 DeleteGameServerGroup where
toJSON :: DeleteGameServerGroup -> Value
toJSON DeleteGameServerGroup' {Maybe GameServerGroupDeleteOption
Text
gameServerGroupName :: Text
deleteOption :: Maybe GameServerGroupDeleteOption
$sel:gameServerGroupName:DeleteGameServerGroup' :: DeleteGameServerGroup -> Text
$sel:deleteOption:DeleteGameServerGroup' :: DeleteGameServerGroup -> Maybe GameServerGroupDeleteOption
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DeleteOption" Text -> GameServerGroupDeleteOption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (GameServerGroupDeleteOption -> Pair)
-> Maybe GameServerGroupDeleteOption -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe GameServerGroupDeleteOption
deleteOption,
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)
]
)
instance Core.ToPath DeleteGameServerGroup where
toPath :: DeleteGameServerGroup -> ByteString
toPath = ByteString -> DeleteGameServerGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteGameServerGroup where
toQuery :: DeleteGameServerGroup -> QueryString
toQuery = QueryString -> DeleteGameServerGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteGameServerGroupResponse = DeleteGameServerGroupResponse'
{
DeleteGameServerGroupResponse -> Maybe GameServerGroup
gameServerGroup :: Prelude.Maybe GameServerGroup,
DeleteGameServerGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteGameServerGroupResponse
-> DeleteGameServerGroupResponse -> Bool
(DeleteGameServerGroupResponse
-> DeleteGameServerGroupResponse -> Bool)
-> (DeleteGameServerGroupResponse
-> DeleteGameServerGroupResponse -> Bool)
-> Eq DeleteGameServerGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteGameServerGroupResponse
-> DeleteGameServerGroupResponse -> Bool
$c/= :: DeleteGameServerGroupResponse
-> DeleteGameServerGroupResponse -> Bool
== :: DeleteGameServerGroupResponse
-> DeleteGameServerGroupResponse -> Bool
$c== :: DeleteGameServerGroupResponse
-> DeleteGameServerGroupResponse -> Bool
Prelude.Eq, ReadPrec [DeleteGameServerGroupResponse]
ReadPrec DeleteGameServerGroupResponse
Int -> ReadS DeleteGameServerGroupResponse
ReadS [DeleteGameServerGroupResponse]
(Int -> ReadS DeleteGameServerGroupResponse)
-> ReadS [DeleteGameServerGroupResponse]
-> ReadPrec DeleteGameServerGroupResponse
-> ReadPrec [DeleteGameServerGroupResponse]
-> Read DeleteGameServerGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteGameServerGroupResponse]
$creadListPrec :: ReadPrec [DeleteGameServerGroupResponse]
readPrec :: ReadPrec DeleteGameServerGroupResponse
$creadPrec :: ReadPrec DeleteGameServerGroupResponse
readList :: ReadS [DeleteGameServerGroupResponse]
$creadList :: ReadS [DeleteGameServerGroupResponse]
readsPrec :: Int -> ReadS DeleteGameServerGroupResponse
$creadsPrec :: Int -> ReadS DeleteGameServerGroupResponse
Prelude.Read, Int -> DeleteGameServerGroupResponse -> ShowS
[DeleteGameServerGroupResponse] -> ShowS
DeleteGameServerGroupResponse -> String
(Int -> DeleteGameServerGroupResponse -> ShowS)
-> (DeleteGameServerGroupResponse -> String)
-> ([DeleteGameServerGroupResponse] -> ShowS)
-> Show DeleteGameServerGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteGameServerGroupResponse] -> ShowS
$cshowList :: [DeleteGameServerGroupResponse] -> ShowS
show :: DeleteGameServerGroupResponse -> String
$cshow :: DeleteGameServerGroupResponse -> String
showsPrec :: Int -> DeleteGameServerGroupResponse -> ShowS
$cshowsPrec :: Int -> DeleteGameServerGroupResponse -> ShowS
Prelude.Show, (forall x.
DeleteGameServerGroupResponse
-> Rep DeleteGameServerGroupResponse x)
-> (forall x.
Rep DeleteGameServerGroupResponse x
-> DeleteGameServerGroupResponse)
-> Generic DeleteGameServerGroupResponse
forall x.
Rep DeleteGameServerGroupResponse x
-> DeleteGameServerGroupResponse
forall x.
DeleteGameServerGroupResponse
-> Rep DeleteGameServerGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteGameServerGroupResponse x
-> DeleteGameServerGroupResponse
$cfrom :: forall x.
DeleteGameServerGroupResponse
-> Rep DeleteGameServerGroupResponse x
Prelude.Generic)
newDeleteGameServerGroupResponse ::
Prelude.Int ->
DeleteGameServerGroupResponse
newDeleteGameServerGroupResponse :: Int -> DeleteGameServerGroupResponse
newDeleteGameServerGroupResponse Int
pHttpStatus_ =
DeleteGameServerGroupResponse' :: Maybe GameServerGroup -> Int -> DeleteGameServerGroupResponse
DeleteGameServerGroupResponse'
{ $sel:gameServerGroup:DeleteGameServerGroupResponse' :: Maybe GameServerGroup
gameServerGroup =
Maybe GameServerGroup
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteGameServerGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteGameServerGroupResponse_gameServerGroup :: Lens.Lens' DeleteGameServerGroupResponse (Prelude.Maybe GameServerGroup)
deleteGameServerGroupResponse_gameServerGroup :: (Maybe GameServerGroup -> f (Maybe GameServerGroup))
-> DeleteGameServerGroupResponse -> f DeleteGameServerGroupResponse
deleteGameServerGroupResponse_gameServerGroup = (DeleteGameServerGroupResponse -> Maybe GameServerGroup)
-> (DeleteGameServerGroupResponse
-> Maybe GameServerGroup -> DeleteGameServerGroupResponse)
-> Lens
DeleteGameServerGroupResponse
DeleteGameServerGroupResponse
(Maybe GameServerGroup)
(Maybe GameServerGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGameServerGroupResponse' {Maybe GameServerGroup
gameServerGroup :: Maybe GameServerGroup
$sel:gameServerGroup:DeleteGameServerGroupResponse' :: DeleteGameServerGroupResponse -> Maybe GameServerGroup
gameServerGroup} -> Maybe GameServerGroup
gameServerGroup) (\s :: DeleteGameServerGroupResponse
s@DeleteGameServerGroupResponse' {} Maybe GameServerGroup
a -> DeleteGameServerGroupResponse
s {$sel:gameServerGroup:DeleteGameServerGroupResponse' :: Maybe GameServerGroup
gameServerGroup = Maybe GameServerGroup
a} :: DeleteGameServerGroupResponse)
deleteGameServerGroupResponse_httpStatus :: Lens.Lens' DeleteGameServerGroupResponse Prelude.Int
deleteGameServerGroupResponse_httpStatus :: (Int -> f Int)
-> DeleteGameServerGroupResponse -> f DeleteGameServerGroupResponse
deleteGameServerGroupResponse_httpStatus = (DeleteGameServerGroupResponse -> Int)
-> (DeleteGameServerGroupResponse
-> Int -> DeleteGameServerGroupResponse)
-> Lens
DeleteGameServerGroupResponse DeleteGameServerGroupResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGameServerGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteGameServerGroupResponse' :: DeleteGameServerGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteGameServerGroupResponse
s@DeleteGameServerGroupResponse' {} Int
a -> DeleteGameServerGroupResponse
s {$sel:httpStatus:DeleteGameServerGroupResponse' :: Int
httpStatus = Int
a} :: DeleteGameServerGroupResponse)
instance Prelude.NFData DeleteGameServerGroupResponse