{-# 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.SageMaker.Types.ObjectiveStatusCounters where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ObjectiveStatusCounters = ObjectiveStatusCounters'
{
ObjectiveStatusCounters -> Maybe Natural
pending :: Prelude.Maybe Prelude.Natural,
ObjectiveStatusCounters -> Maybe Natural
succeeded :: Prelude.Maybe Prelude.Natural,
ObjectiveStatusCounters -> Maybe Natural
failed :: Prelude.Maybe Prelude.Natural
}
deriving (ObjectiveStatusCounters -> ObjectiveStatusCounters -> Bool
(ObjectiveStatusCounters -> ObjectiveStatusCounters -> Bool)
-> (ObjectiveStatusCounters -> ObjectiveStatusCounters -> Bool)
-> Eq ObjectiveStatusCounters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ObjectiveStatusCounters -> ObjectiveStatusCounters -> Bool
$c/= :: ObjectiveStatusCounters -> ObjectiveStatusCounters -> Bool
== :: ObjectiveStatusCounters -> ObjectiveStatusCounters -> Bool
$c== :: ObjectiveStatusCounters -> ObjectiveStatusCounters -> Bool
Prelude.Eq, ReadPrec [ObjectiveStatusCounters]
ReadPrec ObjectiveStatusCounters
Int -> ReadS ObjectiveStatusCounters
ReadS [ObjectiveStatusCounters]
(Int -> ReadS ObjectiveStatusCounters)
-> ReadS [ObjectiveStatusCounters]
-> ReadPrec ObjectiveStatusCounters
-> ReadPrec [ObjectiveStatusCounters]
-> Read ObjectiveStatusCounters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ObjectiveStatusCounters]
$creadListPrec :: ReadPrec [ObjectiveStatusCounters]
readPrec :: ReadPrec ObjectiveStatusCounters
$creadPrec :: ReadPrec ObjectiveStatusCounters
readList :: ReadS [ObjectiveStatusCounters]
$creadList :: ReadS [ObjectiveStatusCounters]
readsPrec :: Int -> ReadS ObjectiveStatusCounters
$creadsPrec :: Int -> ReadS ObjectiveStatusCounters
Prelude.Read, Int -> ObjectiveStatusCounters -> ShowS
[ObjectiveStatusCounters] -> ShowS
ObjectiveStatusCounters -> String
(Int -> ObjectiveStatusCounters -> ShowS)
-> (ObjectiveStatusCounters -> String)
-> ([ObjectiveStatusCounters] -> ShowS)
-> Show ObjectiveStatusCounters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ObjectiveStatusCounters] -> ShowS
$cshowList :: [ObjectiveStatusCounters] -> ShowS
show :: ObjectiveStatusCounters -> String
$cshow :: ObjectiveStatusCounters -> String
showsPrec :: Int -> ObjectiveStatusCounters -> ShowS
$cshowsPrec :: Int -> ObjectiveStatusCounters -> ShowS
Prelude.Show, (forall x.
ObjectiveStatusCounters -> Rep ObjectiveStatusCounters x)
-> (forall x.
Rep ObjectiveStatusCounters x -> ObjectiveStatusCounters)
-> Generic ObjectiveStatusCounters
forall x. Rep ObjectiveStatusCounters x -> ObjectiveStatusCounters
forall x. ObjectiveStatusCounters -> Rep ObjectiveStatusCounters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ObjectiveStatusCounters x -> ObjectiveStatusCounters
$cfrom :: forall x. ObjectiveStatusCounters -> Rep ObjectiveStatusCounters x
Prelude.Generic)
newObjectiveStatusCounters ::
ObjectiveStatusCounters
newObjectiveStatusCounters :: ObjectiveStatusCounters
newObjectiveStatusCounters =
ObjectiveStatusCounters' :: Maybe Natural
-> Maybe Natural -> Maybe Natural -> ObjectiveStatusCounters
ObjectiveStatusCounters'
{ $sel:pending:ObjectiveStatusCounters' :: Maybe Natural
pending = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:succeeded:ObjectiveStatusCounters' :: Maybe Natural
succeeded = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:failed:ObjectiveStatusCounters' :: Maybe Natural
failed = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
objectiveStatusCounters_pending :: Lens.Lens' ObjectiveStatusCounters (Prelude.Maybe Prelude.Natural)
objectiveStatusCounters_pending :: (Maybe Natural -> f (Maybe Natural))
-> ObjectiveStatusCounters -> f ObjectiveStatusCounters
objectiveStatusCounters_pending = (ObjectiveStatusCounters -> Maybe Natural)
-> (ObjectiveStatusCounters
-> Maybe Natural -> ObjectiveStatusCounters)
-> Lens
ObjectiveStatusCounters
ObjectiveStatusCounters
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ObjectiveStatusCounters' {Maybe Natural
pending :: Maybe Natural
$sel:pending:ObjectiveStatusCounters' :: ObjectiveStatusCounters -> Maybe Natural
pending} -> Maybe Natural
pending) (\s :: ObjectiveStatusCounters
s@ObjectiveStatusCounters' {} Maybe Natural
a -> ObjectiveStatusCounters
s {$sel:pending:ObjectiveStatusCounters' :: Maybe Natural
pending = Maybe Natural
a} :: ObjectiveStatusCounters)
objectiveStatusCounters_succeeded :: Lens.Lens' ObjectiveStatusCounters (Prelude.Maybe Prelude.Natural)
objectiveStatusCounters_succeeded :: (Maybe Natural -> f (Maybe Natural))
-> ObjectiveStatusCounters -> f ObjectiveStatusCounters
objectiveStatusCounters_succeeded = (ObjectiveStatusCounters -> Maybe Natural)
-> (ObjectiveStatusCounters
-> Maybe Natural -> ObjectiveStatusCounters)
-> Lens
ObjectiveStatusCounters
ObjectiveStatusCounters
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ObjectiveStatusCounters' {Maybe Natural
succeeded :: Maybe Natural
$sel:succeeded:ObjectiveStatusCounters' :: ObjectiveStatusCounters -> Maybe Natural
succeeded} -> Maybe Natural
succeeded) (\s :: ObjectiveStatusCounters
s@ObjectiveStatusCounters' {} Maybe Natural
a -> ObjectiveStatusCounters
s {$sel:succeeded:ObjectiveStatusCounters' :: Maybe Natural
succeeded = Maybe Natural
a} :: ObjectiveStatusCounters)
objectiveStatusCounters_failed :: Lens.Lens' ObjectiveStatusCounters (Prelude.Maybe Prelude.Natural)
objectiveStatusCounters_failed :: (Maybe Natural -> f (Maybe Natural))
-> ObjectiveStatusCounters -> f ObjectiveStatusCounters
objectiveStatusCounters_failed = (ObjectiveStatusCounters -> Maybe Natural)
-> (ObjectiveStatusCounters
-> Maybe Natural -> ObjectiveStatusCounters)
-> Lens
ObjectiveStatusCounters
ObjectiveStatusCounters
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ObjectiveStatusCounters' {Maybe Natural
failed :: Maybe Natural
$sel:failed:ObjectiveStatusCounters' :: ObjectiveStatusCounters -> Maybe Natural
failed} -> Maybe Natural
failed) (\s :: ObjectiveStatusCounters
s@ObjectiveStatusCounters' {} Maybe Natural
a -> ObjectiveStatusCounters
s {$sel:failed:ObjectiveStatusCounters' :: Maybe Natural
failed = Maybe Natural
a} :: ObjectiveStatusCounters)
instance Core.FromJSON ObjectiveStatusCounters where
parseJSON :: Value -> Parser ObjectiveStatusCounters
parseJSON =
String
-> (Object -> Parser ObjectiveStatusCounters)
-> Value
-> Parser ObjectiveStatusCounters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ObjectiveStatusCounters"
( \Object
x ->
Maybe Natural
-> Maybe Natural -> Maybe Natural -> ObjectiveStatusCounters
ObjectiveStatusCounters'
(Maybe Natural
-> Maybe Natural -> Maybe Natural -> ObjectiveStatusCounters)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural -> Maybe Natural -> ObjectiveStatusCounters)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Pending")
Parser (Maybe Natural -> Maybe Natural -> ObjectiveStatusCounters)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> ObjectiveStatusCounters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Succeeded")
Parser (Maybe Natural -> ObjectiveStatusCounters)
-> Parser (Maybe Natural) -> Parser ObjectiveStatusCounters
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Failed")
)
instance Prelude.Hashable ObjectiveStatusCounters
instance Prelude.NFData ObjectiveStatusCounters