{-# 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.CodePipeline.EnableStageTransition
(
EnableStageTransition (..),
newEnableStageTransition,
enableStageTransition_pipelineName,
enableStageTransition_stageName,
enableStageTransition_transitionType,
EnableStageTransitionResponse (..),
newEnableStageTransitionResponse,
)
where
import Amazonka.CodePipeline.Types
import qualified Amazonka.Core as Core
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 EnableStageTransition = EnableStageTransition'
{
EnableStageTransition -> Text
pipelineName :: Prelude.Text,
EnableStageTransition -> Text
stageName :: Prelude.Text,
EnableStageTransition -> StageTransitionType
transitionType :: StageTransitionType
}
deriving (EnableStageTransition -> EnableStageTransition -> Bool
(EnableStageTransition -> EnableStageTransition -> Bool)
-> (EnableStageTransition -> EnableStageTransition -> Bool)
-> Eq EnableStageTransition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableStageTransition -> EnableStageTransition -> Bool
$c/= :: EnableStageTransition -> EnableStageTransition -> Bool
== :: EnableStageTransition -> EnableStageTransition -> Bool
$c== :: EnableStageTransition -> EnableStageTransition -> Bool
Prelude.Eq, ReadPrec [EnableStageTransition]
ReadPrec EnableStageTransition
Int -> ReadS EnableStageTransition
ReadS [EnableStageTransition]
(Int -> ReadS EnableStageTransition)
-> ReadS [EnableStageTransition]
-> ReadPrec EnableStageTransition
-> ReadPrec [EnableStageTransition]
-> Read EnableStageTransition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableStageTransition]
$creadListPrec :: ReadPrec [EnableStageTransition]
readPrec :: ReadPrec EnableStageTransition
$creadPrec :: ReadPrec EnableStageTransition
readList :: ReadS [EnableStageTransition]
$creadList :: ReadS [EnableStageTransition]
readsPrec :: Int -> ReadS EnableStageTransition
$creadsPrec :: Int -> ReadS EnableStageTransition
Prelude.Read, Int -> EnableStageTransition -> ShowS
[EnableStageTransition] -> ShowS
EnableStageTransition -> String
(Int -> EnableStageTransition -> ShowS)
-> (EnableStageTransition -> String)
-> ([EnableStageTransition] -> ShowS)
-> Show EnableStageTransition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableStageTransition] -> ShowS
$cshowList :: [EnableStageTransition] -> ShowS
show :: EnableStageTransition -> String
$cshow :: EnableStageTransition -> String
showsPrec :: Int -> EnableStageTransition -> ShowS
$cshowsPrec :: Int -> EnableStageTransition -> ShowS
Prelude.Show, (forall x. EnableStageTransition -> Rep EnableStageTransition x)
-> (forall x. Rep EnableStageTransition x -> EnableStageTransition)
-> Generic EnableStageTransition
forall x. Rep EnableStageTransition x -> EnableStageTransition
forall x. EnableStageTransition -> Rep EnableStageTransition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnableStageTransition x -> EnableStageTransition
$cfrom :: forall x. EnableStageTransition -> Rep EnableStageTransition x
Prelude.Generic)
newEnableStageTransition ::
Prelude.Text ->
Prelude.Text ->
StageTransitionType ->
EnableStageTransition
newEnableStageTransition :: Text -> Text -> StageTransitionType -> EnableStageTransition
newEnableStageTransition
Text
pPipelineName_
Text
pStageName_
StageTransitionType
pTransitionType_ =
EnableStageTransition' :: Text -> Text -> StageTransitionType -> EnableStageTransition
EnableStageTransition'
{ $sel:pipelineName:EnableStageTransition' :: Text
pipelineName =
Text
pPipelineName_,
$sel:stageName:EnableStageTransition' :: Text
stageName = Text
pStageName_,
$sel:transitionType:EnableStageTransition' :: StageTransitionType
transitionType = StageTransitionType
pTransitionType_
}
enableStageTransition_pipelineName :: Lens.Lens' EnableStageTransition Prelude.Text
enableStageTransition_pipelineName :: (Text -> f Text)
-> EnableStageTransition -> f EnableStageTransition
enableStageTransition_pipelineName = (EnableStageTransition -> Text)
-> (EnableStageTransition -> Text -> EnableStageTransition)
-> Lens EnableStageTransition EnableStageTransition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableStageTransition' {Text
pipelineName :: Text
$sel:pipelineName:EnableStageTransition' :: EnableStageTransition -> Text
pipelineName} -> Text
pipelineName) (\s :: EnableStageTransition
s@EnableStageTransition' {} Text
a -> EnableStageTransition
s {$sel:pipelineName:EnableStageTransition' :: Text
pipelineName = Text
a} :: EnableStageTransition)
enableStageTransition_stageName :: Lens.Lens' EnableStageTransition Prelude.Text
enableStageTransition_stageName :: (Text -> f Text)
-> EnableStageTransition -> f EnableStageTransition
enableStageTransition_stageName = (EnableStageTransition -> Text)
-> (EnableStageTransition -> Text -> EnableStageTransition)
-> Lens EnableStageTransition EnableStageTransition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableStageTransition' {Text
stageName :: Text
$sel:stageName:EnableStageTransition' :: EnableStageTransition -> Text
stageName} -> Text
stageName) (\s :: EnableStageTransition
s@EnableStageTransition' {} Text
a -> EnableStageTransition
s {$sel:stageName:EnableStageTransition' :: Text
stageName = Text
a} :: EnableStageTransition)
enableStageTransition_transitionType :: Lens.Lens' EnableStageTransition StageTransitionType
enableStageTransition_transitionType :: (StageTransitionType -> f StageTransitionType)
-> EnableStageTransition -> f EnableStageTransition
enableStageTransition_transitionType = (EnableStageTransition -> StageTransitionType)
-> (EnableStageTransition
-> StageTransitionType -> EnableStageTransition)
-> Lens
EnableStageTransition
EnableStageTransition
StageTransitionType
StageTransitionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableStageTransition' {StageTransitionType
transitionType :: StageTransitionType
$sel:transitionType:EnableStageTransition' :: EnableStageTransition -> StageTransitionType
transitionType} -> StageTransitionType
transitionType) (\s :: EnableStageTransition
s@EnableStageTransition' {} StageTransitionType
a -> EnableStageTransition
s {$sel:transitionType:EnableStageTransition' :: StageTransitionType
transitionType = StageTransitionType
a} :: EnableStageTransition)
instance Core.AWSRequest EnableStageTransition where
type
AWSResponse EnableStageTransition =
EnableStageTransitionResponse
request :: EnableStageTransition -> Request EnableStageTransition
request = Service -> EnableStageTransition -> Request EnableStageTransition
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy EnableStageTransition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse EnableStageTransition)))
response =
AWSResponse EnableStageTransition
-> Logger
-> Service
-> Proxy EnableStageTransition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse EnableStageTransition)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse EnableStageTransition
EnableStageTransitionResponse
EnableStageTransitionResponse'
instance Prelude.Hashable EnableStageTransition
instance Prelude.NFData EnableStageTransition
instance Core.ToHeaders EnableStageTransition where
toHeaders :: EnableStageTransition -> [Header]
toHeaders =
[Header] -> EnableStageTransition -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"CodePipeline_20150709.EnableStageTransition" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON EnableStageTransition where
toJSON :: EnableStageTransition -> Value
toJSON EnableStageTransition' {Text
StageTransitionType
transitionType :: StageTransitionType
stageName :: Text
pipelineName :: Text
$sel:transitionType:EnableStageTransition' :: EnableStageTransition -> StageTransitionType
$sel:stageName:EnableStageTransition' :: EnableStageTransition -> Text
$sel:pipelineName:EnableStageTransition' :: EnableStageTransition -> 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
"pipelineName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
pipelineName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"stageName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
stageName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"transitionType" Text -> StageTransitionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= StageTransitionType
transitionType)
]
)
instance Core.ToPath EnableStageTransition where
toPath :: EnableStageTransition -> ByteString
toPath = ByteString -> EnableStageTransition -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery EnableStageTransition where
toQuery :: EnableStageTransition -> QueryString
toQuery = QueryString -> EnableStageTransition -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data EnableStageTransitionResponse = EnableStageTransitionResponse'
{
}
deriving (EnableStageTransitionResponse
-> EnableStageTransitionResponse -> Bool
(EnableStageTransitionResponse
-> EnableStageTransitionResponse -> Bool)
-> (EnableStageTransitionResponse
-> EnableStageTransitionResponse -> Bool)
-> Eq EnableStageTransitionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableStageTransitionResponse
-> EnableStageTransitionResponse -> Bool
$c/= :: EnableStageTransitionResponse
-> EnableStageTransitionResponse -> Bool
== :: EnableStageTransitionResponse
-> EnableStageTransitionResponse -> Bool
$c== :: EnableStageTransitionResponse
-> EnableStageTransitionResponse -> Bool
Prelude.Eq, ReadPrec [EnableStageTransitionResponse]
ReadPrec EnableStageTransitionResponse
Int -> ReadS EnableStageTransitionResponse
ReadS [EnableStageTransitionResponse]
(Int -> ReadS EnableStageTransitionResponse)
-> ReadS [EnableStageTransitionResponse]
-> ReadPrec EnableStageTransitionResponse
-> ReadPrec [EnableStageTransitionResponse]
-> Read EnableStageTransitionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableStageTransitionResponse]
$creadListPrec :: ReadPrec [EnableStageTransitionResponse]
readPrec :: ReadPrec EnableStageTransitionResponse
$creadPrec :: ReadPrec EnableStageTransitionResponse
readList :: ReadS [EnableStageTransitionResponse]
$creadList :: ReadS [EnableStageTransitionResponse]
readsPrec :: Int -> ReadS EnableStageTransitionResponse
$creadsPrec :: Int -> ReadS EnableStageTransitionResponse
Prelude.Read, Int -> EnableStageTransitionResponse -> ShowS
[EnableStageTransitionResponse] -> ShowS
EnableStageTransitionResponse -> String
(Int -> EnableStageTransitionResponse -> ShowS)
-> (EnableStageTransitionResponse -> String)
-> ([EnableStageTransitionResponse] -> ShowS)
-> Show EnableStageTransitionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableStageTransitionResponse] -> ShowS
$cshowList :: [EnableStageTransitionResponse] -> ShowS
show :: EnableStageTransitionResponse -> String
$cshow :: EnableStageTransitionResponse -> String
showsPrec :: Int -> EnableStageTransitionResponse -> ShowS
$cshowsPrec :: Int -> EnableStageTransitionResponse -> ShowS
Prelude.Show, (forall x.
EnableStageTransitionResponse
-> Rep EnableStageTransitionResponse x)
-> (forall x.
Rep EnableStageTransitionResponse x
-> EnableStageTransitionResponse)
-> Generic EnableStageTransitionResponse
forall x.
Rep EnableStageTransitionResponse x
-> EnableStageTransitionResponse
forall x.
EnableStageTransitionResponse
-> Rep EnableStageTransitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EnableStageTransitionResponse x
-> EnableStageTransitionResponse
$cfrom :: forall x.
EnableStageTransitionResponse
-> Rep EnableStageTransitionResponse x
Prelude.Generic)
newEnableStageTransitionResponse ::
EnableStageTransitionResponse
newEnableStageTransitionResponse :: EnableStageTransitionResponse
newEnableStageTransitionResponse =
EnableStageTransitionResponse
EnableStageTransitionResponse'
instance Prelude.NFData EnableStageTransitionResponse