{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data RecommendationSummary = RecommendationSummary'
{
RecommendationSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
RecommendationSummary -> Maybe Int
endLine :: Prelude.Maybe Prelude.Int,
RecommendationSummary -> Maybe Text
filePath :: Prelude.Maybe Prelude.Text,
RecommendationSummary -> Maybe RecommendationCategory
recommendationCategory :: Prelude.Maybe RecommendationCategory,
RecommendationSummary -> Maybe Text
recommendationId :: Prelude.Maybe Prelude.Text,
RecommendationSummary -> Maybe RuleMetadata
ruleMetadata :: Prelude.Maybe RuleMetadata,
RecommendationSummary -> Maybe Severity
severity :: Prelude.Maybe Severity,
RecommendationSummary -> Maybe Int
startLine :: Prelude.Maybe Prelude.Int
}
deriving (RecommendationSummary -> RecommendationSummary -> Bool
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]
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
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. 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'
{ $sel:description:RecommendationSummary' :: Maybe Text
description =
forall a. Maybe a
Prelude.Nothing,
$sel:endLine:RecommendationSummary' :: Maybe Int
endLine = forall a. Maybe a
Prelude.Nothing,
$sel:filePath:RecommendationSummary' :: Maybe Text
filePath = forall a. Maybe a
Prelude.Nothing,
$sel:recommendationCategory:RecommendationSummary' :: Maybe RecommendationCategory
recommendationCategory = forall a. Maybe a
Prelude.Nothing,
$sel:recommendationId:RecommendationSummary' :: Maybe Text
recommendationId = forall a. Maybe a
Prelude.Nothing,
$sel:ruleMetadata:RecommendationSummary' :: Maybe RuleMetadata
ruleMetadata = forall a. Maybe a
Prelude.Nothing,
$sel:severity:RecommendationSummary' :: Maybe Severity
severity = forall a. Maybe a
Prelude.Nothing,
$sel:startLine:RecommendationSummary' :: Maybe Int
startLine = forall a. Maybe a
Prelude.Nothing
}
recommendationSummary_description :: Lens.Lens' RecommendationSummary (Prelude.Maybe Prelude.Text)
recommendationSummary_description :: Lens' RecommendationSummary (Maybe Text)
recommendationSummary_description = 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_endLine :: Lens.Lens' RecommendationSummary (Prelude.Maybe Prelude.Int)
recommendationSummary_endLine :: Lens' RecommendationSummary (Maybe Int)
recommendationSummary_endLine = 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_filePath :: Lens.Lens' RecommendationSummary (Prelude.Maybe Prelude.Text)
recommendationSummary_filePath :: Lens' RecommendationSummary (Maybe Text)
recommendationSummary_filePath = 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_recommendationCategory :: Lens.Lens' RecommendationSummary (Prelude.Maybe RecommendationCategory)
recommendationSummary_recommendationCategory :: Lens' RecommendationSummary (Maybe RecommendationCategory)
recommendationSummary_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)
recommendationSummary_recommendationId :: Lens.Lens' RecommendationSummary (Prelude.Maybe Prelude.Text)
recommendationSummary_recommendationId :: Lens' RecommendationSummary (Maybe Text)
recommendationSummary_recommendationId = 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_ruleMetadata :: Lens.Lens' RecommendationSummary (Prelude.Maybe RuleMetadata)
recommendationSummary_ruleMetadata :: Lens' RecommendationSummary (Maybe RuleMetadata)
recommendationSummary_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_severity :: Lens.Lens' RecommendationSummary (Prelude.Maybe Severity)
recommendationSummary_severity :: Lens' RecommendationSummary (Maybe Severity)
recommendationSummary_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_startLine :: Lens.Lens' RecommendationSummary (Prelude.Maybe Prelude.Int)
recommendationSummary_startLine :: Lens' RecommendationSummary (Maybe Int)
recommendationSummary_startLine = 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)
instance Data.FromJSON RecommendationSummary where
parseJSON :: Value -> Parser RecommendationSummary
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RecommendationSummary"
( \Object
x ->
Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe RecommendationCategory
-> Maybe Text
-> Maybe RuleMetadata
-> Maybe Severity
-> Maybe Int
-> RecommendationSummary
RecommendationSummary'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EndLine")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"FilePath")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RecommendationCategory")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RecommendationId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RuleMetadata")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Severity")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StartLine")
)
instance Prelude.Hashable RecommendationSummary where
hashWithSalt :: Int -> RecommendationSummary -> Int
hashWithSalt Int
_salt RecommendationSummary' {Maybe Int
Maybe Text
Maybe RecommendationCategory
Maybe RuleMetadata
Maybe Severity
startLine :: Maybe Int
severity :: Maybe Severity
ruleMetadata :: Maybe RuleMetadata
recommendationId :: Maybe Text
recommendationCategory :: Maybe RecommendationCategory
filePath :: Maybe Text
endLine :: Maybe Int
description :: Maybe Text
$sel:startLine:RecommendationSummary' :: RecommendationSummary -> Maybe Int
$sel:severity:RecommendationSummary' :: RecommendationSummary -> Maybe Severity
$sel:ruleMetadata:RecommendationSummary' :: RecommendationSummary -> Maybe RuleMetadata
$sel:recommendationId:RecommendationSummary' :: RecommendationSummary -> Maybe Text
$sel:recommendationCategory:RecommendationSummary' :: RecommendationSummary -> Maybe RecommendationCategory
$sel:filePath:RecommendationSummary' :: RecommendationSummary -> Maybe Text
$sel:endLine:RecommendationSummary' :: RecommendationSummary -> Maybe Int
$sel:description:RecommendationSummary' :: RecommendationSummary -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
endLine
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
filePath
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RecommendationCategory
recommendationCategory
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
recommendationId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RuleMetadata
ruleMetadata
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Severity
severity
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
startLine
instance Prelude.NFData RecommendationSummary where
rnf :: RecommendationSummary -> ()
rnf RecommendationSummary' {Maybe Int
Maybe Text
Maybe RecommendationCategory
Maybe RuleMetadata
Maybe Severity
startLine :: Maybe Int
severity :: Maybe Severity
ruleMetadata :: Maybe RuleMetadata
recommendationId :: Maybe Text
recommendationCategory :: Maybe RecommendationCategory
filePath :: Maybe Text
endLine :: Maybe Int
description :: Maybe Text
$sel:startLine:RecommendationSummary' :: RecommendationSummary -> Maybe Int
$sel:severity:RecommendationSummary' :: RecommendationSummary -> Maybe Severity
$sel:ruleMetadata:RecommendationSummary' :: RecommendationSummary -> Maybe RuleMetadata
$sel:recommendationId:RecommendationSummary' :: RecommendationSummary -> Maybe Text
$sel:recommendationCategory:RecommendationSummary' :: RecommendationSummary -> Maybe RecommendationCategory
$sel:filePath:RecommendationSummary' :: RecommendationSummary -> Maybe Text
$sel:endLine:RecommendationSummary' :: RecommendationSummary -> Maybe Int
$sel:description:RecommendationSummary' :: RecommendationSummary -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
endLine
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
filePath
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RecommendationCategory
recommendationCategory
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
recommendationId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RuleMetadata
ruleMetadata
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Severity
severity
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
startLine