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