{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
{ $sel:pullRequestId:UpdatePullRequestDescription' :: Text
pullRequestId =
Text
pPullRequestId_,
$sel:description:UpdatePullRequestDescription' :: Text
description = Text
pDescription_
}
updatePullRequestDescription_pullRequestId :: Lens.Lens' UpdatePullRequestDescription Prelude.Text
updatePullRequestDescription_pullRequestId :: Lens' UpdatePullRequestDescription Text
updatePullRequestDescription_pullRequestId = 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 :: Lens' UpdatePullRequestDescription Text
updatePullRequestDescription_description = 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 :: (Service -> Service)
-> UpdatePullRequestDescription
-> Request UpdatePullRequestDescription
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 UpdatePullRequestDescription
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdatePullRequestDescription)))
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 ->
Int -> PullRequest -> UpdatePullRequestDescriptionResponse
UpdatePullRequestDescriptionResponse'
forall (f :: * -> *) a b. Functor 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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"pullRequest")
)
instance
Prelude.Hashable
UpdatePullRequestDescription
where
hashWithSalt :: Int -> UpdatePullRequestDescription -> Int
hashWithSalt Int
_salt UpdatePullRequestDescription' {Text
description :: Text
pullRequestId :: Text
$sel:description:UpdatePullRequestDescription' :: UpdatePullRequestDescription -> Text
$sel:pullRequestId:UpdatePullRequestDescription' :: UpdatePullRequestDescription -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
pullRequestId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
description
instance Prelude.NFData UpdatePullRequestDescription where
rnf :: UpdatePullRequestDescription -> ()
rnf UpdatePullRequestDescription' {Text
description :: Text
pullRequestId :: Text
$sel:description:UpdatePullRequestDescription' :: UpdatePullRequestDescription -> Text
$sel:pullRequestId:UpdatePullRequestDescription' :: UpdatePullRequestDescription -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
pullRequestId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
description
instance Data.ToHeaders UpdatePullRequestDescription where
toHeaders :: UpdatePullRequestDescription -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"CodeCommit_20150413.UpdatePullRequestDescription" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"pullRequestId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
pullRequestId),
forall a. a -> Maybe a
Prelude.Just (Key
"description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
description)
]
)
instance Data.ToPath UpdatePullRequestDescription where
toPath :: UpdatePullRequestDescription -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdatePullRequestDescription where
toQuery :: UpdatePullRequestDescription -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdatePullRequestDescriptionResponse = UpdatePullRequestDescriptionResponse'
{
UpdatePullRequestDescriptionResponse -> Int
httpStatus :: Prelude.Int,
UpdatePullRequestDescriptionResponse -> PullRequest
pullRequest :: PullRequest
}
deriving (UpdatePullRequestDescriptionResponse
-> UpdatePullRequestDescriptionResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:UpdatePullRequestDescriptionResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:pullRequest:UpdatePullRequestDescriptionResponse' :: PullRequest
pullRequest = PullRequest
pPullRequest_
}
updatePullRequestDescriptionResponse_httpStatus :: Lens.Lens' UpdatePullRequestDescriptionResponse Prelude.Int
updatePullRequestDescriptionResponse_httpStatus :: Lens' UpdatePullRequestDescriptionResponse Int
updatePullRequestDescriptionResponse_httpStatus = 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 :: Lens' UpdatePullRequestDescriptionResponse PullRequest
updatePullRequestDescriptionResponse_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
where
rnf :: UpdatePullRequestDescriptionResponse -> ()
rnf UpdatePullRequestDescriptionResponse' {Int
PullRequest
pullRequest :: PullRequest
httpStatus :: Int
$sel:pullRequest:UpdatePullRequestDescriptionResponse' :: UpdatePullRequestDescriptionResponse -> PullRequest
$sel:httpStatus:UpdatePullRequestDescriptionResponse' :: UpdatePullRequestDescriptionResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf PullRequest
pullRequest