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