{-# 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.DisableStageTransition
(
DisableStageTransition (..),
newDisableStageTransition,
disableStageTransition_pipelineName,
disableStageTransition_stageName,
disableStageTransition_transitionType,
disableStageTransition_reason,
DisableStageTransitionResponse (..),
newDisableStageTransitionResponse,
)
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 DisableStageTransition = DisableStageTransition'
{
DisableStageTransition -> Text
pipelineName :: Prelude.Text,
DisableStageTransition -> Text
stageName :: Prelude.Text,
DisableStageTransition -> StageTransitionType
transitionType :: StageTransitionType,
DisableStageTransition -> Text
reason :: Prelude.Text
}
deriving (DisableStageTransition -> DisableStageTransition -> Bool
(DisableStageTransition -> DisableStageTransition -> Bool)
-> (DisableStageTransition -> DisableStageTransition -> Bool)
-> Eq DisableStageTransition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisableStageTransition -> DisableStageTransition -> Bool
$c/= :: DisableStageTransition -> DisableStageTransition -> Bool
== :: DisableStageTransition -> DisableStageTransition -> Bool
$c== :: DisableStageTransition -> DisableStageTransition -> Bool
Prelude.Eq, ReadPrec [DisableStageTransition]
ReadPrec DisableStageTransition
Int -> ReadS DisableStageTransition
ReadS [DisableStageTransition]
(Int -> ReadS DisableStageTransition)
-> ReadS [DisableStageTransition]
-> ReadPrec DisableStageTransition
-> ReadPrec [DisableStageTransition]
-> Read DisableStageTransition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisableStageTransition]
$creadListPrec :: ReadPrec [DisableStageTransition]
readPrec :: ReadPrec DisableStageTransition
$creadPrec :: ReadPrec DisableStageTransition
readList :: ReadS [DisableStageTransition]
$creadList :: ReadS [DisableStageTransition]
readsPrec :: Int -> ReadS DisableStageTransition
$creadsPrec :: Int -> ReadS DisableStageTransition
Prelude.Read, Int -> DisableStageTransition -> ShowS
[DisableStageTransition] -> ShowS
DisableStageTransition -> String
(Int -> DisableStageTransition -> ShowS)
-> (DisableStageTransition -> String)
-> ([DisableStageTransition] -> ShowS)
-> Show DisableStageTransition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisableStageTransition] -> ShowS
$cshowList :: [DisableStageTransition] -> ShowS
show :: DisableStageTransition -> String
$cshow :: DisableStageTransition -> String
showsPrec :: Int -> DisableStageTransition -> ShowS
$cshowsPrec :: Int -> DisableStageTransition -> ShowS
Prelude.Show, (forall x. DisableStageTransition -> Rep DisableStageTransition x)
-> (forall x.
Rep DisableStageTransition x -> DisableStageTransition)
-> Generic DisableStageTransition
forall x. Rep DisableStageTransition x -> DisableStageTransition
forall x. DisableStageTransition -> Rep DisableStageTransition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisableStageTransition x -> DisableStageTransition
$cfrom :: forall x. DisableStageTransition -> Rep DisableStageTransition x
Prelude.Generic)
newDisableStageTransition ::
Prelude.Text ->
Prelude.Text ->
StageTransitionType ->
Prelude.Text ->
DisableStageTransition
newDisableStageTransition :: Text
-> Text -> StageTransitionType -> Text -> DisableStageTransition
newDisableStageTransition
Text
pPipelineName_
Text
pStageName_
StageTransitionType
pTransitionType_
Text
pReason_ =
DisableStageTransition' :: Text
-> Text -> StageTransitionType -> Text -> DisableStageTransition
DisableStageTransition'
{ $sel:pipelineName:DisableStageTransition' :: Text
pipelineName =
Text
pPipelineName_,
$sel:stageName:DisableStageTransition' :: Text
stageName = Text
pStageName_,
$sel:transitionType:DisableStageTransition' :: StageTransitionType
transitionType = StageTransitionType
pTransitionType_,
$sel:reason:DisableStageTransition' :: Text
reason = Text
pReason_
}
disableStageTransition_pipelineName :: Lens.Lens' DisableStageTransition Prelude.Text
disableStageTransition_pipelineName :: (Text -> f Text)
-> DisableStageTransition -> f DisableStageTransition
disableStageTransition_pipelineName = (DisableStageTransition -> Text)
-> (DisableStageTransition -> Text -> DisableStageTransition)
-> Lens DisableStageTransition DisableStageTransition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableStageTransition' {Text
pipelineName :: Text
$sel:pipelineName:DisableStageTransition' :: DisableStageTransition -> Text
pipelineName} -> Text
pipelineName) (\s :: DisableStageTransition
s@DisableStageTransition' {} Text
a -> DisableStageTransition
s {$sel:pipelineName:DisableStageTransition' :: Text
pipelineName = Text
a} :: DisableStageTransition)
disableStageTransition_stageName :: Lens.Lens' DisableStageTransition Prelude.Text
disableStageTransition_stageName :: (Text -> f Text)
-> DisableStageTransition -> f DisableStageTransition
disableStageTransition_stageName = (DisableStageTransition -> Text)
-> (DisableStageTransition -> Text -> DisableStageTransition)
-> Lens DisableStageTransition DisableStageTransition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableStageTransition' {Text
stageName :: Text
$sel:stageName:DisableStageTransition' :: DisableStageTransition -> Text
stageName} -> Text
stageName) (\s :: DisableStageTransition
s@DisableStageTransition' {} Text
a -> DisableStageTransition
s {$sel:stageName:DisableStageTransition' :: Text
stageName = Text
a} :: DisableStageTransition)
disableStageTransition_transitionType :: Lens.Lens' DisableStageTransition StageTransitionType
disableStageTransition_transitionType :: (StageTransitionType -> f StageTransitionType)
-> DisableStageTransition -> f DisableStageTransition
disableStageTransition_transitionType = (DisableStageTransition -> StageTransitionType)
-> (DisableStageTransition
-> StageTransitionType -> DisableStageTransition)
-> Lens
DisableStageTransition
DisableStageTransition
StageTransitionType
StageTransitionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableStageTransition' {StageTransitionType
transitionType :: StageTransitionType
$sel:transitionType:DisableStageTransition' :: DisableStageTransition -> StageTransitionType
transitionType} -> StageTransitionType
transitionType) (\s :: DisableStageTransition
s@DisableStageTransition' {} StageTransitionType
a -> DisableStageTransition
s {$sel:transitionType:DisableStageTransition' :: StageTransitionType
transitionType = StageTransitionType
a} :: DisableStageTransition)
disableStageTransition_reason :: Lens.Lens' DisableStageTransition Prelude.Text
disableStageTransition_reason :: (Text -> f Text)
-> DisableStageTransition -> f DisableStageTransition
disableStageTransition_reason = (DisableStageTransition -> Text)
-> (DisableStageTransition -> Text -> DisableStageTransition)
-> Lens DisableStageTransition DisableStageTransition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableStageTransition' {Text
reason :: Text
$sel:reason:DisableStageTransition' :: DisableStageTransition -> Text
reason} -> Text
reason) (\s :: DisableStageTransition
s@DisableStageTransition' {} Text
a -> DisableStageTransition
s {$sel:reason:DisableStageTransition' :: Text
reason = Text
a} :: DisableStageTransition)
instance Core.AWSRequest DisableStageTransition where
type
AWSResponse DisableStageTransition =
DisableStageTransitionResponse
request :: DisableStageTransition -> Request DisableStageTransition
request = Service -> DisableStageTransition -> Request DisableStageTransition
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DisableStageTransition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisableStageTransition)))
response =
AWSResponse DisableStageTransition
-> Logger
-> Service
-> Proxy DisableStageTransition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisableStageTransition)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse DisableStageTransition
DisableStageTransitionResponse
DisableStageTransitionResponse'
instance Prelude.Hashable DisableStageTransition
instance Prelude.NFData DisableStageTransition
instance Core.ToHeaders DisableStageTransition where
toHeaders :: DisableStageTransition -> [Header]
toHeaders =
[Header] -> DisableStageTransition -> [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.DisableStageTransition" ::
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 DisableStageTransition where
toJSON :: DisableStageTransition -> Value
toJSON DisableStageTransition' {Text
StageTransitionType
reason :: Text
transitionType :: StageTransitionType
stageName :: Text
pipelineName :: Text
$sel:reason:DisableStageTransition' :: DisableStageTransition -> Text
$sel:transitionType:DisableStageTransition' :: DisableStageTransition -> StageTransitionType
$sel:stageName:DisableStageTransition' :: DisableStageTransition -> Text
$sel:pipelineName:DisableStageTransition' :: DisableStageTransition -> 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),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"reason" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
reason)
]
)
instance Core.ToPath DisableStageTransition where
toPath :: DisableStageTransition -> ByteString
toPath = ByteString -> DisableStageTransition -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DisableStageTransition where
toQuery :: DisableStageTransition -> QueryString
toQuery = QueryString -> DisableStageTransition -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DisableStageTransitionResponse = DisableStageTransitionResponse'
{
}
deriving (DisableStageTransitionResponse
-> DisableStageTransitionResponse -> Bool
(DisableStageTransitionResponse
-> DisableStageTransitionResponse -> Bool)
-> (DisableStageTransitionResponse
-> DisableStageTransitionResponse -> Bool)
-> Eq DisableStageTransitionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisableStageTransitionResponse
-> DisableStageTransitionResponse -> Bool
$c/= :: DisableStageTransitionResponse
-> DisableStageTransitionResponse -> Bool
== :: DisableStageTransitionResponse
-> DisableStageTransitionResponse -> Bool
$c== :: DisableStageTransitionResponse
-> DisableStageTransitionResponse -> Bool
Prelude.Eq, ReadPrec [DisableStageTransitionResponse]
ReadPrec DisableStageTransitionResponse
Int -> ReadS DisableStageTransitionResponse
ReadS [DisableStageTransitionResponse]
(Int -> ReadS DisableStageTransitionResponse)
-> ReadS [DisableStageTransitionResponse]
-> ReadPrec DisableStageTransitionResponse
-> ReadPrec [DisableStageTransitionResponse]
-> Read DisableStageTransitionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisableStageTransitionResponse]
$creadListPrec :: ReadPrec [DisableStageTransitionResponse]
readPrec :: ReadPrec DisableStageTransitionResponse
$creadPrec :: ReadPrec DisableStageTransitionResponse
readList :: ReadS [DisableStageTransitionResponse]
$creadList :: ReadS [DisableStageTransitionResponse]
readsPrec :: Int -> ReadS DisableStageTransitionResponse
$creadsPrec :: Int -> ReadS DisableStageTransitionResponse
Prelude.Read, Int -> DisableStageTransitionResponse -> ShowS
[DisableStageTransitionResponse] -> ShowS
DisableStageTransitionResponse -> String
(Int -> DisableStageTransitionResponse -> ShowS)
-> (DisableStageTransitionResponse -> String)
-> ([DisableStageTransitionResponse] -> ShowS)
-> Show DisableStageTransitionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisableStageTransitionResponse] -> ShowS
$cshowList :: [DisableStageTransitionResponse] -> ShowS
show :: DisableStageTransitionResponse -> String
$cshow :: DisableStageTransitionResponse -> String
showsPrec :: Int -> DisableStageTransitionResponse -> ShowS
$cshowsPrec :: Int -> DisableStageTransitionResponse -> ShowS
Prelude.Show, (forall x.
DisableStageTransitionResponse
-> Rep DisableStageTransitionResponse x)
-> (forall x.
Rep DisableStageTransitionResponse x
-> DisableStageTransitionResponse)
-> Generic DisableStageTransitionResponse
forall x.
Rep DisableStageTransitionResponse x
-> DisableStageTransitionResponse
forall x.
DisableStageTransitionResponse
-> Rep DisableStageTransitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisableStageTransitionResponse x
-> DisableStageTransitionResponse
$cfrom :: forall x.
DisableStageTransitionResponse
-> Rep DisableStageTransitionResponse x
Prelude.Generic)
newDisableStageTransitionResponse ::
DisableStageTransitionResponse
newDisableStageTransitionResponse :: DisableStageTransitionResponse
newDisableStageTransitionResponse =
DisableStageTransitionResponse
DisableStageTransitionResponse'
instance
Prelude.NFData
DisableStageTransitionResponse