{-# 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.DescribeCodeReview
(
DescribeCodeReview (..),
newDescribeCodeReview,
describeCodeReview_codeReviewArn,
DescribeCodeReviewResponse (..),
newDescribeCodeReviewResponse,
describeCodeReviewResponse_codeReview,
describeCodeReviewResponse_httpStatus,
)
where
import Amazonka.CodeGuruReviewer.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 DescribeCodeReview = DescribeCodeReview'
{
DescribeCodeReview -> Text
codeReviewArn :: Prelude.Text
}
deriving (DescribeCodeReview -> DescribeCodeReview -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCodeReview -> DescribeCodeReview -> Bool
$c/= :: DescribeCodeReview -> DescribeCodeReview -> Bool
== :: DescribeCodeReview -> DescribeCodeReview -> Bool
$c== :: DescribeCodeReview -> DescribeCodeReview -> Bool
Prelude.Eq, ReadPrec [DescribeCodeReview]
ReadPrec DescribeCodeReview
Int -> ReadS DescribeCodeReview
ReadS [DescribeCodeReview]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCodeReview]
$creadListPrec :: ReadPrec [DescribeCodeReview]
readPrec :: ReadPrec DescribeCodeReview
$creadPrec :: ReadPrec DescribeCodeReview
readList :: ReadS [DescribeCodeReview]
$creadList :: ReadS [DescribeCodeReview]
readsPrec :: Int -> ReadS DescribeCodeReview
$creadsPrec :: Int -> ReadS DescribeCodeReview
Prelude.Read, Int -> DescribeCodeReview -> ShowS
[DescribeCodeReview] -> ShowS
DescribeCodeReview -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCodeReview] -> ShowS
$cshowList :: [DescribeCodeReview] -> ShowS
show :: DescribeCodeReview -> String
$cshow :: DescribeCodeReview -> String
showsPrec :: Int -> DescribeCodeReview -> ShowS
$cshowsPrec :: Int -> DescribeCodeReview -> ShowS
Prelude.Show, forall x. Rep DescribeCodeReview x -> DescribeCodeReview
forall x. DescribeCodeReview -> Rep DescribeCodeReview x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeCodeReview x -> DescribeCodeReview
$cfrom :: forall x. DescribeCodeReview -> Rep DescribeCodeReview x
Prelude.Generic)
newDescribeCodeReview ::
Prelude.Text ->
DescribeCodeReview
newDescribeCodeReview :: Text -> DescribeCodeReview
newDescribeCodeReview Text
pCodeReviewArn_ =
DescribeCodeReview'
{ $sel:codeReviewArn:DescribeCodeReview' :: Text
codeReviewArn =
Text
pCodeReviewArn_
}
describeCodeReview_codeReviewArn :: Lens.Lens' DescribeCodeReview Prelude.Text
describeCodeReview_codeReviewArn :: Lens' DescribeCodeReview Text
describeCodeReview_codeReviewArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCodeReview' {Text
codeReviewArn :: Text
$sel:codeReviewArn:DescribeCodeReview' :: DescribeCodeReview -> Text
codeReviewArn} -> Text
codeReviewArn) (\s :: DescribeCodeReview
s@DescribeCodeReview' {} Text
a -> DescribeCodeReview
s {$sel:codeReviewArn:DescribeCodeReview' :: Text
codeReviewArn = Text
a} :: DescribeCodeReview)
instance Core.AWSRequest DescribeCodeReview where
type
AWSResponse DescribeCodeReview =
DescribeCodeReviewResponse
request :: (Service -> Service)
-> DescribeCodeReview -> Request DescribeCodeReview
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeCodeReview
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeCodeReview)))
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 CodeReview -> Int -> DescribeCodeReviewResponse
DescribeCodeReviewResponse'
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
"CodeReview")
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))
)
instance Prelude.Hashable DescribeCodeReview where
hashWithSalt :: Int -> DescribeCodeReview -> Int
hashWithSalt Int
_salt DescribeCodeReview' {Text
codeReviewArn :: Text
$sel:codeReviewArn:DescribeCodeReview' :: DescribeCodeReview -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
codeReviewArn
instance Prelude.NFData DescribeCodeReview where
rnf :: DescribeCodeReview -> ()
rnf DescribeCodeReview' {Text
codeReviewArn :: Text
$sel:codeReviewArn:DescribeCodeReview' :: DescribeCodeReview -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
codeReviewArn
instance Data.ToHeaders DescribeCodeReview where
toHeaders :: DescribeCodeReview -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DescribeCodeReview where
toPath :: DescribeCodeReview -> ByteString
toPath DescribeCodeReview' {Text
codeReviewArn :: Text
$sel:codeReviewArn:DescribeCodeReview' :: DescribeCodeReview -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/codereviews/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
codeReviewArn]
instance Data.ToQuery DescribeCodeReview where
toQuery :: DescribeCodeReview -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DescribeCodeReviewResponse = DescribeCodeReviewResponse'
{
DescribeCodeReviewResponse -> Maybe CodeReview
codeReview :: Prelude.Maybe CodeReview,
DescribeCodeReviewResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeCodeReviewResponse -> DescribeCodeReviewResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCodeReviewResponse -> DescribeCodeReviewResponse -> Bool
$c/= :: DescribeCodeReviewResponse -> DescribeCodeReviewResponse -> Bool
== :: DescribeCodeReviewResponse -> DescribeCodeReviewResponse -> Bool
$c== :: DescribeCodeReviewResponse -> DescribeCodeReviewResponse -> Bool
Prelude.Eq, ReadPrec [DescribeCodeReviewResponse]
ReadPrec DescribeCodeReviewResponse
Int -> ReadS DescribeCodeReviewResponse
ReadS [DescribeCodeReviewResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCodeReviewResponse]
$creadListPrec :: ReadPrec [DescribeCodeReviewResponse]
readPrec :: ReadPrec DescribeCodeReviewResponse
$creadPrec :: ReadPrec DescribeCodeReviewResponse
readList :: ReadS [DescribeCodeReviewResponse]
$creadList :: ReadS [DescribeCodeReviewResponse]
readsPrec :: Int -> ReadS DescribeCodeReviewResponse
$creadsPrec :: Int -> ReadS DescribeCodeReviewResponse
Prelude.Read, Int -> DescribeCodeReviewResponse -> ShowS
[DescribeCodeReviewResponse] -> ShowS
DescribeCodeReviewResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCodeReviewResponse] -> ShowS
$cshowList :: [DescribeCodeReviewResponse] -> ShowS
show :: DescribeCodeReviewResponse -> String
$cshow :: DescribeCodeReviewResponse -> String
showsPrec :: Int -> DescribeCodeReviewResponse -> ShowS
$cshowsPrec :: Int -> DescribeCodeReviewResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeCodeReviewResponse x -> DescribeCodeReviewResponse
forall x.
DescribeCodeReviewResponse -> Rep DescribeCodeReviewResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCodeReviewResponse x -> DescribeCodeReviewResponse
$cfrom :: forall x.
DescribeCodeReviewResponse -> Rep DescribeCodeReviewResponse x
Prelude.Generic)
newDescribeCodeReviewResponse ::
Prelude.Int ->
DescribeCodeReviewResponse
newDescribeCodeReviewResponse :: Int -> DescribeCodeReviewResponse
newDescribeCodeReviewResponse Int
pHttpStatus_ =
DescribeCodeReviewResponse'
{ $sel:codeReview:DescribeCodeReviewResponse' :: Maybe CodeReview
codeReview =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeCodeReviewResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeCodeReviewResponse_codeReview :: Lens.Lens' DescribeCodeReviewResponse (Prelude.Maybe CodeReview)
describeCodeReviewResponse_codeReview :: Lens' DescribeCodeReviewResponse (Maybe CodeReview)
describeCodeReviewResponse_codeReview = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCodeReviewResponse' {Maybe CodeReview
codeReview :: Maybe CodeReview
$sel:codeReview:DescribeCodeReviewResponse' :: DescribeCodeReviewResponse -> Maybe CodeReview
codeReview} -> Maybe CodeReview
codeReview) (\s :: DescribeCodeReviewResponse
s@DescribeCodeReviewResponse' {} Maybe CodeReview
a -> DescribeCodeReviewResponse
s {$sel:codeReview:DescribeCodeReviewResponse' :: Maybe CodeReview
codeReview = Maybe CodeReview
a} :: DescribeCodeReviewResponse)
describeCodeReviewResponse_httpStatus :: Lens.Lens' DescribeCodeReviewResponse Prelude.Int
describeCodeReviewResponse_httpStatus :: Lens' DescribeCodeReviewResponse Int
describeCodeReviewResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCodeReviewResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeCodeReviewResponse' :: DescribeCodeReviewResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeCodeReviewResponse
s@DescribeCodeReviewResponse' {} Int
a -> DescribeCodeReviewResponse
s {$sel:httpStatus:DescribeCodeReviewResponse' :: Int
httpStatus = Int
a} :: DescribeCodeReviewResponse)
instance Prelude.NFData DescribeCodeReviewResponse where
rnf :: DescribeCodeReviewResponse -> ()
rnf DescribeCodeReviewResponse' {Int
Maybe CodeReview
httpStatus :: Int
codeReview :: Maybe CodeReview
$sel:httpStatus:DescribeCodeReviewResponse' :: DescribeCodeReviewResponse -> Int
$sel:codeReview:DescribeCodeReviewResponse' :: DescribeCodeReviewResponse -> Maybe CodeReview
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CodeReview
codeReview
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus