{-# 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.CodeBuild.Types.TestReportSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TestReportSummary = TestReportSummary'
{
TestReportSummary -> Int
total :: Prelude.Int,
TestReportSummary -> HashMap Text Int
statusCounts :: Prelude.HashMap Prelude.Text Prelude.Int,
TestReportSummary -> Integer
durationInNanoSeconds :: Prelude.Integer
}
deriving (TestReportSummary -> TestReportSummary -> Bool
(TestReportSummary -> TestReportSummary -> Bool)
-> (TestReportSummary -> TestReportSummary -> Bool)
-> Eq TestReportSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestReportSummary -> TestReportSummary -> Bool
$c/= :: TestReportSummary -> TestReportSummary -> Bool
== :: TestReportSummary -> TestReportSummary -> Bool
$c== :: TestReportSummary -> TestReportSummary -> Bool
Prelude.Eq, ReadPrec [TestReportSummary]
ReadPrec TestReportSummary
Int -> ReadS TestReportSummary
ReadS [TestReportSummary]
(Int -> ReadS TestReportSummary)
-> ReadS [TestReportSummary]
-> ReadPrec TestReportSummary
-> ReadPrec [TestReportSummary]
-> Read TestReportSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TestReportSummary]
$creadListPrec :: ReadPrec [TestReportSummary]
readPrec :: ReadPrec TestReportSummary
$creadPrec :: ReadPrec TestReportSummary
readList :: ReadS [TestReportSummary]
$creadList :: ReadS [TestReportSummary]
readsPrec :: Int -> ReadS TestReportSummary
$creadsPrec :: Int -> ReadS TestReportSummary
Prelude.Read, Int -> TestReportSummary -> ShowS
[TestReportSummary] -> ShowS
TestReportSummary -> String
(Int -> TestReportSummary -> ShowS)
-> (TestReportSummary -> String)
-> ([TestReportSummary] -> ShowS)
-> Show TestReportSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestReportSummary] -> ShowS
$cshowList :: [TestReportSummary] -> ShowS
show :: TestReportSummary -> String
$cshow :: TestReportSummary -> String
showsPrec :: Int -> TestReportSummary -> ShowS
$cshowsPrec :: Int -> TestReportSummary -> ShowS
Prelude.Show, (forall x. TestReportSummary -> Rep TestReportSummary x)
-> (forall x. Rep TestReportSummary x -> TestReportSummary)
-> Generic TestReportSummary
forall x. Rep TestReportSummary x -> TestReportSummary
forall x. TestReportSummary -> Rep TestReportSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TestReportSummary x -> TestReportSummary
$cfrom :: forall x. TestReportSummary -> Rep TestReportSummary x
Prelude.Generic)
newTestReportSummary ::
Prelude.Int ->
Prelude.Integer ->
TestReportSummary
newTestReportSummary :: Int -> Integer -> TestReportSummary
newTestReportSummary Int
pTotal_ Integer
pDurationInNanoSeconds_ =
TestReportSummary' :: Int -> HashMap Text Int -> Integer -> TestReportSummary
TestReportSummary'
{ $sel:total:TestReportSummary' :: Int
total = Int
pTotal_,
$sel:statusCounts:TestReportSummary' :: HashMap Text Int
statusCounts = HashMap Text Int
forall a. Monoid a => a
Prelude.mempty,
$sel:durationInNanoSeconds:TestReportSummary' :: Integer
durationInNanoSeconds = Integer
pDurationInNanoSeconds_
}
testReportSummary_total :: Lens.Lens' TestReportSummary Prelude.Int
testReportSummary_total :: (Int -> f Int) -> TestReportSummary -> f TestReportSummary
testReportSummary_total = (TestReportSummary -> Int)
-> (TestReportSummary -> Int -> TestReportSummary)
-> Lens TestReportSummary TestReportSummary Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestReportSummary' {Int
total :: Int
$sel:total:TestReportSummary' :: TestReportSummary -> Int
total} -> Int
total) (\s :: TestReportSummary
s@TestReportSummary' {} Int
a -> TestReportSummary
s {$sel:total:TestReportSummary' :: Int
total = Int
a} :: TestReportSummary)
testReportSummary_statusCounts :: Lens.Lens' TestReportSummary (Prelude.HashMap Prelude.Text Prelude.Int)
testReportSummary_statusCounts :: (HashMap Text Int -> f (HashMap Text Int))
-> TestReportSummary -> f TestReportSummary
testReportSummary_statusCounts = (TestReportSummary -> HashMap Text Int)
-> (TestReportSummary -> HashMap Text Int -> TestReportSummary)
-> Lens
TestReportSummary
TestReportSummary
(HashMap Text Int)
(HashMap Text Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestReportSummary' {HashMap Text Int
statusCounts :: HashMap Text Int
$sel:statusCounts:TestReportSummary' :: TestReportSummary -> HashMap Text Int
statusCounts} -> HashMap Text Int
statusCounts) (\s :: TestReportSummary
s@TestReportSummary' {} HashMap Text Int
a -> TestReportSummary
s {$sel:statusCounts:TestReportSummary' :: HashMap Text Int
statusCounts = HashMap Text Int
a} :: TestReportSummary) ((HashMap Text Int -> f (HashMap Text Int))
-> TestReportSummary -> f TestReportSummary)
-> ((HashMap Text Int -> f (HashMap Text Int))
-> HashMap Text Int -> f (HashMap Text Int))
-> (HashMap Text Int -> f (HashMap Text Int))
-> TestReportSummary
-> f TestReportSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text Int -> f (HashMap Text Int))
-> HashMap Text Int -> f (HashMap Text Int)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
testReportSummary_durationInNanoSeconds :: Lens.Lens' TestReportSummary Prelude.Integer
testReportSummary_durationInNanoSeconds :: (Integer -> f Integer) -> TestReportSummary -> f TestReportSummary
testReportSummary_durationInNanoSeconds = (TestReportSummary -> Integer)
-> (TestReportSummary -> Integer -> TestReportSummary)
-> Lens TestReportSummary TestReportSummary Integer Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestReportSummary' {Integer
durationInNanoSeconds :: Integer
$sel:durationInNanoSeconds:TestReportSummary' :: TestReportSummary -> Integer
durationInNanoSeconds} -> Integer
durationInNanoSeconds) (\s :: TestReportSummary
s@TestReportSummary' {} Integer
a -> TestReportSummary
s {$sel:durationInNanoSeconds:TestReportSummary' :: Integer
durationInNanoSeconds = Integer
a} :: TestReportSummary)
instance Core.FromJSON TestReportSummary where
parseJSON :: Value -> Parser TestReportSummary
parseJSON =
String
-> (Object -> Parser TestReportSummary)
-> Value
-> Parser TestReportSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TestReportSummary"
( \Object
x ->
Int -> HashMap Text Int -> Integer -> TestReportSummary
TestReportSummary'
(Int -> HashMap Text Int -> Integer -> TestReportSummary)
-> Parser Int
-> Parser (HashMap Text Int -> Integer -> TestReportSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"total")
Parser (HashMap Text Int -> Integer -> TestReportSummary)
-> Parser (HashMap Text Int)
-> Parser (Integer -> TestReportSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (HashMap Text Int))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"statusCounts" Parser (Maybe (HashMap Text Int))
-> HashMap Text Int -> Parser (HashMap Text Int)
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= HashMap Text Int
forall a. Monoid a => a
Prelude.mempty)
Parser (Integer -> TestReportSummary)
-> Parser Integer -> Parser TestReportSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Integer
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"durationInNanoSeconds")
)
instance Prelude.Hashable TestReportSummary
instance Prelude.NFData TestReportSummary