{-# 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.CodeGuruReviewer.DescribeRecommendationFeedback
(
DescribeRecommendationFeedback (..),
newDescribeRecommendationFeedback,
describeRecommendationFeedback_userId,
describeRecommendationFeedback_codeReviewArn,
describeRecommendationFeedback_recommendationId,
DescribeRecommendationFeedbackResponse (..),
newDescribeRecommendationFeedbackResponse,
describeRecommendationFeedbackResponse_recommendationFeedback,
describeRecommendationFeedbackResponse_httpStatus,
)
where
import Amazonka.CodeGuruReviewer.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 DescribeRecommendationFeedback = DescribeRecommendationFeedback'
{
DescribeRecommendationFeedback -> Maybe Text
userId :: Prelude.Maybe Prelude.Text,
DescribeRecommendationFeedback -> Text
codeReviewArn :: Prelude.Text,
DescribeRecommendationFeedback -> Text
recommendationId :: Prelude.Text
}
deriving (DescribeRecommendationFeedback
-> DescribeRecommendationFeedback -> Bool
(DescribeRecommendationFeedback
-> DescribeRecommendationFeedback -> Bool)
-> (DescribeRecommendationFeedback
-> DescribeRecommendationFeedback -> Bool)
-> Eq DescribeRecommendationFeedback
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRecommendationFeedback
-> DescribeRecommendationFeedback -> Bool
$c/= :: DescribeRecommendationFeedback
-> DescribeRecommendationFeedback -> Bool
== :: DescribeRecommendationFeedback
-> DescribeRecommendationFeedback -> Bool
$c== :: DescribeRecommendationFeedback
-> DescribeRecommendationFeedback -> Bool
Prelude.Eq, ReadPrec [DescribeRecommendationFeedback]
ReadPrec DescribeRecommendationFeedback
Int -> ReadS DescribeRecommendationFeedback
ReadS [DescribeRecommendationFeedback]
(Int -> ReadS DescribeRecommendationFeedback)
-> ReadS [DescribeRecommendationFeedback]
-> ReadPrec DescribeRecommendationFeedback
-> ReadPrec [DescribeRecommendationFeedback]
-> Read DescribeRecommendationFeedback
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRecommendationFeedback]
$creadListPrec :: ReadPrec [DescribeRecommendationFeedback]
readPrec :: ReadPrec DescribeRecommendationFeedback
$creadPrec :: ReadPrec DescribeRecommendationFeedback
readList :: ReadS [DescribeRecommendationFeedback]
$creadList :: ReadS [DescribeRecommendationFeedback]
readsPrec :: Int -> ReadS DescribeRecommendationFeedback
$creadsPrec :: Int -> ReadS DescribeRecommendationFeedback
Prelude.Read, Int -> DescribeRecommendationFeedback -> ShowS
[DescribeRecommendationFeedback] -> ShowS
DescribeRecommendationFeedback -> String
(Int -> DescribeRecommendationFeedback -> ShowS)
-> (DescribeRecommendationFeedback -> String)
-> ([DescribeRecommendationFeedback] -> ShowS)
-> Show DescribeRecommendationFeedback
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRecommendationFeedback] -> ShowS
$cshowList :: [DescribeRecommendationFeedback] -> ShowS
show :: DescribeRecommendationFeedback -> String
$cshow :: DescribeRecommendationFeedback -> String
showsPrec :: Int -> DescribeRecommendationFeedback -> ShowS
$cshowsPrec :: Int -> DescribeRecommendationFeedback -> ShowS
Prelude.Show, (forall x.
DescribeRecommendationFeedback
-> Rep DescribeRecommendationFeedback x)
-> (forall x.
Rep DescribeRecommendationFeedback x
-> DescribeRecommendationFeedback)
-> Generic DescribeRecommendationFeedback
forall x.
Rep DescribeRecommendationFeedback x
-> DescribeRecommendationFeedback
forall x.
DescribeRecommendationFeedback
-> Rep DescribeRecommendationFeedback x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRecommendationFeedback x
-> DescribeRecommendationFeedback
$cfrom :: forall x.
DescribeRecommendationFeedback
-> Rep DescribeRecommendationFeedback x
Prelude.Generic)
newDescribeRecommendationFeedback ::
Prelude.Text ->
Prelude.Text ->
DescribeRecommendationFeedback
newDescribeRecommendationFeedback :: Text -> Text -> DescribeRecommendationFeedback
newDescribeRecommendationFeedback
Text
pCodeReviewArn_
Text
pRecommendationId_ =
DescribeRecommendationFeedback' :: Maybe Text -> Text -> Text -> DescribeRecommendationFeedback
DescribeRecommendationFeedback'
{ $sel:userId:DescribeRecommendationFeedback' :: Maybe Text
userId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:codeReviewArn:DescribeRecommendationFeedback' :: Text
codeReviewArn = Text
pCodeReviewArn_,
$sel:recommendationId:DescribeRecommendationFeedback' :: Text
recommendationId = Text
pRecommendationId_
}
describeRecommendationFeedback_userId :: Lens.Lens' DescribeRecommendationFeedback (Prelude.Maybe Prelude.Text)
describeRecommendationFeedback_userId :: (Maybe Text -> f (Maybe Text))
-> DescribeRecommendationFeedback
-> f DescribeRecommendationFeedback
describeRecommendationFeedback_userId = (DescribeRecommendationFeedback -> Maybe Text)
-> (DescribeRecommendationFeedback
-> Maybe Text -> DescribeRecommendationFeedback)
-> Lens
DescribeRecommendationFeedback
DescribeRecommendationFeedback
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRecommendationFeedback' {Maybe Text
userId :: Maybe Text
$sel:userId:DescribeRecommendationFeedback' :: DescribeRecommendationFeedback -> Maybe Text
userId} -> Maybe Text
userId) (\s :: DescribeRecommendationFeedback
s@DescribeRecommendationFeedback' {} Maybe Text
a -> DescribeRecommendationFeedback
s {$sel:userId:DescribeRecommendationFeedback' :: Maybe Text
userId = Maybe Text
a} :: DescribeRecommendationFeedback)
describeRecommendationFeedback_codeReviewArn :: Lens.Lens' DescribeRecommendationFeedback Prelude.Text
describeRecommendationFeedback_codeReviewArn :: (Text -> f Text)
-> DescribeRecommendationFeedback
-> f DescribeRecommendationFeedback
describeRecommendationFeedback_codeReviewArn = (DescribeRecommendationFeedback -> Text)
-> (DescribeRecommendationFeedback
-> Text -> DescribeRecommendationFeedback)
-> Lens
DescribeRecommendationFeedback
DescribeRecommendationFeedback
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRecommendationFeedback' {Text
codeReviewArn :: Text
$sel:codeReviewArn:DescribeRecommendationFeedback' :: DescribeRecommendationFeedback -> Text
codeReviewArn} -> Text
codeReviewArn) (\s :: DescribeRecommendationFeedback
s@DescribeRecommendationFeedback' {} Text
a -> DescribeRecommendationFeedback
s {$sel:codeReviewArn:DescribeRecommendationFeedback' :: Text
codeReviewArn = Text
a} :: DescribeRecommendationFeedback)
describeRecommendationFeedback_recommendationId :: Lens.Lens' DescribeRecommendationFeedback Prelude.Text
describeRecommendationFeedback_recommendationId :: (Text -> f Text)
-> DescribeRecommendationFeedback
-> f DescribeRecommendationFeedback
describeRecommendationFeedback_recommendationId = (DescribeRecommendationFeedback -> Text)
-> (DescribeRecommendationFeedback
-> Text -> DescribeRecommendationFeedback)
-> Lens
DescribeRecommendationFeedback
DescribeRecommendationFeedback
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRecommendationFeedback' {Text
recommendationId :: Text
$sel:recommendationId:DescribeRecommendationFeedback' :: DescribeRecommendationFeedback -> Text
recommendationId} -> Text
recommendationId) (\s :: DescribeRecommendationFeedback
s@DescribeRecommendationFeedback' {} Text
a -> DescribeRecommendationFeedback
s {$sel:recommendationId:DescribeRecommendationFeedback' :: Text
recommendationId = Text
a} :: DescribeRecommendationFeedback)
instance
Core.AWSRequest
DescribeRecommendationFeedback
where
type
AWSResponse DescribeRecommendationFeedback =
DescribeRecommendationFeedbackResponse
request :: DescribeRecommendationFeedback
-> Request DescribeRecommendationFeedback
request = Service
-> DescribeRecommendationFeedback
-> Request DescribeRecommendationFeedback
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeRecommendationFeedback
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeRecommendationFeedback)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeRecommendationFeedback))
-> Logger
-> Service
-> Proxy DescribeRecommendationFeedback
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeRecommendationFeedback)))
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 RecommendationFeedback
-> Int -> DescribeRecommendationFeedbackResponse
DescribeRecommendationFeedbackResponse'
(Maybe RecommendationFeedback
-> Int -> DescribeRecommendationFeedbackResponse)
-> Either String (Maybe RecommendationFeedback)
-> Either String (Int -> DescribeRecommendationFeedbackResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe RecommendationFeedback)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RecommendationFeedback")
Either String (Int -> DescribeRecommendationFeedbackResponse)
-> Either String Int
-> Either String DescribeRecommendationFeedbackResponse
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
DescribeRecommendationFeedback
instance
Prelude.NFData
DescribeRecommendationFeedback
instance
Core.ToHeaders
DescribeRecommendationFeedback
where
toHeaders :: DescribeRecommendationFeedback -> ResponseHeaders
toHeaders =
ResponseHeaders
-> DescribeRecommendationFeedback -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath DescribeRecommendationFeedback where
toPath :: DescribeRecommendationFeedback -> ByteString
toPath DescribeRecommendationFeedback' {Maybe Text
Text
recommendationId :: Text
codeReviewArn :: Text
userId :: Maybe Text
$sel:recommendationId:DescribeRecommendationFeedback' :: DescribeRecommendationFeedback -> Text
$sel:codeReviewArn:DescribeRecommendationFeedback' :: DescribeRecommendationFeedback -> Text
$sel:userId:DescribeRecommendationFeedback' :: DescribeRecommendationFeedback -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/feedback/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
codeReviewArn]
instance Core.ToQuery DescribeRecommendationFeedback where
toQuery :: DescribeRecommendationFeedback -> QueryString
toQuery DescribeRecommendationFeedback' {Maybe Text
Text
recommendationId :: Text
codeReviewArn :: Text
userId :: Maybe Text
$sel:recommendationId:DescribeRecommendationFeedback' :: DescribeRecommendationFeedback -> Text
$sel:codeReviewArn:DescribeRecommendationFeedback' :: DescribeRecommendationFeedback -> Text
$sel:userId:DescribeRecommendationFeedback' :: DescribeRecommendationFeedback -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"UserId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
userId,
ByteString
"RecommendationId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
recommendationId
]
data DescribeRecommendationFeedbackResponse = DescribeRecommendationFeedbackResponse'
{
DescribeRecommendationFeedbackResponse
-> Maybe RecommendationFeedback
recommendationFeedback :: Prelude.Maybe RecommendationFeedback,
DescribeRecommendationFeedbackResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeRecommendationFeedbackResponse
-> DescribeRecommendationFeedbackResponse -> Bool
(DescribeRecommendationFeedbackResponse
-> DescribeRecommendationFeedbackResponse -> Bool)
-> (DescribeRecommendationFeedbackResponse
-> DescribeRecommendationFeedbackResponse -> Bool)
-> Eq DescribeRecommendationFeedbackResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRecommendationFeedbackResponse
-> DescribeRecommendationFeedbackResponse -> Bool
$c/= :: DescribeRecommendationFeedbackResponse
-> DescribeRecommendationFeedbackResponse -> Bool
== :: DescribeRecommendationFeedbackResponse
-> DescribeRecommendationFeedbackResponse -> Bool
$c== :: DescribeRecommendationFeedbackResponse
-> DescribeRecommendationFeedbackResponse -> Bool
Prelude.Eq, ReadPrec [DescribeRecommendationFeedbackResponse]
ReadPrec DescribeRecommendationFeedbackResponse
Int -> ReadS DescribeRecommendationFeedbackResponse
ReadS [DescribeRecommendationFeedbackResponse]
(Int -> ReadS DescribeRecommendationFeedbackResponse)
-> ReadS [DescribeRecommendationFeedbackResponse]
-> ReadPrec DescribeRecommendationFeedbackResponse
-> ReadPrec [DescribeRecommendationFeedbackResponse]
-> Read DescribeRecommendationFeedbackResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRecommendationFeedbackResponse]
$creadListPrec :: ReadPrec [DescribeRecommendationFeedbackResponse]
readPrec :: ReadPrec DescribeRecommendationFeedbackResponse
$creadPrec :: ReadPrec DescribeRecommendationFeedbackResponse
readList :: ReadS [DescribeRecommendationFeedbackResponse]
$creadList :: ReadS [DescribeRecommendationFeedbackResponse]
readsPrec :: Int -> ReadS DescribeRecommendationFeedbackResponse
$creadsPrec :: Int -> ReadS DescribeRecommendationFeedbackResponse
Prelude.Read, Int -> DescribeRecommendationFeedbackResponse -> ShowS
[DescribeRecommendationFeedbackResponse] -> ShowS
DescribeRecommendationFeedbackResponse -> String
(Int -> DescribeRecommendationFeedbackResponse -> ShowS)
-> (DescribeRecommendationFeedbackResponse -> String)
-> ([DescribeRecommendationFeedbackResponse] -> ShowS)
-> Show DescribeRecommendationFeedbackResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRecommendationFeedbackResponse] -> ShowS
$cshowList :: [DescribeRecommendationFeedbackResponse] -> ShowS
show :: DescribeRecommendationFeedbackResponse -> String
$cshow :: DescribeRecommendationFeedbackResponse -> String
showsPrec :: Int -> DescribeRecommendationFeedbackResponse -> ShowS
$cshowsPrec :: Int -> DescribeRecommendationFeedbackResponse -> ShowS
Prelude.Show, (forall x.
DescribeRecommendationFeedbackResponse
-> Rep DescribeRecommendationFeedbackResponse x)
-> (forall x.
Rep DescribeRecommendationFeedbackResponse x
-> DescribeRecommendationFeedbackResponse)
-> Generic DescribeRecommendationFeedbackResponse
forall x.
Rep DescribeRecommendationFeedbackResponse x
-> DescribeRecommendationFeedbackResponse
forall x.
DescribeRecommendationFeedbackResponse
-> Rep DescribeRecommendationFeedbackResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRecommendationFeedbackResponse x
-> DescribeRecommendationFeedbackResponse
$cfrom :: forall x.
DescribeRecommendationFeedbackResponse
-> Rep DescribeRecommendationFeedbackResponse x
Prelude.Generic)
newDescribeRecommendationFeedbackResponse ::
Prelude.Int ->
DescribeRecommendationFeedbackResponse
newDescribeRecommendationFeedbackResponse :: Int -> DescribeRecommendationFeedbackResponse
newDescribeRecommendationFeedbackResponse
Int
pHttpStatus_ =
DescribeRecommendationFeedbackResponse' :: Maybe RecommendationFeedback
-> Int -> DescribeRecommendationFeedbackResponse
DescribeRecommendationFeedbackResponse'
{ $sel:recommendationFeedback:DescribeRecommendationFeedbackResponse' :: Maybe RecommendationFeedback
recommendationFeedback =
Maybe RecommendationFeedback
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeRecommendationFeedbackResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeRecommendationFeedbackResponse_recommendationFeedback :: Lens.Lens' DescribeRecommendationFeedbackResponse (Prelude.Maybe RecommendationFeedback)
describeRecommendationFeedbackResponse_recommendationFeedback :: (Maybe RecommendationFeedback -> f (Maybe RecommendationFeedback))
-> DescribeRecommendationFeedbackResponse
-> f DescribeRecommendationFeedbackResponse
describeRecommendationFeedbackResponse_recommendationFeedback = (DescribeRecommendationFeedbackResponse
-> Maybe RecommendationFeedback)
-> (DescribeRecommendationFeedbackResponse
-> Maybe RecommendationFeedback
-> DescribeRecommendationFeedbackResponse)
-> Lens
DescribeRecommendationFeedbackResponse
DescribeRecommendationFeedbackResponse
(Maybe RecommendationFeedback)
(Maybe RecommendationFeedback)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRecommendationFeedbackResponse' {Maybe RecommendationFeedback
recommendationFeedback :: Maybe RecommendationFeedback
$sel:recommendationFeedback:DescribeRecommendationFeedbackResponse' :: DescribeRecommendationFeedbackResponse
-> Maybe RecommendationFeedback
recommendationFeedback} -> Maybe RecommendationFeedback
recommendationFeedback) (\s :: DescribeRecommendationFeedbackResponse
s@DescribeRecommendationFeedbackResponse' {} Maybe RecommendationFeedback
a -> DescribeRecommendationFeedbackResponse
s {$sel:recommendationFeedback:DescribeRecommendationFeedbackResponse' :: Maybe RecommendationFeedback
recommendationFeedback = Maybe RecommendationFeedback
a} :: DescribeRecommendationFeedbackResponse)
describeRecommendationFeedbackResponse_httpStatus :: Lens.Lens' DescribeRecommendationFeedbackResponse Prelude.Int
describeRecommendationFeedbackResponse_httpStatus :: (Int -> f Int)
-> DescribeRecommendationFeedbackResponse
-> f DescribeRecommendationFeedbackResponse
describeRecommendationFeedbackResponse_httpStatus = (DescribeRecommendationFeedbackResponse -> Int)
-> (DescribeRecommendationFeedbackResponse
-> Int -> DescribeRecommendationFeedbackResponse)
-> Lens
DescribeRecommendationFeedbackResponse
DescribeRecommendationFeedbackResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRecommendationFeedbackResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeRecommendationFeedbackResponse' :: DescribeRecommendationFeedbackResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeRecommendationFeedbackResponse
s@DescribeRecommendationFeedbackResponse' {} Int
a -> DescribeRecommendationFeedbackResponse
s {$sel:httpStatus:DescribeRecommendationFeedbackResponse' :: Int
httpStatus = Int
a} :: DescribeRecommendationFeedbackResponse)
instance
Prelude.NFData
DescribeRecommendationFeedbackResponse