{-# 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.CodeCommit.UpdatePullRequestDescription
(
UpdatePullRequestDescription (..),
newUpdatePullRequestDescription,
updatePullRequestDescription_pullRequestId,
updatePullRequestDescription_description,
UpdatePullRequestDescriptionResponse (..),
newUpdatePullRequestDescriptionResponse,
updatePullRequestDescriptionResponse_httpStatus,
updatePullRequestDescriptionResponse_pullRequest,
)
where
import Amazonka.CodeCommit.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 UpdatePullRequestDescription = UpdatePullRequestDescription'
{
UpdatePullRequestDescription -> Text
pullRequestId :: Prelude.Text,
UpdatePullRequestDescription -> Text
description :: Prelude.Text
}
deriving (UpdatePullRequestDescription
-> UpdatePullRequestDescription -> Bool
(UpdatePullRequestDescription
-> UpdatePullRequestDescription -> Bool)
-> (UpdatePullRequestDescription
-> UpdatePullRequestDescription -> Bool)
-> Eq UpdatePullRequestDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdatePullRequestDescription
-> UpdatePullRequestDescription -> Bool
$c/= :: UpdatePullRequestDescription
-> UpdatePullRequestDescription -> Bool
== :: UpdatePullRequestDescription
-> UpdatePullRequestDescription -> Bool
$c== :: UpdatePullRequestDescription
-> UpdatePullRequestDescription -> Bool
Prelude.Eq, ReadPrec [UpdatePullRequestDescription]
ReadPrec UpdatePullRequestDescription
Int -> ReadS UpdatePullRequestDescription
ReadS [UpdatePullRequestDescription]
(Int -> ReadS UpdatePullRequestDescription)
-> ReadS [UpdatePullRequestDescription]
-> ReadPrec UpdatePullRequestDescription
-> ReadPrec [UpdatePullRequestDescription]
-> Read UpdatePullRequestDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdatePullRequestDescription]
$creadListPrec :: ReadPrec [UpdatePullRequestDescription]
readPrec :: ReadPrec UpdatePullRequestDescription
$creadPrec :: ReadPrec UpdatePullRequestDescription
readList :: ReadS [UpdatePullRequestDescription]
$creadList :: ReadS [UpdatePullRequestDescription]
readsPrec :: Int -> ReadS UpdatePullRequestDescription
$creadsPrec :: Int -> ReadS UpdatePullRequestDescription
Prelude.Read, Int -> UpdatePullRequestDescription -> ShowS
[UpdatePullRequestDescription] -> ShowS
UpdatePullRequestDescription -> String
(Int -> UpdatePullRequestDescription -> ShowS)
-> (UpdatePullRequestDescription -> String)
-> ([UpdatePullRequestDescription] -> ShowS)
-> Show UpdatePullRequestDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdatePullRequestDescription] -> ShowS
$cshowList :: [UpdatePullRequestDescription] -> ShowS
show :: UpdatePullRequestDescription -> String
$cshow :: UpdatePullRequestDescription -> String
showsPrec :: Int -> UpdatePullRequestDescription -> ShowS
$cshowsPrec :: Int -> UpdatePullRequestDescription -> ShowS
Prelude.Show, (forall x.
UpdatePullRequestDescription -> Rep UpdatePullRequestDescription x)
-> (forall x.
Rep UpdatePullRequestDescription x -> UpdatePullRequestDescription)
-> Generic UpdatePullRequestDescription
forall x.
Rep UpdatePullRequestDescription x -> UpdatePullRequestDescription
forall x.
UpdatePullRequestDescription -> Rep UpdatePullRequestDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdatePullRequestDescription x -> UpdatePullRequestDescription
$cfrom :: forall x.
UpdatePullRequestDescription -> Rep UpdatePullRequestDescription x
Prelude.Generic)
newUpdatePullRequestDescription ::
Prelude.Text ->
Prelude.Text ->
UpdatePullRequestDescription
newUpdatePullRequestDescription :: Text -> Text -> UpdatePullRequestDescription
newUpdatePullRequestDescription
Text
pPullRequestId_
Text
pDescription_ =
UpdatePullRequestDescription' :: Text -> Text -> UpdatePullRequestDescription
UpdatePullRequestDescription'
{ $sel:pullRequestId:UpdatePullRequestDescription' :: Text
pullRequestId =
Text
pPullRequestId_,
$sel:description:UpdatePullRequestDescription' :: Text
description = Text
pDescription_
}
updatePullRequestDescription_pullRequestId :: Lens.Lens' UpdatePullRequestDescription Prelude.Text
updatePullRequestDescription_pullRequestId :: (Text -> f Text)
-> UpdatePullRequestDescription -> f UpdatePullRequestDescription
updatePullRequestDescription_pullRequestId = (UpdatePullRequestDescription -> Text)
-> (UpdatePullRequestDescription
-> Text -> UpdatePullRequestDescription)
-> Lens
UpdatePullRequestDescription UpdatePullRequestDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePullRequestDescription' {Text
pullRequestId :: Text
$sel:pullRequestId:UpdatePullRequestDescription' :: UpdatePullRequestDescription -> Text
pullRequestId} -> Text
pullRequestId) (\s :: UpdatePullRequestDescription
s@UpdatePullRequestDescription' {} Text
a -> UpdatePullRequestDescription
s {$sel:pullRequestId:UpdatePullRequestDescription' :: Text
pullRequestId = Text
a} :: UpdatePullRequestDescription)
updatePullRequestDescription_description :: Lens.Lens' UpdatePullRequestDescription Prelude.Text
updatePullRequestDescription_description :: (Text -> f Text)
-> UpdatePullRequestDescription -> f UpdatePullRequestDescription
updatePullRequestDescription_description = (UpdatePullRequestDescription -> Text)
-> (UpdatePullRequestDescription
-> Text -> UpdatePullRequestDescription)
-> Lens
UpdatePullRequestDescription UpdatePullRequestDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePullRequestDescription' {Text
description :: Text
$sel:description:UpdatePullRequestDescription' :: UpdatePullRequestDescription -> Text
description} -> Text
description) (\s :: UpdatePullRequestDescription
s@UpdatePullRequestDescription' {} Text
a -> UpdatePullRequestDescription
s {$sel:description:UpdatePullRequestDescription' :: Text
description = Text
a} :: UpdatePullRequestDescription)
instance Core.AWSRequest UpdatePullRequestDescription where
type
AWSResponse UpdatePullRequestDescription =
UpdatePullRequestDescriptionResponse
request :: UpdatePullRequestDescription
-> Request UpdatePullRequestDescription
request = Service
-> UpdatePullRequestDescription
-> Request UpdatePullRequestDescription
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdatePullRequestDescription
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdatePullRequestDescription)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdatePullRequestDescription))
-> Logger
-> Service
-> Proxy UpdatePullRequestDescription
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdatePullRequestDescription)))
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 ->
Int -> PullRequest -> UpdatePullRequestDescriptionResponse
UpdatePullRequestDescriptionResponse'
(Int -> PullRequest -> UpdatePullRequestDescriptionResponse)
-> Either String Int
-> Either
String (PullRequest -> UpdatePullRequestDescriptionResponse)
forall (f :: * -> *) a b. Functor 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))
Either String (PullRequest -> UpdatePullRequestDescriptionResponse)
-> Either String PullRequest
-> Either String UpdatePullRequestDescriptionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String PullRequest
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"pullRequest")
)
instance
Prelude.Hashable
UpdatePullRequestDescription
instance Prelude.NFData UpdatePullRequestDescription
instance Core.ToHeaders UpdatePullRequestDescription where
toHeaders :: UpdatePullRequestDescription -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdatePullRequestDescription -> 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
"CodeCommit_20150413.UpdatePullRequestDescription" ::
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 UpdatePullRequestDescription where
toJSON :: UpdatePullRequestDescription -> Value
toJSON UpdatePullRequestDescription' {Text
description :: Text
pullRequestId :: Text
$sel:description:UpdatePullRequestDescription' :: UpdatePullRequestDescription -> Text
$sel:pullRequestId:UpdatePullRequestDescription' :: UpdatePullRequestDescription -> 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
"pullRequestId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
pullRequestId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
description)
]
)
instance Core.ToPath UpdatePullRequestDescription where
toPath :: UpdatePullRequestDescription -> ByteString
toPath = ByteString -> UpdatePullRequestDescription -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdatePullRequestDescription where
toQuery :: UpdatePullRequestDescription -> QueryString
toQuery = QueryString -> UpdatePullRequestDescription -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdatePullRequestDescriptionResponse = UpdatePullRequestDescriptionResponse'
{
UpdatePullRequestDescriptionResponse -> Int
httpStatus :: Prelude.Int,
UpdatePullRequestDescriptionResponse -> PullRequest
pullRequest :: PullRequest
}
deriving (UpdatePullRequestDescriptionResponse
-> UpdatePullRequestDescriptionResponse -> Bool
(UpdatePullRequestDescriptionResponse
-> UpdatePullRequestDescriptionResponse -> Bool)
-> (UpdatePullRequestDescriptionResponse
-> UpdatePullRequestDescriptionResponse -> Bool)
-> Eq UpdatePullRequestDescriptionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdatePullRequestDescriptionResponse
-> UpdatePullRequestDescriptionResponse -> Bool
$c/= :: UpdatePullRequestDescriptionResponse
-> UpdatePullRequestDescriptionResponse -> Bool
== :: UpdatePullRequestDescriptionResponse
-> UpdatePullRequestDescriptionResponse -> Bool
$c== :: UpdatePullRequestDescriptionResponse
-> UpdatePullRequestDescriptionResponse -> Bool
Prelude.Eq, ReadPrec [UpdatePullRequestDescriptionResponse]
ReadPrec UpdatePullRequestDescriptionResponse
Int -> ReadS UpdatePullRequestDescriptionResponse
ReadS [UpdatePullRequestDescriptionResponse]
(Int -> ReadS UpdatePullRequestDescriptionResponse)
-> ReadS [UpdatePullRequestDescriptionResponse]
-> ReadPrec UpdatePullRequestDescriptionResponse
-> ReadPrec [UpdatePullRequestDescriptionResponse]
-> Read UpdatePullRequestDescriptionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdatePullRequestDescriptionResponse]
$creadListPrec :: ReadPrec [UpdatePullRequestDescriptionResponse]
readPrec :: ReadPrec UpdatePullRequestDescriptionResponse
$creadPrec :: ReadPrec UpdatePullRequestDescriptionResponse
readList :: ReadS [UpdatePullRequestDescriptionResponse]
$creadList :: ReadS [UpdatePullRequestDescriptionResponse]
readsPrec :: Int -> ReadS UpdatePullRequestDescriptionResponse
$creadsPrec :: Int -> ReadS UpdatePullRequestDescriptionResponse
Prelude.Read, Int -> UpdatePullRequestDescriptionResponse -> ShowS
[UpdatePullRequestDescriptionResponse] -> ShowS
UpdatePullRequestDescriptionResponse -> String
(Int -> UpdatePullRequestDescriptionResponse -> ShowS)
-> (UpdatePullRequestDescriptionResponse -> String)
-> ([UpdatePullRequestDescriptionResponse] -> ShowS)
-> Show UpdatePullRequestDescriptionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdatePullRequestDescriptionResponse] -> ShowS
$cshowList :: [UpdatePullRequestDescriptionResponse] -> ShowS
show :: UpdatePullRequestDescriptionResponse -> String
$cshow :: UpdatePullRequestDescriptionResponse -> String
showsPrec :: Int -> UpdatePullRequestDescriptionResponse -> ShowS
$cshowsPrec :: Int -> UpdatePullRequestDescriptionResponse -> ShowS
Prelude.Show, (forall x.
UpdatePullRequestDescriptionResponse
-> Rep UpdatePullRequestDescriptionResponse x)
-> (forall x.
Rep UpdatePullRequestDescriptionResponse x
-> UpdatePullRequestDescriptionResponse)
-> Generic UpdatePullRequestDescriptionResponse
forall x.
Rep UpdatePullRequestDescriptionResponse x
-> UpdatePullRequestDescriptionResponse
forall x.
UpdatePullRequestDescriptionResponse
-> Rep UpdatePullRequestDescriptionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdatePullRequestDescriptionResponse x
-> UpdatePullRequestDescriptionResponse
$cfrom :: forall x.
UpdatePullRequestDescriptionResponse
-> Rep UpdatePullRequestDescriptionResponse x
Prelude.Generic)
newUpdatePullRequestDescriptionResponse ::
Prelude.Int ->
PullRequest ->
UpdatePullRequestDescriptionResponse
newUpdatePullRequestDescriptionResponse :: Int -> PullRequest -> UpdatePullRequestDescriptionResponse
newUpdatePullRequestDescriptionResponse
Int
pHttpStatus_
PullRequest
pPullRequest_ =
UpdatePullRequestDescriptionResponse' :: Int -> PullRequest -> UpdatePullRequestDescriptionResponse
UpdatePullRequestDescriptionResponse'
{ $sel:httpStatus:UpdatePullRequestDescriptionResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:pullRequest:UpdatePullRequestDescriptionResponse' :: PullRequest
pullRequest = PullRequest
pPullRequest_
}
updatePullRequestDescriptionResponse_httpStatus :: Lens.Lens' UpdatePullRequestDescriptionResponse Prelude.Int
updatePullRequestDescriptionResponse_httpStatus :: (Int -> f Int)
-> UpdatePullRequestDescriptionResponse
-> f UpdatePullRequestDescriptionResponse
updatePullRequestDescriptionResponse_httpStatus = (UpdatePullRequestDescriptionResponse -> Int)
-> (UpdatePullRequestDescriptionResponse
-> Int -> UpdatePullRequestDescriptionResponse)
-> Lens
UpdatePullRequestDescriptionResponse
UpdatePullRequestDescriptionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePullRequestDescriptionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdatePullRequestDescriptionResponse' :: UpdatePullRequestDescriptionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdatePullRequestDescriptionResponse
s@UpdatePullRequestDescriptionResponse' {} Int
a -> UpdatePullRequestDescriptionResponse
s {$sel:httpStatus:UpdatePullRequestDescriptionResponse' :: Int
httpStatus = Int
a} :: UpdatePullRequestDescriptionResponse)
updatePullRequestDescriptionResponse_pullRequest :: Lens.Lens' UpdatePullRequestDescriptionResponse PullRequest
updatePullRequestDescriptionResponse_pullRequest :: (PullRequest -> f PullRequest)
-> UpdatePullRequestDescriptionResponse
-> f UpdatePullRequestDescriptionResponse
updatePullRequestDescriptionResponse_pullRequest = (UpdatePullRequestDescriptionResponse -> PullRequest)
-> (UpdatePullRequestDescriptionResponse
-> PullRequest -> UpdatePullRequestDescriptionResponse)
-> Lens
UpdatePullRequestDescriptionResponse
UpdatePullRequestDescriptionResponse
PullRequest
PullRequest
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePullRequestDescriptionResponse' {PullRequest
pullRequest :: PullRequest
$sel:pullRequest:UpdatePullRequestDescriptionResponse' :: UpdatePullRequestDescriptionResponse -> PullRequest
pullRequest} -> PullRequest
pullRequest) (\s :: UpdatePullRequestDescriptionResponse
s@UpdatePullRequestDescriptionResponse' {} PullRequest
a -> UpdatePullRequestDescriptionResponse
s {$sel:pullRequest:UpdatePullRequestDescriptionResponse' :: PullRequest
pullRequest = PullRequest
a} :: UpdatePullRequestDescriptionResponse)
instance
Prelude.NFData
UpdatePullRequestDescriptionResponse