{-# 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.GamesParks.UpdateStage
(
UpdateStage (..),
newUpdateStage,
updateStage_description,
updateStage_role,
updateStage_gameName,
updateStage_stageName,
UpdateStageResponse (..),
newUpdateStageResponse,
updateStageResponse_stage,
updateStageResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GamesParks.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateStage = UpdateStage'
{
UpdateStage -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateStage -> Maybe Text
role' :: Prelude.Maybe Prelude.Text,
UpdateStage -> Text
gameName :: Prelude.Text,
UpdateStage -> Text
stageName :: Prelude.Text
}
deriving (UpdateStage -> UpdateStage -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateStage -> UpdateStage -> Bool
$c/= :: UpdateStage -> UpdateStage -> Bool
== :: UpdateStage -> UpdateStage -> Bool
$c== :: UpdateStage -> UpdateStage -> Bool
Prelude.Eq, ReadPrec [UpdateStage]
ReadPrec UpdateStage
Int -> ReadS UpdateStage
ReadS [UpdateStage]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateStage]
$creadListPrec :: ReadPrec [UpdateStage]
readPrec :: ReadPrec UpdateStage
$creadPrec :: ReadPrec UpdateStage
readList :: ReadS [UpdateStage]
$creadList :: ReadS [UpdateStage]
readsPrec :: Int -> ReadS UpdateStage
$creadsPrec :: Int -> ReadS UpdateStage
Prelude.Read, Int -> UpdateStage -> ShowS
[UpdateStage] -> ShowS
UpdateStage -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateStage] -> ShowS
$cshowList :: [UpdateStage] -> ShowS
show :: UpdateStage -> String
$cshow :: UpdateStage -> String
showsPrec :: Int -> UpdateStage -> ShowS
$cshowsPrec :: Int -> UpdateStage -> ShowS
Prelude.Show, forall x. Rep UpdateStage x -> UpdateStage
forall x. UpdateStage -> Rep UpdateStage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateStage x -> UpdateStage
$cfrom :: forall x. UpdateStage -> Rep UpdateStage x
Prelude.Generic)
newUpdateStage ::
Prelude.Text ->
Prelude.Text ->
UpdateStage
newUpdateStage :: Text -> Text -> UpdateStage
newUpdateStage Text
pGameName_ Text
pStageName_ =
UpdateStage'
{ $sel:description:UpdateStage' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:role':UpdateStage' :: Maybe Text
role' = forall a. Maybe a
Prelude.Nothing,
$sel:gameName:UpdateStage' :: Text
gameName = Text
pGameName_,
$sel:stageName:UpdateStage' :: Text
stageName = Text
pStageName_
}
updateStage_description :: Lens.Lens' UpdateStage (Prelude.Maybe Prelude.Text)
updateStage_description :: Lens' UpdateStage (Maybe Text)
updateStage_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStage' {Maybe Text
description :: Maybe Text
$sel:description:UpdateStage' :: UpdateStage -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateStage
s@UpdateStage' {} Maybe Text
a -> UpdateStage
s {$sel:description:UpdateStage' :: Maybe Text
description = Maybe Text
a} :: UpdateStage)
updateStage_role :: Lens.Lens' UpdateStage (Prelude.Maybe Prelude.Text)
updateStage_role :: Lens' UpdateStage (Maybe Text)
updateStage_role = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStage' {Maybe Text
role' :: Maybe Text
$sel:role':UpdateStage' :: UpdateStage -> Maybe Text
role'} -> Maybe Text
role') (\s :: UpdateStage
s@UpdateStage' {} Maybe Text
a -> UpdateStage
s {$sel:role':UpdateStage' :: Maybe Text
role' = Maybe Text
a} :: UpdateStage)
updateStage_gameName :: Lens.Lens' UpdateStage Prelude.Text
updateStage_gameName :: Lens' UpdateStage Text
updateStage_gameName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStage' {Text
gameName :: Text
$sel:gameName:UpdateStage' :: UpdateStage -> Text
gameName} -> Text
gameName) (\s :: UpdateStage
s@UpdateStage' {} Text
a -> UpdateStage
s {$sel:gameName:UpdateStage' :: Text
gameName = Text
a} :: UpdateStage)
updateStage_stageName :: Lens.Lens' UpdateStage Prelude.Text
updateStage_stageName :: Lens' UpdateStage Text
updateStage_stageName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStage' {Text
stageName :: Text
$sel:stageName:UpdateStage' :: UpdateStage -> Text
stageName} -> Text
stageName) (\s :: UpdateStage
s@UpdateStage' {} Text
a -> UpdateStage
s {$sel:stageName:UpdateStage' :: Text
stageName = Text
a} :: UpdateStage)
instance Core.AWSRequest UpdateStage where
type AWSResponse UpdateStage = UpdateStageResponse
request :: (Service -> Service) -> UpdateStage -> Request UpdateStage
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateStage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateStage)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe StageDetails -> Int -> UpdateStageResponse
UpdateStageResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Stage")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable UpdateStage where
hashWithSalt :: Int -> UpdateStage -> Int
hashWithSalt Int
_salt UpdateStage' {Maybe Text
Text
stageName :: Text
gameName :: Text
role' :: Maybe Text
description :: Maybe Text
$sel:stageName:UpdateStage' :: UpdateStage -> Text
$sel:gameName:UpdateStage' :: UpdateStage -> Text
$sel:role':UpdateStage' :: UpdateStage -> Maybe Text
$sel:description:UpdateStage' :: UpdateStage -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
role'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
gameName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
stageName
instance Prelude.NFData UpdateStage where
rnf :: UpdateStage -> ()
rnf UpdateStage' {Maybe Text
Text
stageName :: Text
gameName :: Text
role' :: Maybe Text
description :: Maybe Text
$sel:stageName:UpdateStage' :: UpdateStage -> Text
$sel:gameName:UpdateStage' :: UpdateStage -> Text
$sel:role':UpdateStage' :: UpdateStage -> Maybe Text
$sel:description:UpdateStage' :: UpdateStage -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
role'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
gameName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
stageName
instance Data.ToHeaders UpdateStage where
toHeaders :: UpdateStage -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON UpdateStage where
toJSON :: UpdateStage -> Value
toJSON UpdateStage' {Maybe Text
Text
stageName :: Text
gameName :: Text
role' :: Maybe Text
description :: Maybe Text
$sel:stageName:UpdateStage' :: UpdateStage -> Text
$sel:gameName:UpdateStage' :: UpdateStage -> Text
$sel:role':UpdateStage' :: UpdateStage -> Maybe Text
$sel:description:UpdateStage' :: UpdateStage -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
(Key
"Role" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
role'
]
)
instance Data.ToPath UpdateStage where
toPath :: UpdateStage -> ByteString
toPath UpdateStage' {Maybe Text
Text
stageName :: Text
gameName :: Text
role' :: Maybe Text
description :: Maybe Text
$sel:stageName:UpdateStage' :: UpdateStage -> Text
$sel:gameName:UpdateStage' :: UpdateStage -> Text
$sel:role':UpdateStage' :: UpdateStage -> Maybe Text
$sel:description:UpdateStage' :: UpdateStage -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/game/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
gameName,
ByteString
"/stage/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
stageName
]
instance Data.ToQuery UpdateStage where
toQuery :: UpdateStage -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateStageResponse = UpdateStageResponse'
{
UpdateStageResponse -> Maybe StageDetails
stage :: Prelude.Maybe StageDetails,
UpdateStageResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateStageResponse -> UpdateStageResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateStageResponse -> UpdateStageResponse -> Bool
$c/= :: UpdateStageResponse -> UpdateStageResponse -> Bool
== :: UpdateStageResponse -> UpdateStageResponse -> Bool
$c== :: UpdateStageResponse -> UpdateStageResponse -> Bool
Prelude.Eq, ReadPrec [UpdateStageResponse]
ReadPrec UpdateStageResponse
Int -> ReadS UpdateStageResponse
ReadS [UpdateStageResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateStageResponse]
$creadListPrec :: ReadPrec [UpdateStageResponse]
readPrec :: ReadPrec UpdateStageResponse
$creadPrec :: ReadPrec UpdateStageResponse
readList :: ReadS [UpdateStageResponse]
$creadList :: ReadS [UpdateStageResponse]
readsPrec :: Int -> ReadS UpdateStageResponse
$creadsPrec :: Int -> ReadS UpdateStageResponse
Prelude.Read, Int -> UpdateStageResponse -> ShowS
[UpdateStageResponse] -> ShowS
UpdateStageResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateStageResponse] -> ShowS
$cshowList :: [UpdateStageResponse] -> ShowS
show :: UpdateStageResponse -> String
$cshow :: UpdateStageResponse -> String
showsPrec :: Int -> UpdateStageResponse -> ShowS
$cshowsPrec :: Int -> UpdateStageResponse -> ShowS
Prelude.Show, forall x. Rep UpdateStageResponse x -> UpdateStageResponse
forall x. UpdateStageResponse -> Rep UpdateStageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateStageResponse x -> UpdateStageResponse
$cfrom :: forall x. UpdateStageResponse -> Rep UpdateStageResponse x
Prelude.Generic)
newUpdateStageResponse ::
Prelude.Int ->
UpdateStageResponse
newUpdateStageResponse :: Int -> UpdateStageResponse
newUpdateStageResponse Int
pHttpStatus_ =
UpdateStageResponse'
{ $sel:stage:UpdateStageResponse' :: Maybe StageDetails
stage = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateStageResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateStageResponse_stage :: Lens.Lens' UpdateStageResponse (Prelude.Maybe StageDetails)
updateStageResponse_stage :: Lens' UpdateStageResponse (Maybe StageDetails)
updateStageResponse_stage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStageResponse' {Maybe StageDetails
stage :: Maybe StageDetails
$sel:stage:UpdateStageResponse' :: UpdateStageResponse -> Maybe StageDetails
stage} -> Maybe StageDetails
stage) (\s :: UpdateStageResponse
s@UpdateStageResponse' {} Maybe StageDetails
a -> UpdateStageResponse
s {$sel:stage:UpdateStageResponse' :: Maybe StageDetails
stage = Maybe StageDetails
a} :: UpdateStageResponse)
updateStageResponse_httpStatus :: Lens.Lens' UpdateStageResponse Prelude.Int
updateStageResponse_httpStatus :: Lens' UpdateStageResponse Int
updateStageResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateStageResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateStageResponse' :: UpdateStageResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateStageResponse
s@UpdateStageResponse' {} Int
a -> UpdateStageResponse
s {$sel:httpStatus:UpdateStageResponse' :: Int
httpStatus = Int
a} :: UpdateStageResponse)
instance Prelude.NFData UpdateStageResponse where
rnf :: UpdateStageResponse -> ()
rnf UpdateStageResponse' {Int
Maybe StageDetails
httpStatus :: Int
stage :: Maybe StageDetails
$sel:httpStatus:UpdateStageResponse' :: UpdateStageResponse -> Int
$sel:stage:UpdateStageResponse' :: UpdateStageResponse -> Maybe StageDetails
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe StageDetails
stage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus