{-# 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.Metrics where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Metrics = Metrics'
{
Metrics -> Maybe Integer
findingsCount :: Prelude.Maybe Prelude.Integer,
Metrics -> Maybe Integer
meteredLinesOfCodeCount :: Prelude.Maybe Prelude.Integer
}
deriving (Metrics -> Metrics -> Bool
(Metrics -> Metrics -> Bool)
-> (Metrics -> Metrics -> Bool) -> Eq Metrics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Metrics -> Metrics -> Bool
$c/= :: Metrics -> Metrics -> Bool
== :: Metrics -> Metrics -> Bool
$c== :: Metrics -> Metrics -> Bool
Prelude.Eq, ReadPrec [Metrics]
ReadPrec Metrics
Int -> ReadS Metrics
ReadS [Metrics]
(Int -> ReadS Metrics)
-> ReadS [Metrics]
-> ReadPrec Metrics
-> ReadPrec [Metrics]
-> Read Metrics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Metrics]
$creadListPrec :: ReadPrec [Metrics]
readPrec :: ReadPrec Metrics
$creadPrec :: ReadPrec Metrics
readList :: ReadS [Metrics]
$creadList :: ReadS [Metrics]
readsPrec :: Int -> ReadS Metrics
$creadsPrec :: Int -> ReadS Metrics
Prelude.Read, Int -> Metrics -> ShowS
[Metrics] -> ShowS
Metrics -> String
(Int -> Metrics -> ShowS)
-> (Metrics -> String) -> ([Metrics] -> ShowS) -> Show Metrics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Metrics] -> ShowS
$cshowList :: [Metrics] -> ShowS
show :: Metrics -> String
$cshow :: Metrics -> String
showsPrec :: Int -> Metrics -> ShowS
$cshowsPrec :: Int -> Metrics -> ShowS
Prelude.Show, (forall x. Metrics -> Rep Metrics x)
-> (forall x. Rep Metrics x -> Metrics) -> Generic Metrics
forall x. Rep Metrics x -> Metrics
forall x. Metrics -> Rep Metrics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Metrics x -> Metrics
$cfrom :: forall x. Metrics -> Rep Metrics x
Prelude.Generic)
newMetrics ::
Metrics
newMetrics :: Metrics
newMetrics =
Metrics' :: Maybe Integer -> Maybe Integer -> Metrics
Metrics'
{ $sel:findingsCount:Metrics' :: Maybe Integer
findingsCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:meteredLinesOfCodeCount:Metrics' :: Maybe Integer
meteredLinesOfCodeCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing
}
metrics_findingsCount :: Lens.Lens' Metrics (Prelude.Maybe Prelude.Integer)
metrics_findingsCount :: (Maybe Integer -> f (Maybe Integer)) -> Metrics -> f Metrics
metrics_findingsCount = (Metrics -> Maybe Integer)
-> (Metrics -> Maybe Integer -> Metrics)
-> Lens Metrics Metrics (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Metrics' {Maybe Integer
findingsCount :: Maybe Integer
$sel:findingsCount:Metrics' :: Metrics -> Maybe Integer
findingsCount} -> Maybe Integer
findingsCount) (\s :: Metrics
s@Metrics' {} Maybe Integer
a -> Metrics
s {$sel:findingsCount:Metrics' :: Maybe Integer
findingsCount = Maybe Integer
a} :: Metrics)
metrics_meteredLinesOfCodeCount :: Lens.Lens' Metrics (Prelude.Maybe Prelude.Integer)
metrics_meteredLinesOfCodeCount :: (Maybe Integer -> f (Maybe Integer)) -> Metrics -> f Metrics
metrics_meteredLinesOfCodeCount = (Metrics -> Maybe Integer)
-> (Metrics -> Maybe Integer -> Metrics)
-> Lens Metrics Metrics (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Metrics' {Maybe Integer
meteredLinesOfCodeCount :: Maybe Integer
$sel:meteredLinesOfCodeCount:Metrics' :: Metrics -> Maybe Integer
meteredLinesOfCodeCount} -> Maybe Integer
meteredLinesOfCodeCount) (\s :: Metrics
s@Metrics' {} Maybe Integer
a -> Metrics
s {$sel:meteredLinesOfCodeCount:Metrics' :: Maybe Integer
meteredLinesOfCodeCount = Maybe Integer
a} :: Metrics)
instance Core.FromJSON Metrics where
parseJSON :: Value -> Parser Metrics
parseJSON =
String -> (Object -> Parser Metrics) -> Value -> Parser Metrics
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Metrics"
( \Object
x ->
Maybe Integer -> Maybe Integer -> Metrics
Metrics'
(Maybe Integer -> Maybe Integer -> Metrics)
-> Parser (Maybe Integer) -> Parser (Maybe Integer -> Metrics)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FindingsCount")
Parser (Maybe Integer -> Metrics)
-> Parser (Maybe Integer) -> Parser Metrics
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MeteredLinesOfCodeCount")
)
instance Prelude.Hashable Metrics
instance Prelude.NFData Metrics