{-# 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.DeviceFarm.Types.Counters where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Counters = Counters'
{
Counters -> Maybe Int
passed :: Prelude.Maybe Prelude.Int,
Counters -> Maybe Int
skipped :: Prelude.Maybe Prelude.Int,
Counters -> Maybe Int
warned :: Prelude.Maybe Prelude.Int,
Counters -> Maybe Int
stopped :: Prelude.Maybe Prelude.Int,
Counters -> Maybe Int
total :: Prelude.Maybe Prelude.Int,
Counters -> Maybe Int
failed :: Prelude.Maybe Prelude.Int,
Counters -> Maybe Int
errored :: Prelude.Maybe Prelude.Int
}
deriving (Counters -> Counters -> Bool
(Counters -> Counters -> Bool)
-> (Counters -> Counters -> Bool) -> Eq Counters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Counters -> Counters -> Bool
$c/= :: Counters -> Counters -> Bool
== :: Counters -> Counters -> Bool
$c== :: Counters -> Counters -> Bool
Prelude.Eq, ReadPrec [Counters]
ReadPrec Counters
Int -> ReadS Counters
ReadS [Counters]
(Int -> ReadS Counters)
-> ReadS [Counters]
-> ReadPrec Counters
-> ReadPrec [Counters]
-> Read Counters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Counters]
$creadListPrec :: ReadPrec [Counters]
readPrec :: ReadPrec Counters
$creadPrec :: ReadPrec Counters
readList :: ReadS [Counters]
$creadList :: ReadS [Counters]
readsPrec :: Int -> ReadS Counters
$creadsPrec :: Int -> ReadS Counters
Prelude.Read, Int -> Counters -> ShowS
[Counters] -> ShowS
Counters -> String
(Int -> Counters -> ShowS)
-> (Counters -> String) -> ([Counters] -> ShowS) -> Show Counters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Counters] -> ShowS
$cshowList :: [Counters] -> ShowS
show :: Counters -> String
$cshow :: Counters -> String
showsPrec :: Int -> Counters -> ShowS
$cshowsPrec :: Int -> Counters -> ShowS
Prelude.Show, (forall x. Counters -> Rep Counters x)
-> (forall x. Rep Counters x -> Counters) -> Generic Counters
forall x. Rep Counters x -> Counters
forall x. Counters -> Rep Counters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Counters x -> Counters
$cfrom :: forall x. Counters -> Rep Counters x
Prelude.Generic)
newCounters ::
Counters
newCounters :: Counters
newCounters =
Counters' :: Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Counters
Counters'
{ $sel:passed:Counters' :: Maybe Int
passed = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:skipped:Counters' :: Maybe Int
skipped = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:warned:Counters' :: Maybe Int
warned = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:stopped:Counters' :: Maybe Int
stopped = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:total:Counters' :: Maybe Int
total = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:failed:Counters' :: Maybe Int
failed = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:errored:Counters' :: Maybe Int
errored = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
counters_passed :: Lens.Lens' Counters (Prelude.Maybe Prelude.Int)
counters_passed :: (Maybe Int -> f (Maybe Int)) -> Counters -> f Counters
counters_passed = (Counters -> Maybe Int)
-> (Counters -> Maybe Int -> Counters)
-> Lens Counters Counters (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Counters' {Maybe Int
passed :: Maybe Int
$sel:passed:Counters' :: Counters -> Maybe Int
passed} -> Maybe Int
passed) (\s :: Counters
s@Counters' {} Maybe Int
a -> Counters
s {$sel:passed:Counters' :: Maybe Int
passed = Maybe Int
a} :: Counters)
counters_skipped :: Lens.Lens' Counters (Prelude.Maybe Prelude.Int)
counters_skipped :: (Maybe Int -> f (Maybe Int)) -> Counters -> f Counters
counters_skipped = (Counters -> Maybe Int)
-> (Counters -> Maybe Int -> Counters)
-> Lens Counters Counters (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Counters' {Maybe Int
skipped :: Maybe Int
$sel:skipped:Counters' :: Counters -> Maybe Int
skipped} -> Maybe Int
skipped) (\s :: Counters
s@Counters' {} Maybe Int
a -> Counters
s {$sel:skipped:Counters' :: Maybe Int
skipped = Maybe Int
a} :: Counters)
counters_warned :: Lens.Lens' Counters (Prelude.Maybe Prelude.Int)
counters_warned :: (Maybe Int -> f (Maybe Int)) -> Counters -> f Counters
counters_warned = (Counters -> Maybe Int)
-> (Counters -> Maybe Int -> Counters)
-> Lens Counters Counters (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Counters' {Maybe Int
warned :: Maybe Int
$sel:warned:Counters' :: Counters -> Maybe Int
warned} -> Maybe Int
warned) (\s :: Counters
s@Counters' {} Maybe Int
a -> Counters
s {$sel:warned:Counters' :: Maybe Int
warned = Maybe Int
a} :: Counters)
counters_stopped :: Lens.Lens' Counters (Prelude.Maybe Prelude.Int)
counters_stopped :: (Maybe Int -> f (Maybe Int)) -> Counters -> f Counters
counters_stopped = (Counters -> Maybe Int)
-> (Counters -> Maybe Int -> Counters)
-> Lens Counters Counters (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Counters' {Maybe Int
stopped :: Maybe Int
$sel:stopped:Counters' :: Counters -> Maybe Int
stopped} -> Maybe Int
stopped) (\s :: Counters
s@Counters' {} Maybe Int
a -> Counters
s {$sel:stopped:Counters' :: Maybe Int
stopped = Maybe Int
a} :: Counters)
counters_total :: Lens.Lens' Counters (Prelude.Maybe Prelude.Int)
counters_total :: (Maybe Int -> f (Maybe Int)) -> Counters -> f Counters
counters_total = (Counters -> Maybe Int)
-> (Counters -> Maybe Int -> Counters)
-> Lens Counters Counters (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Counters' {Maybe Int
total :: Maybe Int
$sel:total:Counters' :: Counters -> Maybe Int
total} -> Maybe Int
total) (\s :: Counters
s@Counters' {} Maybe Int
a -> Counters
s {$sel:total:Counters' :: Maybe Int
total = Maybe Int
a} :: Counters)
counters_failed :: Lens.Lens' Counters (Prelude.Maybe Prelude.Int)
counters_failed :: (Maybe Int -> f (Maybe Int)) -> Counters -> f Counters
counters_failed = (Counters -> Maybe Int)
-> (Counters -> Maybe Int -> Counters)
-> Lens Counters Counters (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Counters' {Maybe Int
failed :: Maybe Int
$sel:failed:Counters' :: Counters -> Maybe Int
failed} -> Maybe Int
failed) (\s :: Counters
s@Counters' {} Maybe Int
a -> Counters
s {$sel:failed:Counters' :: Maybe Int
failed = Maybe Int
a} :: Counters)
counters_errored :: Lens.Lens' Counters (Prelude.Maybe Prelude.Int)
counters_errored :: (Maybe Int -> f (Maybe Int)) -> Counters -> f Counters
counters_errored = (Counters -> Maybe Int)
-> (Counters -> Maybe Int -> Counters)
-> Lens Counters Counters (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Counters' {Maybe Int
errored :: Maybe Int
$sel:errored:Counters' :: Counters -> Maybe Int
errored} -> Maybe Int
errored) (\s :: Counters
s@Counters' {} Maybe Int
a -> Counters
s {$sel:errored:Counters' :: Maybe Int
errored = Maybe Int
a} :: Counters)
instance Core.FromJSON Counters where
parseJSON :: Value -> Parser Counters
parseJSON =
String -> (Object -> Parser Counters) -> Value -> Parser Counters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Counters"
( \Object
x ->
Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Counters
Counters'
(Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Counters)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Counters)
forall (f :: * -> *) a b. Functor 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
"passed")
Parser
(Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Counters)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Counters)
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
"skipped")
Parser
(Maybe Int
-> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Counters)
-> Parser (Maybe Int)
-> Parser
(Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Counters)
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
"warned")
Parser
(Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Counters)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe Int -> Maybe Int -> Counters)
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
"stopped")
Parser (Maybe Int -> Maybe Int -> Maybe Int -> Counters)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe Int -> Counters)
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
"total")
Parser (Maybe Int -> Maybe Int -> Counters)
-> Parser (Maybe Int) -> Parser (Maybe Int -> Counters)
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
"failed")
Parser (Maybe Int -> Counters)
-> Parser (Maybe Int) -> Parser Counters
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
"errored")
)
instance Prelude.Hashable Counters
instance Prelude.NFData Counters