{-# 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.ResumeGameServerGroup
(
ResumeGameServerGroup (..),
newResumeGameServerGroup,
resumeGameServerGroup_gameServerGroupName,
resumeGameServerGroup_resumeActions,
ResumeGameServerGroupResponse (..),
newResumeGameServerGroupResponse,
resumeGameServerGroupResponse_gameServerGroup,
resumeGameServerGroupResponse_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 ResumeGameServerGroup = ResumeGameServerGroup'
{
ResumeGameServerGroup -> Text
gameServerGroupName :: Prelude.Text,
ResumeGameServerGroup -> NonEmpty GameServerGroupAction
resumeActions :: Prelude.NonEmpty GameServerGroupAction
}
deriving (ResumeGameServerGroup -> ResumeGameServerGroup -> Bool
(ResumeGameServerGroup -> ResumeGameServerGroup -> Bool)
-> (ResumeGameServerGroup -> ResumeGameServerGroup -> Bool)
-> Eq ResumeGameServerGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResumeGameServerGroup -> ResumeGameServerGroup -> Bool
$c/= :: ResumeGameServerGroup -> ResumeGameServerGroup -> Bool
== :: ResumeGameServerGroup -> ResumeGameServerGroup -> Bool
$c== :: ResumeGameServerGroup -> ResumeGameServerGroup -> Bool
Prelude.Eq, ReadPrec [ResumeGameServerGroup]
ReadPrec ResumeGameServerGroup
Int -> ReadS ResumeGameServerGroup
ReadS [ResumeGameServerGroup]
(Int -> ReadS ResumeGameServerGroup)
-> ReadS [ResumeGameServerGroup]
-> ReadPrec ResumeGameServerGroup
-> ReadPrec [ResumeGameServerGroup]
-> Read ResumeGameServerGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResumeGameServerGroup]
$creadListPrec :: ReadPrec [ResumeGameServerGroup]
readPrec :: ReadPrec ResumeGameServerGroup
$creadPrec :: ReadPrec ResumeGameServerGroup
readList :: ReadS [ResumeGameServerGroup]
$creadList :: ReadS [ResumeGameServerGroup]
readsPrec :: Int -> ReadS ResumeGameServerGroup
$creadsPrec :: Int -> ReadS ResumeGameServerGroup
Prelude.Read, Int -> ResumeGameServerGroup -> ShowS
[ResumeGameServerGroup] -> ShowS
ResumeGameServerGroup -> String
(Int -> ResumeGameServerGroup -> ShowS)
-> (ResumeGameServerGroup -> String)
-> ([ResumeGameServerGroup] -> ShowS)
-> Show ResumeGameServerGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResumeGameServerGroup] -> ShowS
$cshowList :: [ResumeGameServerGroup] -> ShowS
show :: ResumeGameServerGroup -> String
$cshow :: ResumeGameServerGroup -> String
showsPrec :: Int -> ResumeGameServerGroup -> ShowS
$cshowsPrec :: Int -> ResumeGameServerGroup -> ShowS
Prelude.Show, (forall x. ResumeGameServerGroup -> Rep ResumeGameServerGroup x)
-> (forall x. Rep ResumeGameServerGroup x -> ResumeGameServerGroup)
-> Generic ResumeGameServerGroup
forall x. Rep ResumeGameServerGroup x -> ResumeGameServerGroup
forall x. ResumeGameServerGroup -> Rep ResumeGameServerGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResumeGameServerGroup x -> ResumeGameServerGroup
$cfrom :: forall x. ResumeGameServerGroup -> Rep ResumeGameServerGroup x
Prelude.Generic)
newResumeGameServerGroup ::
Prelude.Text ->
Prelude.NonEmpty GameServerGroupAction ->
ResumeGameServerGroup
newResumeGameServerGroup :: Text -> NonEmpty GameServerGroupAction -> ResumeGameServerGroup
newResumeGameServerGroup
Text
pGameServerGroupName_
NonEmpty GameServerGroupAction
pResumeActions_ =
ResumeGameServerGroup' :: Text -> NonEmpty GameServerGroupAction -> ResumeGameServerGroup
ResumeGameServerGroup'
{ $sel:gameServerGroupName:ResumeGameServerGroup' :: Text
gameServerGroupName =
Text
pGameServerGroupName_,
$sel:resumeActions:ResumeGameServerGroup' :: NonEmpty GameServerGroupAction
resumeActions = Tagged
(NonEmpty GameServerGroupAction)
(Identity (NonEmpty GameServerGroupAction))
-> Tagged
(NonEmpty GameServerGroupAction)
(Identity (NonEmpty GameServerGroupAction))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
(NonEmpty GameServerGroupAction)
(Identity (NonEmpty GameServerGroupAction))
-> Tagged
(NonEmpty GameServerGroupAction)
(Identity (NonEmpty GameServerGroupAction)))
-> NonEmpty GameServerGroupAction -> NonEmpty GameServerGroupAction
forall t b. AReview t b -> b -> t
Lens.# NonEmpty GameServerGroupAction
pResumeActions_
}
resumeGameServerGroup_gameServerGroupName :: Lens.Lens' ResumeGameServerGroup Prelude.Text
resumeGameServerGroup_gameServerGroupName :: (Text -> f Text)
-> ResumeGameServerGroup -> f ResumeGameServerGroup
resumeGameServerGroup_gameServerGroupName = (ResumeGameServerGroup -> Text)
-> (ResumeGameServerGroup -> Text -> ResumeGameServerGroup)
-> Lens ResumeGameServerGroup ResumeGameServerGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResumeGameServerGroup' {Text
gameServerGroupName :: Text
$sel:gameServerGroupName:ResumeGameServerGroup' :: ResumeGameServerGroup -> Text
gameServerGroupName} -> Text
gameServerGroupName) (\s :: ResumeGameServerGroup
s@ResumeGameServerGroup' {} Text
a -> ResumeGameServerGroup
s {$sel:gameServerGroupName:ResumeGameServerGroup' :: Text
gameServerGroupName = Text
a} :: ResumeGameServerGroup)
resumeGameServerGroup_resumeActions :: Lens.Lens' ResumeGameServerGroup (Prelude.NonEmpty GameServerGroupAction)
resumeGameServerGroup_resumeActions :: (NonEmpty GameServerGroupAction
-> f (NonEmpty GameServerGroupAction))
-> ResumeGameServerGroup -> f ResumeGameServerGroup
resumeGameServerGroup_resumeActions = (ResumeGameServerGroup -> NonEmpty GameServerGroupAction)
-> (ResumeGameServerGroup
-> NonEmpty GameServerGroupAction -> ResumeGameServerGroup)
-> Lens
ResumeGameServerGroup
ResumeGameServerGroup
(NonEmpty GameServerGroupAction)
(NonEmpty GameServerGroupAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResumeGameServerGroup' {NonEmpty GameServerGroupAction
resumeActions :: NonEmpty GameServerGroupAction
$sel:resumeActions:ResumeGameServerGroup' :: ResumeGameServerGroup -> NonEmpty GameServerGroupAction
resumeActions} -> NonEmpty GameServerGroupAction
resumeActions) (\s :: ResumeGameServerGroup
s@ResumeGameServerGroup' {} NonEmpty GameServerGroupAction
a -> ResumeGameServerGroup
s {$sel:resumeActions:ResumeGameServerGroup' :: NonEmpty GameServerGroupAction
resumeActions = NonEmpty GameServerGroupAction
a} :: ResumeGameServerGroup) ((NonEmpty GameServerGroupAction
-> f (NonEmpty GameServerGroupAction))
-> ResumeGameServerGroup -> f ResumeGameServerGroup)
-> ((NonEmpty GameServerGroupAction
-> f (NonEmpty GameServerGroupAction))
-> NonEmpty GameServerGroupAction
-> f (NonEmpty GameServerGroupAction))
-> (NonEmpty GameServerGroupAction
-> f (NonEmpty GameServerGroupAction))
-> ResumeGameServerGroup
-> f ResumeGameServerGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty GameServerGroupAction
-> f (NonEmpty GameServerGroupAction))
-> NonEmpty GameServerGroupAction
-> f (NonEmpty GameServerGroupAction)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest ResumeGameServerGroup where
type
AWSResponse ResumeGameServerGroup =
ResumeGameServerGroupResponse
request :: ResumeGameServerGroup -> Request ResumeGameServerGroup
request = Service -> ResumeGameServerGroup -> Request ResumeGameServerGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ResumeGameServerGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ResumeGameServerGroup)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ResumeGameServerGroup))
-> Logger
-> Service
-> Proxy ResumeGameServerGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ResumeGameServerGroup)))
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 -> ResumeGameServerGroupResponse
ResumeGameServerGroupResponse'
(Maybe GameServerGroup -> Int -> ResumeGameServerGroupResponse)
-> Either String (Maybe GameServerGroup)
-> Either String (Int -> ResumeGameServerGroupResponse)
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 -> ResumeGameServerGroupResponse)
-> Either String Int -> Either String ResumeGameServerGroupResponse
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 ResumeGameServerGroup
instance Prelude.NFData ResumeGameServerGroup
instance Core.ToHeaders ResumeGameServerGroup where
toHeaders :: ResumeGameServerGroup -> ResponseHeaders
toHeaders =
ResponseHeaders -> ResumeGameServerGroup -> 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.ResumeGameServerGroup" ::
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 ResumeGameServerGroup where
toJSON :: ResumeGameServerGroup -> Value
toJSON ResumeGameServerGroup' {NonEmpty GameServerGroupAction
Text
resumeActions :: NonEmpty GameServerGroupAction
gameServerGroupName :: Text
$sel:resumeActions:ResumeGameServerGroup' :: ResumeGameServerGroup -> NonEmpty GameServerGroupAction
$sel:gameServerGroupName:ResumeGameServerGroup' :: ResumeGameServerGroup -> 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
"ResumeActions" Text -> NonEmpty GameServerGroupAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty GameServerGroupAction
resumeActions)
]
)
instance Core.ToPath ResumeGameServerGroup where
toPath :: ResumeGameServerGroup -> ByteString
toPath = ByteString -> ResumeGameServerGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ResumeGameServerGroup where
toQuery :: ResumeGameServerGroup -> QueryString
toQuery = QueryString -> ResumeGameServerGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ResumeGameServerGroupResponse = ResumeGameServerGroupResponse'
{
ResumeGameServerGroupResponse -> Maybe GameServerGroup
gameServerGroup :: Prelude.Maybe GameServerGroup,
ResumeGameServerGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ResumeGameServerGroupResponse
-> ResumeGameServerGroupResponse -> Bool
(ResumeGameServerGroupResponse
-> ResumeGameServerGroupResponse -> Bool)
-> (ResumeGameServerGroupResponse
-> ResumeGameServerGroupResponse -> Bool)
-> Eq ResumeGameServerGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResumeGameServerGroupResponse
-> ResumeGameServerGroupResponse -> Bool
$c/= :: ResumeGameServerGroupResponse
-> ResumeGameServerGroupResponse -> Bool
== :: ResumeGameServerGroupResponse
-> ResumeGameServerGroupResponse -> Bool
$c== :: ResumeGameServerGroupResponse
-> ResumeGameServerGroupResponse -> Bool
Prelude.Eq, ReadPrec [ResumeGameServerGroupResponse]
ReadPrec ResumeGameServerGroupResponse
Int -> ReadS ResumeGameServerGroupResponse
ReadS [ResumeGameServerGroupResponse]
(Int -> ReadS ResumeGameServerGroupResponse)
-> ReadS [ResumeGameServerGroupResponse]
-> ReadPrec ResumeGameServerGroupResponse
-> ReadPrec [ResumeGameServerGroupResponse]
-> Read ResumeGameServerGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResumeGameServerGroupResponse]
$creadListPrec :: ReadPrec [ResumeGameServerGroupResponse]
readPrec :: ReadPrec ResumeGameServerGroupResponse
$creadPrec :: ReadPrec ResumeGameServerGroupResponse
readList :: ReadS [ResumeGameServerGroupResponse]
$creadList :: ReadS [ResumeGameServerGroupResponse]
readsPrec :: Int -> ReadS ResumeGameServerGroupResponse
$creadsPrec :: Int -> ReadS ResumeGameServerGroupResponse
Prelude.Read, Int -> ResumeGameServerGroupResponse -> ShowS
[ResumeGameServerGroupResponse] -> ShowS
ResumeGameServerGroupResponse -> String
(Int -> ResumeGameServerGroupResponse -> ShowS)
-> (ResumeGameServerGroupResponse -> String)
-> ([ResumeGameServerGroupResponse] -> ShowS)
-> Show ResumeGameServerGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResumeGameServerGroupResponse] -> ShowS
$cshowList :: [ResumeGameServerGroupResponse] -> ShowS
show :: ResumeGameServerGroupResponse -> String
$cshow :: ResumeGameServerGroupResponse -> String
showsPrec :: Int -> ResumeGameServerGroupResponse -> ShowS
$cshowsPrec :: Int -> ResumeGameServerGroupResponse -> ShowS
Prelude.Show, (forall x.
ResumeGameServerGroupResponse
-> Rep ResumeGameServerGroupResponse x)
-> (forall x.
Rep ResumeGameServerGroupResponse x
-> ResumeGameServerGroupResponse)
-> Generic ResumeGameServerGroupResponse
forall x.
Rep ResumeGameServerGroupResponse x
-> ResumeGameServerGroupResponse
forall x.
ResumeGameServerGroupResponse
-> Rep ResumeGameServerGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResumeGameServerGroupResponse x
-> ResumeGameServerGroupResponse
$cfrom :: forall x.
ResumeGameServerGroupResponse
-> Rep ResumeGameServerGroupResponse x
Prelude.Generic)
newResumeGameServerGroupResponse ::
Prelude.Int ->
ResumeGameServerGroupResponse
newResumeGameServerGroupResponse :: Int -> ResumeGameServerGroupResponse
newResumeGameServerGroupResponse Int
pHttpStatus_ =
ResumeGameServerGroupResponse' :: Maybe GameServerGroup -> Int -> ResumeGameServerGroupResponse
ResumeGameServerGroupResponse'
{ $sel:gameServerGroup:ResumeGameServerGroupResponse' :: Maybe GameServerGroup
gameServerGroup =
Maybe GameServerGroup
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ResumeGameServerGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
resumeGameServerGroupResponse_gameServerGroup :: Lens.Lens' ResumeGameServerGroupResponse (Prelude.Maybe GameServerGroup)
resumeGameServerGroupResponse_gameServerGroup :: (Maybe GameServerGroup -> f (Maybe GameServerGroup))
-> ResumeGameServerGroupResponse -> f ResumeGameServerGroupResponse
resumeGameServerGroupResponse_gameServerGroup = (ResumeGameServerGroupResponse -> Maybe GameServerGroup)
-> (ResumeGameServerGroupResponse
-> Maybe GameServerGroup -> ResumeGameServerGroupResponse)
-> Lens
ResumeGameServerGroupResponse
ResumeGameServerGroupResponse
(Maybe GameServerGroup)
(Maybe GameServerGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResumeGameServerGroupResponse' {Maybe GameServerGroup
gameServerGroup :: Maybe GameServerGroup
$sel:gameServerGroup:ResumeGameServerGroupResponse' :: ResumeGameServerGroupResponse -> Maybe GameServerGroup
gameServerGroup} -> Maybe GameServerGroup
gameServerGroup) (\s :: ResumeGameServerGroupResponse
s@ResumeGameServerGroupResponse' {} Maybe GameServerGroup
a -> ResumeGameServerGroupResponse
s {$sel:gameServerGroup:ResumeGameServerGroupResponse' :: Maybe GameServerGroup
gameServerGroup = Maybe GameServerGroup
a} :: ResumeGameServerGroupResponse)
resumeGameServerGroupResponse_httpStatus :: Lens.Lens' ResumeGameServerGroupResponse Prelude.Int
resumeGameServerGroupResponse_httpStatus :: (Int -> f Int)
-> ResumeGameServerGroupResponse -> f ResumeGameServerGroupResponse
resumeGameServerGroupResponse_httpStatus = (ResumeGameServerGroupResponse -> Int)
-> (ResumeGameServerGroupResponse
-> Int -> ResumeGameServerGroupResponse)
-> Lens
ResumeGameServerGroupResponse ResumeGameServerGroupResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResumeGameServerGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:ResumeGameServerGroupResponse' :: ResumeGameServerGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ResumeGameServerGroupResponse
s@ResumeGameServerGroupResponse' {} Int
a -> ResumeGameServerGroupResponse
s {$sel:httpStatus:ResumeGameServerGroupResponse' :: Int
httpStatus = Int
a} :: ResumeGameServerGroupResponse)
instance Prelude.NFData ResumeGameServerGroupResponse