{-# 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.PutActionRevision
(
PutActionRevision (..),
newPutActionRevision,
putActionRevision_pipelineName,
putActionRevision_stageName,
putActionRevision_actionName,
putActionRevision_actionRevision,
PutActionRevisionResponse (..),
newPutActionRevisionResponse,
putActionRevisionResponse_newRevision,
putActionRevisionResponse_pipelineExecutionId,
putActionRevisionResponse_httpStatus,
)
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 PutActionRevision = PutActionRevision'
{
PutActionRevision -> Text
pipelineName :: Prelude.Text,
PutActionRevision -> Text
stageName :: Prelude.Text,
PutActionRevision -> Text
actionName :: Prelude.Text,
PutActionRevision -> ActionRevision
actionRevision :: ActionRevision
}
deriving (PutActionRevision -> PutActionRevision -> Bool
(PutActionRevision -> PutActionRevision -> Bool)
-> (PutActionRevision -> PutActionRevision -> Bool)
-> Eq PutActionRevision
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutActionRevision -> PutActionRevision -> Bool
$c/= :: PutActionRevision -> PutActionRevision -> Bool
== :: PutActionRevision -> PutActionRevision -> Bool
$c== :: PutActionRevision -> PutActionRevision -> Bool
Prelude.Eq, ReadPrec [PutActionRevision]
ReadPrec PutActionRevision
Int -> ReadS PutActionRevision
ReadS [PutActionRevision]
(Int -> ReadS PutActionRevision)
-> ReadS [PutActionRevision]
-> ReadPrec PutActionRevision
-> ReadPrec [PutActionRevision]
-> Read PutActionRevision
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutActionRevision]
$creadListPrec :: ReadPrec [PutActionRevision]
readPrec :: ReadPrec PutActionRevision
$creadPrec :: ReadPrec PutActionRevision
readList :: ReadS [PutActionRevision]
$creadList :: ReadS [PutActionRevision]
readsPrec :: Int -> ReadS PutActionRevision
$creadsPrec :: Int -> ReadS PutActionRevision
Prelude.Read, Int -> PutActionRevision -> ShowS
[PutActionRevision] -> ShowS
PutActionRevision -> String
(Int -> PutActionRevision -> ShowS)
-> (PutActionRevision -> String)
-> ([PutActionRevision] -> ShowS)
-> Show PutActionRevision
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutActionRevision] -> ShowS
$cshowList :: [PutActionRevision] -> ShowS
show :: PutActionRevision -> String
$cshow :: PutActionRevision -> String
showsPrec :: Int -> PutActionRevision -> ShowS
$cshowsPrec :: Int -> PutActionRevision -> ShowS
Prelude.Show, (forall x. PutActionRevision -> Rep PutActionRevision x)
-> (forall x. Rep PutActionRevision x -> PutActionRevision)
-> Generic PutActionRevision
forall x. Rep PutActionRevision x -> PutActionRevision
forall x. PutActionRevision -> Rep PutActionRevision x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutActionRevision x -> PutActionRevision
$cfrom :: forall x. PutActionRevision -> Rep PutActionRevision x
Prelude.Generic)
newPutActionRevision ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
ActionRevision ->
PutActionRevision
newPutActionRevision :: Text -> Text -> Text -> ActionRevision -> PutActionRevision
newPutActionRevision
Text
pPipelineName_
Text
pStageName_
Text
pActionName_
ActionRevision
pActionRevision_ =
PutActionRevision' :: Text -> Text -> Text -> ActionRevision -> PutActionRevision
PutActionRevision'
{ $sel:pipelineName:PutActionRevision' :: Text
pipelineName = Text
pPipelineName_,
$sel:stageName:PutActionRevision' :: Text
stageName = Text
pStageName_,
$sel:actionName:PutActionRevision' :: Text
actionName = Text
pActionName_,
$sel:actionRevision:PutActionRevision' :: ActionRevision
actionRevision = ActionRevision
pActionRevision_
}
putActionRevision_pipelineName :: Lens.Lens' PutActionRevision Prelude.Text
putActionRevision_pipelineName :: (Text -> f Text) -> PutActionRevision -> f PutActionRevision
putActionRevision_pipelineName = (PutActionRevision -> Text)
-> (PutActionRevision -> Text -> PutActionRevision)
-> Lens PutActionRevision PutActionRevision Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutActionRevision' {Text
pipelineName :: Text
$sel:pipelineName:PutActionRevision' :: PutActionRevision -> Text
pipelineName} -> Text
pipelineName) (\s :: PutActionRevision
s@PutActionRevision' {} Text
a -> PutActionRevision
s {$sel:pipelineName:PutActionRevision' :: Text
pipelineName = Text
a} :: PutActionRevision)
putActionRevision_stageName :: Lens.Lens' PutActionRevision Prelude.Text
putActionRevision_stageName :: (Text -> f Text) -> PutActionRevision -> f PutActionRevision
putActionRevision_stageName = (PutActionRevision -> Text)
-> (PutActionRevision -> Text -> PutActionRevision)
-> Lens PutActionRevision PutActionRevision Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutActionRevision' {Text
stageName :: Text
$sel:stageName:PutActionRevision' :: PutActionRevision -> Text
stageName} -> Text
stageName) (\s :: PutActionRevision
s@PutActionRevision' {} Text
a -> PutActionRevision
s {$sel:stageName:PutActionRevision' :: Text
stageName = Text
a} :: PutActionRevision)
putActionRevision_actionName :: Lens.Lens' PutActionRevision Prelude.Text
putActionRevision_actionName :: (Text -> f Text) -> PutActionRevision -> f PutActionRevision
putActionRevision_actionName = (PutActionRevision -> Text)
-> (PutActionRevision -> Text -> PutActionRevision)
-> Lens PutActionRevision PutActionRevision Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutActionRevision' {Text
actionName :: Text
$sel:actionName:PutActionRevision' :: PutActionRevision -> Text
actionName} -> Text
actionName) (\s :: PutActionRevision
s@PutActionRevision' {} Text
a -> PutActionRevision
s {$sel:actionName:PutActionRevision' :: Text
actionName = Text
a} :: PutActionRevision)
putActionRevision_actionRevision :: Lens.Lens' PutActionRevision ActionRevision
putActionRevision_actionRevision :: (ActionRevision -> f ActionRevision)
-> PutActionRevision -> f PutActionRevision
putActionRevision_actionRevision = (PutActionRevision -> ActionRevision)
-> (PutActionRevision -> ActionRevision -> PutActionRevision)
-> Lens
PutActionRevision PutActionRevision ActionRevision ActionRevision
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutActionRevision' {ActionRevision
actionRevision :: ActionRevision
$sel:actionRevision:PutActionRevision' :: PutActionRevision -> ActionRevision
actionRevision} -> ActionRevision
actionRevision) (\s :: PutActionRevision
s@PutActionRevision' {} ActionRevision
a -> PutActionRevision
s {$sel:actionRevision:PutActionRevision' :: ActionRevision
actionRevision = ActionRevision
a} :: PutActionRevision)
instance Core.AWSRequest PutActionRevision where
type
AWSResponse PutActionRevision =
PutActionRevisionResponse
request :: PutActionRevision -> Request PutActionRevision
request = Service -> PutActionRevision -> Request PutActionRevision
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutActionRevision
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutActionRevision)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse PutActionRevision))
-> Logger
-> Service
-> Proxy PutActionRevision
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutActionRevision)))
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 Bool -> Maybe Text -> Int -> PutActionRevisionResponse
PutActionRevisionResponse'
(Maybe Bool -> Maybe Text -> Int -> PutActionRevisionResponse)
-> Either String (Maybe Bool)
-> Either String (Maybe Text -> Int -> PutActionRevisionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"newRevision")
Either String (Maybe Text -> Int -> PutActionRevisionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> PutActionRevisionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"pipelineExecutionId")
Either String (Int -> PutActionRevisionResponse)
-> Either String Int -> Either String PutActionRevisionResponse
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 PutActionRevision
instance Prelude.NFData PutActionRevision
instance Core.ToHeaders PutActionRevision where
toHeaders :: PutActionRevision -> ResponseHeaders
toHeaders =
ResponseHeaders -> PutActionRevision -> 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
"CodePipeline_20150709.PutActionRevision" ::
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 PutActionRevision where
toJSON :: PutActionRevision -> Value
toJSON PutActionRevision' {Text
ActionRevision
actionRevision :: ActionRevision
actionName :: Text
stageName :: Text
pipelineName :: Text
$sel:actionRevision:PutActionRevision' :: PutActionRevision -> ActionRevision
$sel:actionName:PutActionRevision' :: PutActionRevision -> Text
$sel:stageName:PutActionRevision' :: PutActionRevision -> Text
$sel:pipelineName:PutActionRevision' :: PutActionRevision -> 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
"actionName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
actionName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"actionRevision" Text -> ActionRevision -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ActionRevision
actionRevision)
]
)
instance Core.ToPath PutActionRevision where
toPath :: PutActionRevision -> ByteString
toPath = ByteString -> PutActionRevision -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutActionRevision where
toQuery :: PutActionRevision -> QueryString
toQuery = QueryString -> PutActionRevision -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutActionRevisionResponse = PutActionRevisionResponse'
{
PutActionRevisionResponse -> Maybe Bool
newRevision' :: Prelude.Maybe Prelude.Bool,
PutActionRevisionResponse -> Maybe Text
pipelineExecutionId :: Prelude.Maybe Prelude.Text,
PutActionRevisionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutActionRevisionResponse -> PutActionRevisionResponse -> Bool
(PutActionRevisionResponse -> PutActionRevisionResponse -> Bool)
-> (PutActionRevisionResponse -> PutActionRevisionResponse -> Bool)
-> Eq PutActionRevisionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutActionRevisionResponse -> PutActionRevisionResponse -> Bool
$c/= :: PutActionRevisionResponse -> PutActionRevisionResponse -> Bool
== :: PutActionRevisionResponse -> PutActionRevisionResponse -> Bool
$c== :: PutActionRevisionResponse -> PutActionRevisionResponse -> Bool
Prelude.Eq, ReadPrec [PutActionRevisionResponse]
ReadPrec PutActionRevisionResponse
Int -> ReadS PutActionRevisionResponse
ReadS [PutActionRevisionResponse]
(Int -> ReadS PutActionRevisionResponse)
-> ReadS [PutActionRevisionResponse]
-> ReadPrec PutActionRevisionResponse
-> ReadPrec [PutActionRevisionResponse]
-> Read PutActionRevisionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutActionRevisionResponse]
$creadListPrec :: ReadPrec [PutActionRevisionResponse]
readPrec :: ReadPrec PutActionRevisionResponse
$creadPrec :: ReadPrec PutActionRevisionResponse
readList :: ReadS [PutActionRevisionResponse]
$creadList :: ReadS [PutActionRevisionResponse]
readsPrec :: Int -> ReadS PutActionRevisionResponse
$creadsPrec :: Int -> ReadS PutActionRevisionResponse
Prelude.Read, Int -> PutActionRevisionResponse -> ShowS
[PutActionRevisionResponse] -> ShowS
PutActionRevisionResponse -> String
(Int -> PutActionRevisionResponse -> ShowS)
-> (PutActionRevisionResponse -> String)
-> ([PutActionRevisionResponse] -> ShowS)
-> Show PutActionRevisionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutActionRevisionResponse] -> ShowS
$cshowList :: [PutActionRevisionResponse] -> ShowS
show :: PutActionRevisionResponse -> String
$cshow :: PutActionRevisionResponse -> String
showsPrec :: Int -> PutActionRevisionResponse -> ShowS
$cshowsPrec :: Int -> PutActionRevisionResponse -> ShowS
Prelude.Show, (forall x.
PutActionRevisionResponse -> Rep PutActionRevisionResponse x)
-> (forall x.
Rep PutActionRevisionResponse x -> PutActionRevisionResponse)
-> Generic PutActionRevisionResponse
forall x.
Rep PutActionRevisionResponse x -> PutActionRevisionResponse
forall x.
PutActionRevisionResponse -> Rep PutActionRevisionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutActionRevisionResponse x -> PutActionRevisionResponse
$cfrom :: forall x.
PutActionRevisionResponse -> Rep PutActionRevisionResponse x
Prelude.Generic)
newPutActionRevisionResponse ::
Prelude.Int ->
PutActionRevisionResponse
newPutActionRevisionResponse :: Int -> PutActionRevisionResponse
newPutActionRevisionResponse Int
pHttpStatus_ =
PutActionRevisionResponse' :: Maybe Bool -> Maybe Text -> Int -> PutActionRevisionResponse
PutActionRevisionResponse'
{ $sel:newRevision':PutActionRevisionResponse' :: Maybe Bool
newRevision' =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:pipelineExecutionId:PutActionRevisionResponse' :: Maybe Text
pipelineExecutionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PutActionRevisionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
putActionRevisionResponse_newRevision :: Lens.Lens' PutActionRevisionResponse (Prelude.Maybe Prelude.Bool)
putActionRevisionResponse_newRevision :: (Maybe Bool -> f (Maybe Bool))
-> PutActionRevisionResponse -> f PutActionRevisionResponse
putActionRevisionResponse_newRevision = (PutActionRevisionResponse -> Maybe Bool)
-> (PutActionRevisionResponse
-> Maybe Bool -> PutActionRevisionResponse)
-> Lens
PutActionRevisionResponse
PutActionRevisionResponse
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutActionRevisionResponse' {Maybe Bool
newRevision' :: Maybe Bool
$sel:newRevision':PutActionRevisionResponse' :: PutActionRevisionResponse -> Maybe Bool
newRevision'} -> Maybe Bool
newRevision') (\s :: PutActionRevisionResponse
s@PutActionRevisionResponse' {} Maybe Bool
a -> PutActionRevisionResponse
s {$sel:newRevision':PutActionRevisionResponse' :: Maybe Bool
newRevision' = Maybe Bool
a} :: PutActionRevisionResponse)
putActionRevisionResponse_pipelineExecutionId :: Lens.Lens' PutActionRevisionResponse (Prelude.Maybe Prelude.Text)
putActionRevisionResponse_pipelineExecutionId :: (Maybe Text -> f (Maybe Text))
-> PutActionRevisionResponse -> f PutActionRevisionResponse
putActionRevisionResponse_pipelineExecutionId = (PutActionRevisionResponse -> Maybe Text)
-> (PutActionRevisionResponse
-> Maybe Text -> PutActionRevisionResponse)
-> Lens
PutActionRevisionResponse
PutActionRevisionResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutActionRevisionResponse' {Maybe Text
pipelineExecutionId :: Maybe Text
$sel:pipelineExecutionId:PutActionRevisionResponse' :: PutActionRevisionResponse -> Maybe Text
pipelineExecutionId} -> Maybe Text
pipelineExecutionId) (\s :: PutActionRevisionResponse
s@PutActionRevisionResponse' {} Maybe Text
a -> PutActionRevisionResponse
s {$sel:pipelineExecutionId:PutActionRevisionResponse' :: Maybe Text
pipelineExecutionId = Maybe Text
a} :: PutActionRevisionResponse)
putActionRevisionResponse_httpStatus :: Lens.Lens' PutActionRevisionResponse Prelude.Int
putActionRevisionResponse_httpStatus :: (Int -> f Int)
-> PutActionRevisionResponse -> f PutActionRevisionResponse
putActionRevisionResponse_httpStatus = (PutActionRevisionResponse -> Int)
-> (PutActionRevisionResponse -> Int -> PutActionRevisionResponse)
-> Lens PutActionRevisionResponse PutActionRevisionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutActionRevisionResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutActionRevisionResponse' :: PutActionRevisionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutActionRevisionResponse
s@PutActionRevisionResponse' {} Int
a -> PutActionRevisionResponse
s {$sel:httpStatus:PutActionRevisionResponse' :: Int
httpStatus = Int
a} :: PutActionRevisionResponse)
instance Prelude.NFData PutActionRevisionResponse