{-# 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.DescribeGameServerGroup
(
DescribeGameServerGroup (..),
newDescribeGameServerGroup,
describeGameServerGroup_gameServerGroupName,
DescribeGameServerGroupResponse (..),
newDescribeGameServerGroupResponse,
describeGameServerGroupResponse_gameServerGroup,
describeGameServerGroupResponse_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 DescribeGameServerGroup = DescribeGameServerGroup'
{
DescribeGameServerGroup -> Text
gameServerGroupName :: Prelude.Text
}
deriving (DescribeGameServerGroup -> DescribeGameServerGroup -> Bool
(DescribeGameServerGroup -> DescribeGameServerGroup -> Bool)
-> (DescribeGameServerGroup -> DescribeGameServerGroup -> Bool)
-> Eq DescribeGameServerGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeGameServerGroup -> DescribeGameServerGroup -> Bool
$c/= :: DescribeGameServerGroup -> DescribeGameServerGroup -> Bool
== :: DescribeGameServerGroup -> DescribeGameServerGroup -> Bool
$c== :: DescribeGameServerGroup -> DescribeGameServerGroup -> Bool
Prelude.Eq, ReadPrec [DescribeGameServerGroup]
ReadPrec DescribeGameServerGroup
Int -> ReadS DescribeGameServerGroup
ReadS [DescribeGameServerGroup]
(Int -> ReadS DescribeGameServerGroup)
-> ReadS [DescribeGameServerGroup]
-> ReadPrec DescribeGameServerGroup
-> ReadPrec [DescribeGameServerGroup]
-> Read DescribeGameServerGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeGameServerGroup]
$creadListPrec :: ReadPrec [DescribeGameServerGroup]
readPrec :: ReadPrec DescribeGameServerGroup
$creadPrec :: ReadPrec DescribeGameServerGroup
readList :: ReadS [DescribeGameServerGroup]
$creadList :: ReadS [DescribeGameServerGroup]
readsPrec :: Int -> ReadS DescribeGameServerGroup
$creadsPrec :: Int -> ReadS DescribeGameServerGroup
Prelude.Read, Int -> DescribeGameServerGroup -> ShowS
[DescribeGameServerGroup] -> ShowS
DescribeGameServerGroup -> String
(Int -> DescribeGameServerGroup -> ShowS)
-> (DescribeGameServerGroup -> String)
-> ([DescribeGameServerGroup] -> ShowS)
-> Show DescribeGameServerGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeGameServerGroup] -> ShowS
$cshowList :: [DescribeGameServerGroup] -> ShowS
show :: DescribeGameServerGroup -> String
$cshow :: DescribeGameServerGroup -> String
showsPrec :: Int -> DescribeGameServerGroup -> ShowS
$cshowsPrec :: Int -> DescribeGameServerGroup -> ShowS
Prelude.Show, (forall x.
DescribeGameServerGroup -> Rep DescribeGameServerGroup x)
-> (forall x.
Rep DescribeGameServerGroup x -> DescribeGameServerGroup)
-> Generic DescribeGameServerGroup
forall x. Rep DescribeGameServerGroup x -> DescribeGameServerGroup
forall x. DescribeGameServerGroup -> Rep DescribeGameServerGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeGameServerGroup x -> DescribeGameServerGroup
$cfrom :: forall x. DescribeGameServerGroup -> Rep DescribeGameServerGroup x
Prelude.Generic)
newDescribeGameServerGroup ::
Prelude.Text ->
DescribeGameServerGroup
newDescribeGameServerGroup :: Text -> DescribeGameServerGroup
newDescribeGameServerGroup Text
pGameServerGroupName_ =
DescribeGameServerGroup' :: Text -> DescribeGameServerGroup
DescribeGameServerGroup'
{ $sel:gameServerGroupName:DescribeGameServerGroup' :: Text
gameServerGroupName =
Text
pGameServerGroupName_
}
describeGameServerGroup_gameServerGroupName :: Lens.Lens' DescribeGameServerGroup Prelude.Text
describeGameServerGroup_gameServerGroupName :: (Text -> f Text)
-> DescribeGameServerGroup -> f DescribeGameServerGroup
describeGameServerGroup_gameServerGroupName = (DescribeGameServerGroup -> Text)
-> (DescribeGameServerGroup -> Text -> DescribeGameServerGroup)
-> Lens DescribeGameServerGroup DescribeGameServerGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameServerGroup' {Text
gameServerGroupName :: Text
$sel:gameServerGroupName:DescribeGameServerGroup' :: DescribeGameServerGroup -> Text
gameServerGroupName} -> Text
gameServerGroupName) (\s :: DescribeGameServerGroup
s@DescribeGameServerGroup' {} Text
a -> DescribeGameServerGroup
s {$sel:gameServerGroupName:DescribeGameServerGroup' :: Text
gameServerGroupName = Text
a} :: DescribeGameServerGroup)
instance Core.AWSRequest DescribeGameServerGroup where
type
AWSResponse DescribeGameServerGroup =
DescribeGameServerGroupResponse
request :: DescribeGameServerGroup -> Request DescribeGameServerGroup
request = Service
-> DescribeGameServerGroup -> Request DescribeGameServerGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeGameServerGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeGameServerGroup)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeGameServerGroup))
-> Logger
-> Service
-> Proxy DescribeGameServerGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeGameServerGroup)))
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 -> DescribeGameServerGroupResponse
DescribeGameServerGroupResponse'
(Maybe GameServerGroup -> Int -> DescribeGameServerGroupResponse)
-> Either String (Maybe GameServerGroup)
-> Either String (Int -> DescribeGameServerGroupResponse)
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 -> DescribeGameServerGroupResponse)
-> Either String Int
-> Either String DescribeGameServerGroupResponse
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 DescribeGameServerGroup
instance Prelude.NFData DescribeGameServerGroup
instance Core.ToHeaders DescribeGameServerGroup where
toHeaders :: DescribeGameServerGroup -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeGameServerGroup -> 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.DescribeGameServerGroup" ::
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 DescribeGameServerGroup where
toJSON :: DescribeGameServerGroup -> Value
toJSON DescribeGameServerGroup' {Text
gameServerGroupName :: Text
$sel:gameServerGroupName:DescribeGameServerGroup' :: DescribeGameServerGroup -> 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)
]
)
instance Core.ToPath DescribeGameServerGroup where
toPath :: DescribeGameServerGroup -> ByteString
toPath = ByteString -> DescribeGameServerGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeGameServerGroup where
toQuery :: DescribeGameServerGroup -> QueryString
toQuery = QueryString -> DescribeGameServerGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeGameServerGroupResponse = DescribeGameServerGroupResponse'
{
DescribeGameServerGroupResponse -> Maybe GameServerGroup
gameServerGroup :: Prelude.Maybe GameServerGroup,
DescribeGameServerGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeGameServerGroupResponse
-> DescribeGameServerGroupResponse -> Bool
(DescribeGameServerGroupResponse
-> DescribeGameServerGroupResponse -> Bool)
-> (DescribeGameServerGroupResponse
-> DescribeGameServerGroupResponse -> Bool)
-> Eq DescribeGameServerGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeGameServerGroupResponse
-> DescribeGameServerGroupResponse -> Bool
$c/= :: DescribeGameServerGroupResponse
-> DescribeGameServerGroupResponse -> Bool
== :: DescribeGameServerGroupResponse
-> DescribeGameServerGroupResponse -> Bool
$c== :: DescribeGameServerGroupResponse
-> DescribeGameServerGroupResponse -> Bool
Prelude.Eq, ReadPrec [DescribeGameServerGroupResponse]
ReadPrec DescribeGameServerGroupResponse
Int -> ReadS DescribeGameServerGroupResponse
ReadS [DescribeGameServerGroupResponse]
(Int -> ReadS DescribeGameServerGroupResponse)
-> ReadS [DescribeGameServerGroupResponse]
-> ReadPrec DescribeGameServerGroupResponse
-> ReadPrec [DescribeGameServerGroupResponse]
-> Read DescribeGameServerGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeGameServerGroupResponse]
$creadListPrec :: ReadPrec [DescribeGameServerGroupResponse]
readPrec :: ReadPrec DescribeGameServerGroupResponse
$creadPrec :: ReadPrec DescribeGameServerGroupResponse
readList :: ReadS [DescribeGameServerGroupResponse]
$creadList :: ReadS [DescribeGameServerGroupResponse]
readsPrec :: Int -> ReadS DescribeGameServerGroupResponse
$creadsPrec :: Int -> ReadS DescribeGameServerGroupResponse
Prelude.Read, Int -> DescribeGameServerGroupResponse -> ShowS
[DescribeGameServerGroupResponse] -> ShowS
DescribeGameServerGroupResponse -> String
(Int -> DescribeGameServerGroupResponse -> ShowS)
-> (DescribeGameServerGroupResponse -> String)
-> ([DescribeGameServerGroupResponse] -> ShowS)
-> Show DescribeGameServerGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeGameServerGroupResponse] -> ShowS
$cshowList :: [DescribeGameServerGroupResponse] -> ShowS
show :: DescribeGameServerGroupResponse -> String
$cshow :: DescribeGameServerGroupResponse -> String
showsPrec :: Int -> DescribeGameServerGroupResponse -> ShowS
$cshowsPrec :: Int -> DescribeGameServerGroupResponse -> ShowS
Prelude.Show, (forall x.
DescribeGameServerGroupResponse
-> Rep DescribeGameServerGroupResponse x)
-> (forall x.
Rep DescribeGameServerGroupResponse x
-> DescribeGameServerGroupResponse)
-> Generic DescribeGameServerGroupResponse
forall x.
Rep DescribeGameServerGroupResponse x
-> DescribeGameServerGroupResponse
forall x.
DescribeGameServerGroupResponse
-> Rep DescribeGameServerGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeGameServerGroupResponse x
-> DescribeGameServerGroupResponse
$cfrom :: forall x.
DescribeGameServerGroupResponse
-> Rep DescribeGameServerGroupResponse x
Prelude.Generic)
newDescribeGameServerGroupResponse ::
Prelude.Int ->
DescribeGameServerGroupResponse
newDescribeGameServerGroupResponse :: Int -> DescribeGameServerGroupResponse
newDescribeGameServerGroupResponse Int
pHttpStatus_ =
DescribeGameServerGroupResponse' :: Maybe GameServerGroup -> Int -> DescribeGameServerGroupResponse
DescribeGameServerGroupResponse'
{ $sel:gameServerGroup:DescribeGameServerGroupResponse' :: Maybe GameServerGroup
gameServerGroup =
Maybe GameServerGroup
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeGameServerGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeGameServerGroupResponse_gameServerGroup :: Lens.Lens' DescribeGameServerGroupResponse (Prelude.Maybe GameServerGroup)
describeGameServerGroupResponse_gameServerGroup :: (Maybe GameServerGroup -> f (Maybe GameServerGroup))
-> DescribeGameServerGroupResponse
-> f DescribeGameServerGroupResponse
describeGameServerGroupResponse_gameServerGroup = (DescribeGameServerGroupResponse -> Maybe GameServerGroup)
-> (DescribeGameServerGroupResponse
-> Maybe GameServerGroup -> DescribeGameServerGroupResponse)
-> Lens
DescribeGameServerGroupResponse
DescribeGameServerGroupResponse
(Maybe GameServerGroup)
(Maybe GameServerGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameServerGroupResponse' {Maybe GameServerGroup
gameServerGroup :: Maybe GameServerGroup
$sel:gameServerGroup:DescribeGameServerGroupResponse' :: DescribeGameServerGroupResponse -> Maybe GameServerGroup
gameServerGroup} -> Maybe GameServerGroup
gameServerGroup) (\s :: DescribeGameServerGroupResponse
s@DescribeGameServerGroupResponse' {} Maybe GameServerGroup
a -> DescribeGameServerGroupResponse
s {$sel:gameServerGroup:DescribeGameServerGroupResponse' :: Maybe GameServerGroup
gameServerGroup = Maybe GameServerGroup
a} :: DescribeGameServerGroupResponse)
describeGameServerGroupResponse_httpStatus :: Lens.Lens' DescribeGameServerGroupResponse Prelude.Int
describeGameServerGroupResponse_httpStatus :: (Int -> f Int)
-> DescribeGameServerGroupResponse
-> f DescribeGameServerGroupResponse
describeGameServerGroupResponse_httpStatus = (DescribeGameServerGroupResponse -> Int)
-> (DescribeGameServerGroupResponse
-> Int -> DescribeGameServerGroupResponse)
-> Lens
DescribeGameServerGroupResponse
DescribeGameServerGroupResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGameServerGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeGameServerGroupResponse' :: DescribeGameServerGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeGameServerGroupResponse
s@DescribeGameServerGroupResponse' {} Int
a -> DescribeGameServerGroupResponse
s {$sel:httpStatus:DescribeGameServerGroupResponse' :: Int
httpStatus = Int
a} :: DescribeGameServerGroupResponse)
instance
Prelude.NFData
DescribeGameServerGroupResponse