{-# 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.SSM.Types.ProgressCounters where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ProgressCounters = ProgressCounters'
{
ProgressCounters -> Maybe Int
failedSteps :: Prelude.Maybe Prelude.Int,
ProgressCounters -> Maybe Int
cancelledSteps :: Prelude.Maybe Prelude.Int,
ProgressCounters -> Maybe Int
successSteps :: Prelude.Maybe Prelude.Int,
ProgressCounters -> Maybe Int
totalSteps :: Prelude.Maybe Prelude.Int,
ProgressCounters -> Maybe Int
timedOutSteps :: Prelude.Maybe Prelude.Int
}
deriving (ProgressCounters -> ProgressCounters -> Bool
(ProgressCounters -> ProgressCounters -> Bool)
-> (ProgressCounters -> ProgressCounters -> Bool)
-> Eq ProgressCounters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProgressCounters -> ProgressCounters -> Bool
$c/= :: ProgressCounters -> ProgressCounters -> Bool
== :: ProgressCounters -> ProgressCounters -> Bool
$c== :: ProgressCounters -> ProgressCounters -> Bool
Prelude.Eq, ReadPrec [ProgressCounters]
ReadPrec ProgressCounters
Int -> ReadS ProgressCounters
ReadS [ProgressCounters]
(Int -> ReadS ProgressCounters)
-> ReadS [ProgressCounters]
-> ReadPrec ProgressCounters
-> ReadPrec [ProgressCounters]
-> Read ProgressCounters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProgressCounters]
$creadListPrec :: ReadPrec [ProgressCounters]
readPrec :: ReadPrec ProgressCounters
$creadPrec :: ReadPrec ProgressCounters
readList :: ReadS [ProgressCounters]
$creadList :: ReadS [ProgressCounters]
readsPrec :: Int -> ReadS ProgressCounters
$creadsPrec :: Int -> ReadS ProgressCounters
Prelude.Read, Int -> ProgressCounters -> ShowS
[ProgressCounters] -> ShowS
ProgressCounters -> String
(Int -> ProgressCounters -> ShowS)
-> (ProgressCounters -> String)
-> ([ProgressCounters] -> ShowS)
-> Show ProgressCounters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProgressCounters] -> ShowS
$cshowList :: [ProgressCounters] -> ShowS
show :: ProgressCounters -> String
$cshow :: ProgressCounters -> String
showsPrec :: Int -> ProgressCounters -> ShowS
$cshowsPrec :: Int -> ProgressCounters -> ShowS
Prelude.Show, (forall x. ProgressCounters -> Rep ProgressCounters x)
-> (forall x. Rep ProgressCounters x -> ProgressCounters)
-> Generic ProgressCounters
forall x. Rep ProgressCounters x -> ProgressCounters
forall x. ProgressCounters -> Rep ProgressCounters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProgressCounters x -> ProgressCounters
$cfrom :: forall x. ProgressCounters -> Rep ProgressCounters x
Prelude.Generic)
newProgressCounters ::
ProgressCounters
newProgressCounters :: ProgressCounters
newProgressCounters =
ProgressCounters' :: Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> ProgressCounters
ProgressCounters'
{ $sel:failedSteps:ProgressCounters' :: Maybe Int
failedSteps = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:cancelledSteps:ProgressCounters' :: Maybe Int
cancelledSteps = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:successSteps:ProgressCounters' :: Maybe Int
successSteps = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:totalSteps:ProgressCounters' :: Maybe Int
totalSteps = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:timedOutSteps:ProgressCounters' :: Maybe Int
timedOutSteps = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
progressCounters_failedSteps :: Lens.Lens' ProgressCounters (Prelude.Maybe Prelude.Int)
progressCounters_failedSteps :: (Maybe Int -> f (Maybe Int))
-> ProgressCounters -> f ProgressCounters
progressCounters_failedSteps = (ProgressCounters -> Maybe Int)
-> (ProgressCounters -> Maybe Int -> ProgressCounters)
-> Lens ProgressCounters ProgressCounters (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProgressCounters' {Maybe Int
failedSteps :: Maybe Int
$sel:failedSteps:ProgressCounters' :: ProgressCounters -> Maybe Int
failedSteps} -> Maybe Int
failedSteps) (\s :: ProgressCounters
s@ProgressCounters' {} Maybe Int
a -> ProgressCounters
s {$sel:failedSteps:ProgressCounters' :: Maybe Int
failedSteps = Maybe Int
a} :: ProgressCounters)
progressCounters_cancelledSteps :: Lens.Lens' ProgressCounters (Prelude.Maybe Prelude.Int)
progressCounters_cancelledSteps :: (Maybe Int -> f (Maybe Int))
-> ProgressCounters -> f ProgressCounters
progressCounters_cancelledSteps = (ProgressCounters -> Maybe Int)
-> (ProgressCounters -> Maybe Int -> ProgressCounters)
-> Lens ProgressCounters ProgressCounters (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProgressCounters' {Maybe Int
cancelledSteps :: Maybe Int
$sel:cancelledSteps:ProgressCounters' :: ProgressCounters -> Maybe Int
cancelledSteps} -> Maybe Int
cancelledSteps) (\s :: ProgressCounters
s@ProgressCounters' {} Maybe Int
a -> ProgressCounters
s {$sel:cancelledSteps:ProgressCounters' :: Maybe Int
cancelledSteps = Maybe Int
a} :: ProgressCounters)
progressCounters_successSteps :: Lens.Lens' ProgressCounters (Prelude.Maybe Prelude.Int)
progressCounters_successSteps :: (Maybe Int -> f (Maybe Int))
-> ProgressCounters -> f ProgressCounters
progressCounters_successSteps = (ProgressCounters -> Maybe Int)
-> (ProgressCounters -> Maybe Int -> ProgressCounters)
-> Lens ProgressCounters ProgressCounters (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProgressCounters' {Maybe Int
successSteps :: Maybe Int
$sel:successSteps:ProgressCounters' :: ProgressCounters -> Maybe Int
successSteps} -> Maybe Int
successSteps) (\s :: ProgressCounters
s@ProgressCounters' {} Maybe Int
a -> ProgressCounters
s {$sel:successSteps:ProgressCounters' :: Maybe Int
successSteps = Maybe Int
a} :: ProgressCounters)
progressCounters_totalSteps :: Lens.Lens' ProgressCounters (Prelude.Maybe Prelude.Int)
progressCounters_totalSteps :: (Maybe Int -> f (Maybe Int))
-> ProgressCounters -> f ProgressCounters
progressCounters_totalSteps = (ProgressCounters -> Maybe Int)
-> (ProgressCounters -> Maybe Int -> ProgressCounters)
-> Lens ProgressCounters ProgressCounters (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProgressCounters' {Maybe Int
totalSteps :: Maybe Int
$sel:totalSteps:ProgressCounters' :: ProgressCounters -> Maybe Int
totalSteps} -> Maybe Int
totalSteps) (\s :: ProgressCounters
s@ProgressCounters' {} Maybe Int
a -> ProgressCounters
s {$sel:totalSteps:ProgressCounters' :: Maybe Int
totalSteps = Maybe Int
a} :: ProgressCounters)
progressCounters_timedOutSteps :: Lens.Lens' ProgressCounters (Prelude.Maybe Prelude.Int)
progressCounters_timedOutSteps :: (Maybe Int -> f (Maybe Int))
-> ProgressCounters -> f ProgressCounters
progressCounters_timedOutSteps = (ProgressCounters -> Maybe Int)
-> (ProgressCounters -> Maybe Int -> ProgressCounters)
-> Lens ProgressCounters ProgressCounters (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProgressCounters' {Maybe Int
timedOutSteps :: Maybe Int
$sel:timedOutSteps:ProgressCounters' :: ProgressCounters -> Maybe Int
timedOutSteps} -> Maybe Int
timedOutSteps) (\s :: ProgressCounters
s@ProgressCounters' {} Maybe Int
a -> ProgressCounters
s {$sel:timedOutSteps:ProgressCounters' :: Maybe Int
timedOutSteps = Maybe Int
a} :: ProgressCounters)
instance Core.FromJSON ProgressCounters where
parseJSON :: Value -> Parser ProgressCounters
parseJSON =
String
-> (Object -> Parser ProgressCounters)
-> Value
-> Parser ProgressCounters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ProgressCounters"
( \Object
x ->
Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> ProgressCounters
ProgressCounters'
(Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> ProgressCounters)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe Int -> Maybe Int -> Maybe Int -> ProgressCounters)
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
"FailedSteps")
Parser
(Maybe Int
-> Maybe Int -> Maybe Int -> Maybe Int -> ProgressCounters)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe Int -> Maybe Int -> ProgressCounters)
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
"CancelledSteps")
Parser (Maybe Int -> Maybe Int -> Maybe Int -> ProgressCounters)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe Int -> ProgressCounters)
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
"SuccessSteps")
Parser (Maybe Int -> Maybe Int -> ProgressCounters)
-> Parser (Maybe Int) -> Parser (Maybe Int -> ProgressCounters)
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
"TotalSteps")
Parser (Maybe Int -> ProgressCounters)
-> Parser (Maybe Int) -> Parser ProgressCounters
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
"TimedOutSteps")
)
instance Prelude.Hashable ProgressCounters
instance Prelude.NFData ProgressCounters