{-# 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.PutCommentReaction
(
PutCommentReaction (..),
newPutCommentReaction,
putCommentReaction_commentId,
putCommentReaction_reactionValue,
PutCommentReactionResponse (..),
newPutCommentReactionResponse,
)
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 =
{
:: Prelude.Text,
:: Prelude.Text
}
deriving (PutCommentReaction -> PutCommentReaction -> Bool
(PutCommentReaction -> PutCommentReaction -> Bool)
-> (PutCommentReaction -> PutCommentReaction -> Bool)
-> Eq PutCommentReaction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutCommentReaction -> PutCommentReaction -> Bool
$c/= :: PutCommentReaction -> PutCommentReaction -> Bool
== :: PutCommentReaction -> PutCommentReaction -> Bool
$c== :: PutCommentReaction -> PutCommentReaction -> Bool
Prelude.Eq, ReadPrec [PutCommentReaction]
ReadPrec PutCommentReaction
Int -> ReadS PutCommentReaction
ReadS [PutCommentReaction]
(Int -> ReadS PutCommentReaction)
-> ReadS [PutCommentReaction]
-> ReadPrec PutCommentReaction
-> ReadPrec [PutCommentReaction]
-> Read PutCommentReaction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutCommentReaction]
$creadListPrec :: ReadPrec [PutCommentReaction]
readPrec :: ReadPrec PutCommentReaction
$creadPrec :: ReadPrec PutCommentReaction
readList :: ReadS [PutCommentReaction]
$creadList :: ReadS [PutCommentReaction]
readsPrec :: Int -> ReadS PutCommentReaction
$creadsPrec :: Int -> ReadS PutCommentReaction
Prelude.Read, Int -> PutCommentReaction -> ShowS
[PutCommentReaction] -> ShowS
PutCommentReaction -> String
(Int -> PutCommentReaction -> ShowS)
-> (PutCommentReaction -> String)
-> ([PutCommentReaction] -> ShowS)
-> Show PutCommentReaction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutCommentReaction] -> ShowS
$cshowList :: [PutCommentReaction] -> ShowS
show :: PutCommentReaction -> String
$cshow :: PutCommentReaction -> String
showsPrec :: Int -> PutCommentReaction -> ShowS
$cshowsPrec :: Int -> PutCommentReaction -> ShowS
Prelude.Show, (forall x. PutCommentReaction -> Rep PutCommentReaction x)
-> (forall x. Rep PutCommentReaction x -> PutCommentReaction)
-> Generic PutCommentReaction
forall x. Rep PutCommentReaction x -> PutCommentReaction
forall x. PutCommentReaction -> Rep PutCommentReaction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutCommentReaction x -> PutCommentReaction
$cfrom :: forall x. PutCommentReaction -> Rep PutCommentReaction x
Prelude.Generic)
newPutCommentReaction ::
Prelude.Text ->
Prelude.Text ->
PutCommentReaction
Text
pCommentId_ Text
pReactionValue_ =
PutCommentReaction' :: Text -> Text -> PutCommentReaction
PutCommentReaction'
{ $sel:commentId:PutCommentReaction' :: Text
commentId = Text
pCommentId_,
$sel:reactionValue:PutCommentReaction' :: Text
reactionValue = Text
pReactionValue_
}
putCommentReaction_commentId :: Lens.Lens' PutCommentReaction Prelude.Text
= (PutCommentReaction -> Text)
-> (PutCommentReaction -> Text -> PutCommentReaction)
-> Lens PutCommentReaction PutCommentReaction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutCommentReaction' {Text
commentId :: Text
$sel:commentId:PutCommentReaction' :: PutCommentReaction -> Text
commentId} -> Text
commentId) (\s :: PutCommentReaction
s@PutCommentReaction' {} Text
a -> PutCommentReaction
s {$sel:commentId:PutCommentReaction' :: Text
commentId = Text
a} :: PutCommentReaction)
putCommentReaction_reactionValue :: Lens.Lens' PutCommentReaction Prelude.Text
= (PutCommentReaction -> Text)
-> (PutCommentReaction -> Text -> PutCommentReaction)
-> Lens PutCommentReaction PutCommentReaction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutCommentReaction' {Text
reactionValue :: Text
$sel:reactionValue:PutCommentReaction' :: PutCommentReaction -> Text
reactionValue} -> Text
reactionValue) (\s :: PutCommentReaction
s@PutCommentReaction' {} Text
a -> PutCommentReaction
s {$sel:reactionValue:PutCommentReaction' :: Text
reactionValue = Text
a} :: PutCommentReaction)
instance Core.AWSRequest PutCommentReaction where
type
AWSResponse PutCommentReaction =
PutCommentReactionResponse
request :: PutCommentReaction -> Request PutCommentReaction
request = Service -> PutCommentReaction -> Request PutCommentReaction
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutCommentReaction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutCommentReaction)))
response =
AWSResponse PutCommentReaction
-> Logger
-> Service
-> Proxy PutCommentReaction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutCommentReaction)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse PutCommentReaction
PutCommentReactionResponse
PutCommentReactionResponse'
instance Prelude.Hashable PutCommentReaction
instance Prelude.NFData PutCommentReaction
instance Core.ToHeaders PutCommentReaction where
toHeaders :: PutCommentReaction -> [Header]
toHeaders =
[Header] -> PutCommentReaction -> [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
"CodeCommit_20150413.PutCommentReaction" ::
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 PutCommentReaction where
toJSON :: PutCommentReaction -> Value
toJSON PutCommentReaction' {Text
reactionValue :: Text
commentId :: Text
$sel:reactionValue:PutCommentReaction' :: PutCommentReaction -> Text
$sel:commentId:PutCommentReaction' :: PutCommentReaction -> 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
"commentId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
commentId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"reactionValue" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
reactionValue)
]
)
instance Core.ToPath PutCommentReaction where
toPath :: PutCommentReaction -> ByteString
toPath = ByteString -> PutCommentReaction -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutCommentReaction where
toQuery :: PutCommentReaction -> QueryString
toQuery = QueryString -> PutCommentReaction -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data =
{
}
deriving (PutCommentReactionResponse -> PutCommentReactionResponse -> Bool
(PutCommentReactionResponse -> PutCommentReactionResponse -> Bool)
-> (PutCommentReactionResponse
-> PutCommentReactionResponse -> Bool)
-> Eq PutCommentReactionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutCommentReactionResponse -> PutCommentReactionResponse -> Bool
$c/= :: PutCommentReactionResponse -> PutCommentReactionResponse -> Bool
== :: PutCommentReactionResponse -> PutCommentReactionResponse -> Bool
$c== :: PutCommentReactionResponse -> PutCommentReactionResponse -> Bool
Prelude.Eq, ReadPrec [PutCommentReactionResponse]
ReadPrec PutCommentReactionResponse
Int -> ReadS PutCommentReactionResponse
ReadS [PutCommentReactionResponse]
(Int -> ReadS PutCommentReactionResponse)
-> ReadS [PutCommentReactionResponse]
-> ReadPrec PutCommentReactionResponse
-> ReadPrec [PutCommentReactionResponse]
-> Read PutCommentReactionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutCommentReactionResponse]
$creadListPrec :: ReadPrec [PutCommentReactionResponse]
readPrec :: ReadPrec PutCommentReactionResponse
$creadPrec :: ReadPrec PutCommentReactionResponse
readList :: ReadS [PutCommentReactionResponse]
$creadList :: ReadS [PutCommentReactionResponse]
readsPrec :: Int -> ReadS PutCommentReactionResponse
$creadsPrec :: Int -> ReadS PutCommentReactionResponse
Prelude.Read, Int -> PutCommentReactionResponse -> ShowS
[PutCommentReactionResponse] -> ShowS
PutCommentReactionResponse -> String
(Int -> PutCommentReactionResponse -> ShowS)
-> (PutCommentReactionResponse -> String)
-> ([PutCommentReactionResponse] -> ShowS)
-> Show PutCommentReactionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutCommentReactionResponse] -> ShowS
$cshowList :: [PutCommentReactionResponse] -> ShowS
show :: PutCommentReactionResponse -> String
$cshow :: PutCommentReactionResponse -> String
showsPrec :: Int -> PutCommentReactionResponse -> ShowS
$cshowsPrec :: Int -> PutCommentReactionResponse -> ShowS
Prelude.Show, (forall x.
PutCommentReactionResponse -> Rep PutCommentReactionResponse x)
-> (forall x.
Rep PutCommentReactionResponse x -> PutCommentReactionResponse)
-> Generic PutCommentReactionResponse
forall x.
Rep PutCommentReactionResponse x -> PutCommentReactionResponse
forall x.
PutCommentReactionResponse -> Rep PutCommentReactionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutCommentReactionResponse x -> PutCommentReactionResponse
$cfrom :: forall x.
PutCommentReactionResponse -> Rep PutCommentReactionResponse x
Prelude.Generic)
newPutCommentReactionResponse ::
PutCommentReactionResponse
=
PutCommentReactionResponse
PutCommentReactionResponse'
instance Prelude.NFData PutCommentReactionResponse