{-# 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.GetCommentReactions
(
GetCommentReactions (..),
newGetCommentReactions,
getCommentReactions_maxResults,
getCommentReactions_nextToken,
getCommentReactions_reactionUserArn,
getCommentReactions_commentId,
GetCommentReactionsResponse (..),
newGetCommentReactionsResponse,
getCommentReactionsResponse_nextToken,
getCommentReactionsResponse_httpStatus,
getCommentReactionsResponse_reactionsForComment,
)
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 =
{
:: Prelude.Maybe Prelude.Int,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Text
}
deriving (GetCommentReactions -> GetCommentReactions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCommentReactions -> GetCommentReactions -> Bool
$c/= :: GetCommentReactions -> GetCommentReactions -> Bool
== :: GetCommentReactions -> GetCommentReactions -> Bool
$c== :: GetCommentReactions -> GetCommentReactions -> Bool
Prelude.Eq, ReadPrec [GetCommentReactions]
ReadPrec GetCommentReactions
Int -> ReadS GetCommentReactions
ReadS [GetCommentReactions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCommentReactions]
$creadListPrec :: ReadPrec [GetCommentReactions]
readPrec :: ReadPrec GetCommentReactions
$creadPrec :: ReadPrec GetCommentReactions
readList :: ReadS [GetCommentReactions]
$creadList :: ReadS [GetCommentReactions]
readsPrec :: Int -> ReadS GetCommentReactions
$creadsPrec :: Int -> ReadS GetCommentReactions
Prelude.Read, Int -> GetCommentReactions -> ShowS
[GetCommentReactions] -> ShowS
GetCommentReactions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCommentReactions] -> ShowS
$cshowList :: [GetCommentReactions] -> ShowS
show :: GetCommentReactions -> String
$cshow :: GetCommentReactions -> String
showsPrec :: Int -> GetCommentReactions -> ShowS
$cshowsPrec :: Int -> GetCommentReactions -> ShowS
Prelude.Show, forall x. Rep GetCommentReactions x -> GetCommentReactions
forall x. GetCommentReactions -> Rep GetCommentReactions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetCommentReactions x -> GetCommentReactions
$cfrom :: forall x. GetCommentReactions -> Rep GetCommentReactions x
Prelude.Generic)
newGetCommentReactions ::
Prelude.Text ->
GetCommentReactions
Text
pCommentId_ =
GetCommentReactions'
{ $sel:maxResults:GetCommentReactions' :: Maybe Int
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:GetCommentReactions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:reactionUserArn:GetCommentReactions' :: Maybe Text
reactionUserArn = forall a. Maybe a
Prelude.Nothing,
$sel:commentId:GetCommentReactions' :: Text
commentId = Text
pCommentId_
}
getCommentReactions_maxResults :: Lens.Lens' GetCommentReactions (Prelude.Maybe Prelude.Int)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCommentReactions' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:GetCommentReactions' :: GetCommentReactions -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: GetCommentReactions
s@GetCommentReactions' {} Maybe Int
a -> GetCommentReactions
s {$sel:maxResults:GetCommentReactions' :: Maybe Int
maxResults = Maybe Int
a} :: GetCommentReactions)
getCommentReactions_nextToken :: Lens.Lens' GetCommentReactions (Prelude.Maybe Prelude.Text)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCommentReactions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetCommentReactions' :: GetCommentReactions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetCommentReactions
s@GetCommentReactions' {} Maybe Text
a -> GetCommentReactions
s {$sel:nextToken:GetCommentReactions' :: Maybe Text
nextToken = Maybe Text
a} :: GetCommentReactions)
getCommentReactions_reactionUserArn :: Lens.Lens' GetCommentReactions (Prelude.Maybe Prelude.Text)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCommentReactions' {Maybe Text
reactionUserArn :: Maybe Text
$sel:reactionUserArn:GetCommentReactions' :: GetCommentReactions -> Maybe Text
reactionUserArn} -> Maybe Text
reactionUserArn) (\s :: GetCommentReactions
s@GetCommentReactions' {} Maybe Text
a -> GetCommentReactions
s {$sel:reactionUserArn:GetCommentReactions' :: Maybe Text
reactionUserArn = Maybe Text
a} :: GetCommentReactions)
getCommentReactions_commentId :: Lens.Lens' GetCommentReactions Prelude.Text
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCommentReactions' {Text
commentId :: Text
$sel:commentId:GetCommentReactions' :: GetCommentReactions -> Text
commentId} -> Text
commentId) (\s :: GetCommentReactions
s@GetCommentReactions' {} Text
a -> GetCommentReactions
s {$sel:commentId:GetCommentReactions' :: Text
commentId = Text
a} :: GetCommentReactions)
instance Core.AWSRequest GetCommentReactions where
type
AWSResponse GetCommentReactions =
GetCommentReactionsResponse
request :: (Service -> Service)
-> GetCommentReactions -> Request GetCommentReactions
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 GetCommentReactions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetCommentReactions)))
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 ->
Maybe Text
-> Int -> [ReactionForComment] -> GetCommentReactionsResponse
GetCommentReactionsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
forall (f :: * -> *) a b. Applicative f => 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 (Maybe a)
Data..?> Key
"reactionsForComment"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable GetCommentReactions where
hashWithSalt :: Int -> GetCommentReactions -> Int
hashWithSalt Int
_salt GetCommentReactions' {Maybe Int
Maybe Text
Text
commentId :: Text
reactionUserArn :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:commentId:GetCommentReactions' :: GetCommentReactions -> Text
$sel:reactionUserArn:GetCommentReactions' :: GetCommentReactions -> Maybe Text
$sel:nextToken:GetCommentReactions' :: GetCommentReactions -> Maybe Text
$sel:maxResults:GetCommentReactions' :: GetCommentReactions -> Maybe Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
reactionUserArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
commentId
instance Prelude.NFData GetCommentReactions where
rnf :: GetCommentReactions -> ()
rnf GetCommentReactions' {Maybe Int
Maybe Text
Text
commentId :: Text
reactionUserArn :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:commentId:GetCommentReactions' :: GetCommentReactions -> Text
$sel:reactionUserArn:GetCommentReactions' :: GetCommentReactions -> Maybe Text
$sel:nextToken:GetCommentReactions' :: GetCommentReactions -> Maybe Text
$sel:maxResults:GetCommentReactions' :: GetCommentReactions -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
reactionUserArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
commentId
instance Data.ToHeaders GetCommentReactions where
toHeaders :: GetCommentReactions -> 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.GetCommentReactions" ::
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 GetCommentReactions where
toJSON :: GetCommentReactions -> Value
toJSON GetCommentReactions' {Maybe Int
Maybe Text
Text
commentId :: Text
reactionUserArn :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:commentId:GetCommentReactions' :: GetCommentReactions -> Text
$sel:reactionUserArn:GetCommentReactions' :: GetCommentReactions -> Maybe Text
$sel:nextToken:GetCommentReactions' :: GetCommentReactions -> Maybe Text
$sel:maxResults:GetCommentReactions' :: GetCommentReactions -> Maybe Int
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults,
(Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
(Key
"reactionUserArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
reactionUserArn,
forall a. a -> Maybe a
Prelude.Just (Key
"commentId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
commentId)
]
)
instance Data.ToPath GetCommentReactions where
toPath :: GetCommentReactions -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetCommentReactions where
toQuery :: GetCommentReactions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data =
{
:: Prelude.Maybe Prelude.Text,
:: Prelude.Int,
:: [ReactionForComment]
}
deriving (GetCommentReactionsResponse -> GetCommentReactionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCommentReactionsResponse -> GetCommentReactionsResponse -> Bool
$c/= :: GetCommentReactionsResponse -> GetCommentReactionsResponse -> Bool
== :: GetCommentReactionsResponse -> GetCommentReactionsResponse -> Bool
$c== :: GetCommentReactionsResponse -> GetCommentReactionsResponse -> Bool
Prelude.Eq, ReadPrec [GetCommentReactionsResponse]
ReadPrec GetCommentReactionsResponse
Int -> ReadS GetCommentReactionsResponse
ReadS [GetCommentReactionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCommentReactionsResponse]
$creadListPrec :: ReadPrec [GetCommentReactionsResponse]
readPrec :: ReadPrec GetCommentReactionsResponse
$creadPrec :: ReadPrec GetCommentReactionsResponse
readList :: ReadS [GetCommentReactionsResponse]
$creadList :: ReadS [GetCommentReactionsResponse]
readsPrec :: Int -> ReadS GetCommentReactionsResponse
$creadsPrec :: Int -> ReadS GetCommentReactionsResponse
Prelude.Read, Int -> GetCommentReactionsResponse -> ShowS
[GetCommentReactionsResponse] -> ShowS
GetCommentReactionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCommentReactionsResponse] -> ShowS
$cshowList :: [GetCommentReactionsResponse] -> ShowS
show :: GetCommentReactionsResponse -> String
$cshow :: GetCommentReactionsResponse -> String
showsPrec :: Int -> GetCommentReactionsResponse -> ShowS
$cshowsPrec :: Int -> GetCommentReactionsResponse -> ShowS
Prelude.Show, forall x.
Rep GetCommentReactionsResponse x -> GetCommentReactionsResponse
forall x.
GetCommentReactionsResponse -> Rep GetCommentReactionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCommentReactionsResponse x -> GetCommentReactionsResponse
$cfrom :: forall x.
GetCommentReactionsResponse -> Rep GetCommentReactionsResponse x
Prelude.Generic)
newGetCommentReactionsResponse ::
Prelude.Int ->
GetCommentReactionsResponse
Int
pHttpStatus_ =
GetCommentReactionsResponse'
{ $sel:nextToken:GetCommentReactionsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetCommentReactionsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:reactionsForComment:GetCommentReactionsResponse' :: [ReactionForComment]
reactionsForComment = forall a. Monoid a => a
Prelude.mempty
}
getCommentReactionsResponse_nextToken :: Lens.Lens' GetCommentReactionsResponse (Prelude.Maybe Prelude.Text)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCommentReactionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetCommentReactionsResponse' :: GetCommentReactionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetCommentReactionsResponse
s@GetCommentReactionsResponse' {} Maybe Text
a -> GetCommentReactionsResponse
s {$sel:nextToken:GetCommentReactionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetCommentReactionsResponse)
getCommentReactionsResponse_httpStatus :: Lens.Lens' GetCommentReactionsResponse Prelude.Int
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCommentReactionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetCommentReactionsResponse' :: GetCommentReactionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetCommentReactionsResponse
s@GetCommentReactionsResponse' {} Int
a -> GetCommentReactionsResponse
s {$sel:httpStatus:GetCommentReactionsResponse' :: Int
httpStatus = Int
a} :: GetCommentReactionsResponse)
getCommentReactionsResponse_reactionsForComment :: Lens.Lens' GetCommentReactionsResponse [ReactionForComment]
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCommentReactionsResponse' {[ReactionForComment]
reactionsForComment :: [ReactionForComment]
$sel:reactionsForComment:GetCommentReactionsResponse' :: GetCommentReactionsResponse -> [ReactionForComment]
reactionsForComment} -> [ReactionForComment]
reactionsForComment) (\s :: GetCommentReactionsResponse
s@GetCommentReactionsResponse' {} [ReactionForComment]
a -> GetCommentReactionsResponse
s {$sel:reactionsForComment:GetCommentReactionsResponse' :: [ReactionForComment]
reactionsForComment = [ReactionForComment]
a} :: GetCommentReactionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData GetCommentReactionsResponse where
rnf :: GetCommentReactionsResponse -> ()
rnf GetCommentReactionsResponse' {Int
[ReactionForComment]
Maybe Text
reactionsForComment :: [ReactionForComment]
httpStatus :: Int
nextToken :: Maybe Text
$sel:reactionsForComment:GetCommentReactionsResponse' :: GetCommentReactionsResponse -> [ReactionForComment]
$sel:httpStatus:GetCommentReactionsResponse' :: GetCommentReactionsResponse -> Int
$sel:nextToken:GetCommentReactionsResponse' :: GetCommentReactionsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 [ReactionForComment]
reactionsForComment