{-# 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.StartStageDeployment
(
StartStageDeployment (..),
newStartStageDeployment,
startStageDeployment_clientToken,
startStageDeployment_gameName,
startStageDeployment_snapshotId,
startStageDeployment_stageName,
StartStageDeploymentResponse (..),
newStartStageDeploymentResponse,
startStageDeploymentResponse_stageDeployment,
startStageDeploymentResponse_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 StartStageDeployment = StartStageDeployment'
{
StartStageDeployment -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
StartStageDeployment -> Text
gameName :: Prelude.Text,
StartStageDeployment -> Text
snapshotId :: Prelude.Text,
StartStageDeployment -> Text
stageName :: Prelude.Text
}
deriving (StartStageDeployment -> StartStageDeployment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartStageDeployment -> StartStageDeployment -> Bool
$c/= :: StartStageDeployment -> StartStageDeployment -> Bool
== :: StartStageDeployment -> StartStageDeployment -> Bool
$c== :: StartStageDeployment -> StartStageDeployment -> Bool
Prelude.Eq, ReadPrec [StartStageDeployment]
ReadPrec StartStageDeployment
Int -> ReadS StartStageDeployment
ReadS [StartStageDeployment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartStageDeployment]
$creadListPrec :: ReadPrec [StartStageDeployment]
readPrec :: ReadPrec StartStageDeployment
$creadPrec :: ReadPrec StartStageDeployment
readList :: ReadS [StartStageDeployment]
$creadList :: ReadS [StartStageDeployment]
readsPrec :: Int -> ReadS StartStageDeployment
$creadsPrec :: Int -> ReadS StartStageDeployment
Prelude.Read, Int -> StartStageDeployment -> ShowS
[StartStageDeployment] -> ShowS
StartStageDeployment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartStageDeployment] -> ShowS
$cshowList :: [StartStageDeployment] -> ShowS
show :: StartStageDeployment -> String
$cshow :: StartStageDeployment -> String
showsPrec :: Int -> StartStageDeployment -> ShowS
$cshowsPrec :: Int -> StartStageDeployment -> ShowS
Prelude.Show, forall x. Rep StartStageDeployment x -> StartStageDeployment
forall x. StartStageDeployment -> Rep StartStageDeployment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartStageDeployment x -> StartStageDeployment
$cfrom :: forall x. StartStageDeployment -> Rep StartStageDeployment x
Prelude.Generic)
newStartStageDeployment ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
StartStageDeployment
newStartStageDeployment :: Text -> Text -> Text -> StartStageDeployment
newStartStageDeployment
Text
pGameName_
Text
pSnapshotId_
Text
pStageName_ =
StartStageDeployment'
{ $sel:clientToken:StartStageDeployment' :: Maybe Text
clientToken =
forall a. Maybe a
Prelude.Nothing,
$sel:gameName:StartStageDeployment' :: Text
gameName = Text
pGameName_,
$sel:snapshotId:StartStageDeployment' :: Text
snapshotId = Text
pSnapshotId_,
$sel:stageName:StartStageDeployment' :: Text
stageName = Text
pStageName_
}
startStageDeployment_clientToken :: Lens.Lens' StartStageDeployment (Prelude.Maybe Prelude.Text)
startStageDeployment_clientToken :: Lens' StartStageDeployment (Maybe Text)
startStageDeployment_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartStageDeployment' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:StartStageDeployment' :: StartStageDeployment -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: StartStageDeployment
s@StartStageDeployment' {} Maybe Text
a -> StartStageDeployment
s {$sel:clientToken:StartStageDeployment' :: Maybe Text
clientToken = Maybe Text
a} :: StartStageDeployment)
startStageDeployment_gameName :: Lens.Lens' StartStageDeployment Prelude.Text
startStageDeployment_gameName :: Lens' StartStageDeployment Text
startStageDeployment_gameName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartStageDeployment' {Text
gameName :: Text
$sel:gameName:StartStageDeployment' :: StartStageDeployment -> Text
gameName} -> Text
gameName) (\s :: StartStageDeployment
s@StartStageDeployment' {} Text
a -> StartStageDeployment
s {$sel:gameName:StartStageDeployment' :: Text
gameName = Text
a} :: StartStageDeployment)
startStageDeployment_snapshotId :: Lens.Lens' StartStageDeployment Prelude.Text
startStageDeployment_snapshotId :: Lens' StartStageDeployment Text
startStageDeployment_snapshotId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartStageDeployment' {Text
snapshotId :: Text
$sel:snapshotId:StartStageDeployment' :: StartStageDeployment -> Text
snapshotId} -> Text
snapshotId) (\s :: StartStageDeployment
s@StartStageDeployment' {} Text
a -> StartStageDeployment
s {$sel:snapshotId:StartStageDeployment' :: Text
snapshotId = Text
a} :: StartStageDeployment)
startStageDeployment_stageName :: Lens.Lens' StartStageDeployment Prelude.Text
startStageDeployment_stageName :: Lens' StartStageDeployment Text
startStageDeployment_stageName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartStageDeployment' {Text
stageName :: Text
$sel:stageName:StartStageDeployment' :: StartStageDeployment -> Text
stageName} -> Text
stageName) (\s :: StartStageDeployment
s@StartStageDeployment' {} Text
a -> StartStageDeployment
s {$sel:stageName:StartStageDeployment' :: Text
stageName = Text
a} :: StartStageDeployment)
instance Core.AWSRequest StartStageDeployment where
type
AWSResponse StartStageDeployment =
StartStageDeploymentResponse
request :: (Service -> Service)
-> StartStageDeployment -> Request StartStageDeployment
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StartStageDeployment
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartStageDeployment)))
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 StageDeploymentDetails -> Int -> StartStageDeploymentResponse
StartStageDeploymentResponse'
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
"StageDeployment")
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 StartStageDeployment where
hashWithSalt :: Int -> StartStageDeployment -> Int
hashWithSalt Int
_salt StartStageDeployment' {Maybe Text
Text
stageName :: Text
snapshotId :: Text
gameName :: Text
clientToken :: Maybe Text
$sel:stageName:StartStageDeployment' :: StartStageDeployment -> Text
$sel:snapshotId:StartStageDeployment' :: StartStageDeployment -> Text
$sel:gameName:StartStageDeployment' :: StartStageDeployment -> Text
$sel:clientToken:StartStageDeployment' :: StartStageDeployment -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
gameName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
snapshotId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
stageName
instance Prelude.NFData StartStageDeployment where
rnf :: StartStageDeployment -> ()
rnf StartStageDeployment' {Maybe Text
Text
stageName :: Text
snapshotId :: Text
gameName :: Text
clientToken :: Maybe Text
$sel:stageName:StartStageDeployment' :: StartStageDeployment -> Text
$sel:snapshotId:StartStageDeployment' :: StartStageDeployment -> Text
$sel:gameName:StartStageDeployment' :: StartStageDeployment -> Text
$sel:clientToken:StartStageDeployment' :: StartStageDeployment -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
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
snapshotId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
stageName
instance Data.ToHeaders StartStageDeployment where
toHeaders :: StartStageDeployment -> 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 StartStageDeployment where
toJSON :: StartStageDeployment -> Value
toJSON StartStageDeployment' {Maybe Text
Text
stageName :: Text
snapshotId :: Text
gameName :: Text
clientToken :: Maybe Text
$sel:stageName:StartStageDeployment' :: StartStageDeployment -> Text
$sel:snapshotId:StartStageDeployment' :: StartStageDeployment -> Text
$sel:gameName:StartStageDeployment' :: StartStageDeployment -> Text
$sel:clientToken:StartStageDeployment' :: StartStageDeployment -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ClientToken" 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
clientToken,
forall a. a -> Maybe a
Prelude.Just (Key
"SnapshotId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
snapshotId)
]
)
instance Data.ToPath StartStageDeployment where
toPath :: StartStageDeployment -> ByteString
toPath StartStageDeployment' {Maybe Text
Text
stageName :: Text
snapshotId :: Text
gameName :: Text
clientToken :: Maybe Text
$sel:stageName:StartStageDeployment' :: StartStageDeployment -> Text
$sel:snapshotId:StartStageDeployment' :: StartStageDeployment -> Text
$sel:gameName:StartStageDeployment' :: StartStageDeployment -> Text
$sel:clientToken:StartStageDeployment' :: StartStageDeployment -> 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,
ByteString
"/deployment"
]
instance Data.ToQuery StartStageDeployment where
toQuery :: StartStageDeployment -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StartStageDeploymentResponse = StartStageDeploymentResponse'
{
StartStageDeploymentResponse -> Maybe StageDeploymentDetails
stageDeployment :: Prelude.Maybe StageDeploymentDetails,
StartStageDeploymentResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartStageDeploymentResponse
-> StartStageDeploymentResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartStageDeploymentResponse
-> StartStageDeploymentResponse -> Bool
$c/= :: StartStageDeploymentResponse
-> StartStageDeploymentResponse -> Bool
== :: StartStageDeploymentResponse
-> StartStageDeploymentResponse -> Bool
$c== :: StartStageDeploymentResponse
-> StartStageDeploymentResponse -> Bool
Prelude.Eq, ReadPrec [StartStageDeploymentResponse]
ReadPrec StartStageDeploymentResponse
Int -> ReadS StartStageDeploymentResponse
ReadS [StartStageDeploymentResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartStageDeploymentResponse]
$creadListPrec :: ReadPrec [StartStageDeploymentResponse]
readPrec :: ReadPrec StartStageDeploymentResponse
$creadPrec :: ReadPrec StartStageDeploymentResponse
readList :: ReadS [StartStageDeploymentResponse]
$creadList :: ReadS [StartStageDeploymentResponse]
readsPrec :: Int -> ReadS StartStageDeploymentResponse
$creadsPrec :: Int -> ReadS StartStageDeploymentResponse
Prelude.Read, Int -> StartStageDeploymentResponse -> ShowS
[StartStageDeploymentResponse] -> ShowS
StartStageDeploymentResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartStageDeploymentResponse] -> ShowS
$cshowList :: [StartStageDeploymentResponse] -> ShowS
show :: StartStageDeploymentResponse -> String
$cshow :: StartStageDeploymentResponse -> String
showsPrec :: Int -> StartStageDeploymentResponse -> ShowS
$cshowsPrec :: Int -> StartStageDeploymentResponse -> ShowS
Prelude.Show, forall x.
Rep StartStageDeploymentResponse x -> StartStageDeploymentResponse
forall x.
StartStageDeploymentResponse -> Rep StartStageDeploymentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartStageDeploymentResponse x -> StartStageDeploymentResponse
$cfrom :: forall x.
StartStageDeploymentResponse -> Rep StartStageDeploymentResponse x
Prelude.Generic)
newStartStageDeploymentResponse ::
Prelude.Int ->
StartStageDeploymentResponse
newStartStageDeploymentResponse :: Int -> StartStageDeploymentResponse
newStartStageDeploymentResponse Int
pHttpStatus_ =
StartStageDeploymentResponse'
{ $sel:stageDeployment:StartStageDeploymentResponse' :: Maybe StageDeploymentDetails
stageDeployment =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartStageDeploymentResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startStageDeploymentResponse_stageDeployment :: Lens.Lens' StartStageDeploymentResponse (Prelude.Maybe StageDeploymentDetails)
startStageDeploymentResponse_stageDeployment :: Lens' StartStageDeploymentResponse (Maybe StageDeploymentDetails)
startStageDeploymentResponse_stageDeployment = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartStageDeploymentResponse' {Maybe StageDeploymentDetails
stageDeployment :: Maybe StageDeploymentDetails
$sel:stageDeployment:StartStageDeploymentResponse' :: StartStageDeploymentResponse -> Maybe StageDeploymentDetails
stageDeployment} -> Maybe StageDeploymentDetails
stageDeployment) (\s :: StartStageDeploymentResponse
s@StartStageDeploymentResponse' {} Maybe StageDeploymentDetails
a -> StartStageDeploymentResponse
s {$sel:stageDeployment:StartStageDeploymentResponse' :: Maybe StageDeploymentDetails
stageDeployment = Maybe StageDeploymentDetails
a} :: StartStageDeploymentResponse)
startStageDeploymentResponse_httpStatus :: Lens.Lens' StartStageDeploymentResponse Prelude.Int
startStageDeploymentResponse_httpStatus :: Lens' StartStageDeploymentResponse Int
startStageDeploymentResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartStageDeploymentResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartStageDeploymentResponse' :: StartStageDeploymentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartStageDeploymentResponse
s@StartStageDeploymentResponse' {} Int
a -> StartStageDeploymentResponse
s {$sel:httpStatus:StartStageDeploymentResponse' :: Int
httpStatus = Int
a} :: StartStageDeploymentResponse)
instance Prelude.NFData StartStageDeploymentResponse where
rnf :: StartStageDeploymentResponse -> ()
rnf StartStageDeploymentResponse' {Int
Maybe StageDeploymentDetails
httpStatus :: Int
stageDeployment :: Maybe StageDeploymentDetails
$sel:httpStatus:StartStageDeploymentResponse' :: StartStageDeploymentResponse -> Int
$sel:stageDeployment:StartStageDeploymentResponse' :: StartStageDeploymentResponse -> Maybe StageDeploymentDetails
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe StageDeploymentDetails
stageDeployment
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus