{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CodeGuruReviewer.Types.RecommendationSummary where
import Amazonka.CodeGuruReviewer.Types.RecommendationCategory
import Amazonka.CodeGuruReviewer.Types.RuleMetadata
import Amazonka.CodeGuruReviewer.Types.Severity
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RecommendationSummary = RecommendationSummary'
{
RecommendationSummary -> Maybe Text
recommendationId :: Prelude.Maybe Prelude.Text,
RecommendationSummary -> Maybe Text
filePath :: Prelude.Maybe Prelude.Text,
RecommendationSummary -> Maybe Severity
severity :: Prelude.Maybe Severity,
RecommendationSummary -> Maybe RuleMetadata
ruleMetadata :: Prelude.Maybe RuleMetadata,
RecommendationSummary -> Maybe Int
startLine :: Prelude.Maybe Prelude.Int,
RecommendationSummary -> Maybe Int
endLine :: Prelude.Maybe Prelude.Int,
RecommendationSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
RecommendationSummary -> Maybe RecommendationCategory
recommendationCategory :: Prelude.Maybe RecommendationCategory
}
deriving (RecommendationSummary -> RecommendationSummary -> Bool
(RecommendationSummary -> RecommendationSummary -> Bool)
-> (RecommendationSummary -> RecommendationSummary -> Bool)
-> Eq RecommendationSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecommendationSummary -> RecommendationSummary -> Bool
$c/= :: RecommendationSummary -> RecommendationSummary -> Bool
== :: RecommendationSummary -> RecommendationSummary -> Bool
$c== :: RecommendationSummary -> RecommendationSummary -> Bool
Prelude.Eq, ReadPrec [RecommendationSummary]
ReadPrec RecommendationSummary
Int -> ReadS RecommendationSummary
ReadS [RecommendationSummary]
(Int -> ReadS RecommendationSummary)
-> ReadS [RecommendationSummary]
-> ReadPrec RecommendationSummary
-> ReadPrec [RecommendationSummary]
-> Read RecommendationSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecommendationSummary]
$creadListPrec :: ReadPrec [RecommendationSummary]
readPrec :: ReadPrec RecommendationSummary
$creadPrec :: ReadPrec RecommendationSummary
readList :: ReadS [RecommendationSummary]
$creadList :: ReadS [RecommendationSummary]
readsPrec :: Int -> ReadS RecommendationSummary
$creadsPrec :: Int -> ReadS RecommendationSummary
Prelude.Read, Int -> RecommendationSummary -> ShowS
[RecommendationSummary] -> ShowS
RecommendationSummary -> String
(Int -> RecommendationSummary -> ShowS)
-> (RecommendationSummary -> String)
-> ([RecommendationSummary] -> ShowS)
-> Show RecommendationSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecommendationSummary] -> ShowS
$cshowList :: [RecommendationSummary] -> ShowS
show :: RecommendationSummary -> String
$cshow :: RecommendationSummary -> String
showsPrec :: Int -> RecommendationSummary -> ShowS
$cshowsPrec :: Int -> RecommendationSummary -> ShowS
Prelude.Show, (forall x. RecommendationSummary -> Rep RecommendationSummary x)
-> (forall x. Rep RecommendationSummary x -> RecommendationSummary)
-> Generic RecommendationSummary
forall x. Rep RecommendationSummary x -> RecommendationSummary
forall x. RecommendationSummary -> Rep RecommendationSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RecommendationSummary x -> RecommendationSummary
$cfrom :: forall x. RecommendationSummary -> Rep RecommendationSummary x
Prelude.Generic)
newRecommendationSummary ::
RecommendationSummary
newRecommendationSummary :: RecommendationSummary
newRecommendationSummary =
RecommendationSummary' :: Maybe Text
-> Maybe Text
-> Maybe Severity
-> Maybe RuleMetadata
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe RecommendationCategory
-> RecommendationSummary
RecommendationSummary'
{ $sel:recommendationId:RecommendationSummary' :: Maybe Text
recommendationId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:filePath:RecommendationSummary' :: Maybe Text
filePath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:severity:RecommendationSummary' :: Maybe Severity
severity = Maybe Severity
forall a. Maybe a
Prelude.Nothing,
$sel:ruleMetadata:RecommendationSummary' :: Maybe RuleMetadata
ruleMetadata = Maybe RuleMetadata
forall a. Maybe a
Prelude.Nothing,
$sel:startLine:RecommendationSummary' :: Maybe Int
startLine = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:endLine:RecommendationSummary' :: Maybe Int
endLine = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:description:RecommendationSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:recommendationCategory:RecommendationSummary' :: Maybe RecommendationCategory
recommendationCategory = Maybe RecommendationCategory
forall a. Maybe a
Prelude.Nothing
}
recommendationSummary_recommendationId :: Lens.Lens' RecommendationSummary (Prelude.Maybe Prelude.Text)
recommendationSummary_recommendationId :: (Maybe Text -> f (Maybe Text))
-> RecommendationSummary -> f RecommendationSummary
recommendationSummary_recommendationId = (RecommendationSummary -> Maybe Text)
-> (RecommendationSummary -> Maybe Text -> RecommendationSummary)
-> Lens
RecommendationSummary
RecommendationSummary
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationSummary' {Maybe Text
recommendationId :: Maybe Text
$sel:recommendationId:RecommendationSummary' :: RecommendationSummary -> Maybe Text
recommendationId} -> Maybe Text
recommendationId) (\s :: RecommendationSummary
s@RecommendationSummary' {} Maybe Text
a -> RecommendationSummary
s {$sel:recommendationId:RecommendationSummary' :: Maybe Text
recommendationId = Maybe Text
a} :: RecommendationSummary)
recommendationSummary_filePath :: Lens.Lens' RecommendationSummary (Prelude.Maybe Prelude.Text)
recommendationSummary_filePath :: (Maybe Text -> f (Maybe Text))
-> RecommendationSummary -> f RecommendationSummary
recommendationSummary_filePath = (RecommendationSummary -> Maybe Text)
-> (RecommendationSummary -> Maybe Text -> RecommendationSummary)
-> Lens
RecommendationSummary
RecommendationSummary
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationSummary' {Maybe Text
filePath :: Maybe Text
$sel:filePath:RecommendationSummary' :: RecommendationSummary -> Maybe Text
filePath} -> Maybe Text
filePath) (\s :: RecommendationSummary
s@RecommendationSummary' {} Maybe Text
a -> RecommendationSummary
s {$sel:filePath:RecommendationSummary' :: Maybe Text
filePath = Maybe Text
a} :: RecommendationSummary)
recommendationSummary_severity :: Lens.Lens' RecommendationSummary (Prelude.Maybe Severity)
recommendationSummary_severity :: (Maybe Severity -> f (Maybe Severity))
-> RecommendationSummary -> f RecommendationSummary
recommendationSummary_severity = (RecommendationSummary -> Maybe Severity)
-> (RecommendationSummary
-> Maybe Severity -> RecommendationSummary)
-> Lens
RecommendationSummary
RecommendationSummary
(Maybe Severity)
(Maybe Severity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationSummary' {Maybe Severity
severity :: Maybe Severity
$sel:severity:RecommendationSummary' :: RecommendationSummary -> Maybe Severity
severity} -> Maybe Severity
severity) (\s :: RecommendationSummary
s@RecommendationSummary' {} Maybe Severity
a -> RecommendationSummary
s {$sel:severity:RecommendationSummary' :: Maybe Severity
severity = Maybe Severity
a} :: RecommendationSummary)
recommendationSummary_ruleMetadata :: Lens.Lens' RecommendationSummary (Prelude.Maybe RuleMetadata)
recommendationSummary_ruleMetadata :: (Maybe RuleMetadata -> f (Maybe RuleMetadata))
-> RecommendationSummary -> f RecommendationSummary
recommendationSummary_ruleMetadata = (RecommendationSummary -> Maybe RuleMetadata)
-> (RecommendationSummary
-> Maybe RuleMetadata -> RecommendationSummary)
-> Lens
RecommendationSummary
RecommendationSummary
(Maybe RuleMetadata)
(Maybe RuleMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationSummary' {Maybe RuleMetadata
ruleMetadata :: Maybe RuleMetadata
$sel:ruleMetadata:RecommendationSummary' :: RecommendationSummary -> Maybe RuleMetadata
ruleMetadata} -> Maybe RuleMetadata
ruleMetadata) (\s :: RecommendationSummary
s@RecommendationSummary' {} Maybe RuleMetadata
a -> RecommendationSummary
s {$sel:ruleMetadata:RecommendationSummary' :: Maybe RuleMetadata
ruleMetadata = Maybe RuleMetadata
a} :: RecommendationSummary)
recommendationSummary_startLine :: Lens.Lens' RecommendationSummary (Prelude.Maybe Prelude.Int)
recommendationSummary_startLine :: (Maybe Int -> f (Maybe Int))
-> RecommendationSummary -> f RecommendationSummary
recommendationSummary_startLine = (RecommendationSummary -> Maybe Int)
-> (RecommendationSummary -> Maybe Int -> RecommendationSummary)
-> Lens
RecommendationSummary RecommendationSummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationSummary' {Maybe Int
startLine :: Maybe Int
$sel:startLine:RecommendationSummary' :: RecommendationSummary -> Maybe Int
startLine} -> Maybe Int
startLine) (\s :: RecommendationSummary
s@RecommendationSummary' {} Maybe Int
a -> RecommendationSummary
s {$sel:startLine:RecommendationSummary' :: Maybe Int
startLine = Maybe Int
a} :: RecommendationSummary)
recommendationSummary_endLine :: Lens.Lens' RecommendationSummary (Prelude.Maybe Prelude.Int)
recommendationSummary_endLine :: (Maybe Int -> f (Maybe Int))
-> RecommendationSummary -> f RecommendationSummary
recommendationSummary_endLine = (RecommendationSummary -> Maybe Int)
-> (RecommendationSummary -> Maybe Int -> RecommendationSummary)
-> Lens
RecommendationSummary RecommendationSummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationSummary' {Maybe Int
endLine :: Maybe Int
$sel:endLine:RecommendationSummary' :: RecommendationSummary -> Maybe Int
endLine} -> Maybe Int
endLine) (\s :: RecommendationSummary
s@RecommendationSummary' {} Maybe Int
a -> RecommendationSummary
s {$sel:endLine:RecommendationSummary' :: Maybe Int
endLine = Maybe Int
a} :: RecommendationSummary)
recommendationSummary_description :: Lens.Lens' RecommendationSummary (Prelude.Maybe Prelude.Text)
recommendationSummary_description :: (Maybe Text -> f (Maybe Text))
-> RecommendationSummary -> f RecommendationSummary
recommendationSummary_description = (RecommendationSummary -> Maybe Text)
-> (RecommendationSummary -> Maybe Text -> RecommendationSummary)
-> Lens
RecommendationSummary
RecommendationSummary
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationSummary' {Maybe Text
description :: Maybe Text
$sel:description:RecommendationSummary' :: RecommendationSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: RecommendationSummary
s@RecommendationSummary' {} Maybe Text
a -> RecommendationSummary
s {$sel:description:RecommendationSummary' :: Maybe Text
description = Maybe Text
a} :: RecommendationSummary)
recommendationSummary_recommendationCategory :: Lens.Lens' RecommendationSummary (Prelude.Maybe RecommendationCategory)
recommendationSummary_recommendationCategory :: (Maybe RecommendationCategory -> f (Maybe RecommendationCategory))
-> RecommendationSummary -> f RecommendationSummary
recommendationSummary_recommendationCategory = (RecommendationSummary -> Maybe RecommendationCategory)
-> (RecommendationSummary
-> Maybe RecommendationCategory -> RecommendationSummary)
-> Lens
RecommendationSummary
RecommendationSummary
(Maybe RecommendationCategory)
(Maybe RecommendationCategory)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationSummary' {Maybe RecommendationCategory
recommendationCategory :: Maybe RecommendationCategory
$sel:recommendationCategory:RecommendationSummary' :: RecommendationSummary -> Maybe RecommendationCategory
recommendationCategory} -> Maybe RecommendationCategory
recommendationCategory) (\s :: RecommendationSummary
s@RecommendationSummary' {} Maybe RecommendationCategory
a -> RecommendationSummary
s {$sel:recommendationCategory:RecommendationSummary' :: Maybe RecommendationCategory
recommendationCategory = Maybe RecommendationCategory
a} :: RecommendationSummary)
instance Core.FromJSON RecommendationSummary where
parseJSON :: Value -> Parser RecommendationSummary
parseJSON =
String
-> (Object -> Parser RecommendationSummary)
-> Value
-> Parser RecommendationSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RecommendationSummary"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Severity
-> Maybe RuleMetadata
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe RecommendationCategory
-> RecommendationSummary
RecommendationSummary'
(Maybe Text
-> Maybe Text
-> Maybe Severity
-> Maybe RuleMetadata
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe RecommendationCategory
-> RecommendationSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Severity
-> Maybe RuleMetadata
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe RecommendationCategory
-> RecommendationSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RecommendationId")
Parser
(Maybe Text
-> Maybe Severity
-> Maybe RuleMetadata
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe RecommendationCategory
-> RecommendationSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Severity
-> Maybe RuleMetadata
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe RecommendationCategory
-> RecommendationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FilePath")
Parser
(Maybe Severity
-> Maybe RuleMetadata
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe RecommendationCategory
-> RecommendationSummary)
-> Parser (Maybe Severity)
-> Parser
(Maybe RuleMetadata
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe RecommendationCategory
-> RecommendationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Severity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Severity")
Parser
(Maybe RuleMetadata
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe RecommendationCategory
-> RecommendationSummary)
-> Parser (Maybe RuleMetadata)
-> Parser
(Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe RecommendationCategory
-> RecommendationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RuleMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RuleMetadata")
Parser
(Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe RecommendationCategory
-> RecommendationSummary)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe Text
-> Maybe RecommendationCategory
-> RecommendationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StartLine")
Parser
(Maybe Int
-> Maybe Text
-> Maybe RecommendationCategory
-> RecommendationSummary)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> Maybe RecommendationCategory -> RecommendationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndLine")
Parser
(Maybe Text
-> Maybe RecommendationCategory -> RecommendationSummary)
-> Parser (Maybe Text)
-> Parser (Maybe RecommendationCategory -> RecommendationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
Parser (Maybe RecommendationCategory -> RecommendationSummary)
-> Parser (Maybe RecommendationCategory)
-> Parser RecommendationSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RecommendationCategory)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RecommendationCategory")
)
instance Prelude.Hashable RecommendationSummary
instance Prelude.NFData RecommendationSummary