{-# 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.AttemptContainerDetail where
import Amazonka.Batch.Types.NetworkInterface
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AttemptContainerDetail = AttemptContainerDetail'
{
AttemptContainerDetail -> Maybe [NetworkInterface]
networkInterfaces :: Prelude.Maybe [NetworkInterface],
AttemptContainerDetail -> Maybe Text
taskArn :: Prelude.Maybe Prelude.Text,
AttemptContainerDetail -> Maybe Text
containerInstanceArn :: Prelude.Maybe Prelude.Text,
AttemptContainerDetail -> Maybe Text
reason :: Prelude.Maybe Prelude.Text,
AttemptContainerDetail -> Maybe Text
logStreamName :: Prelude.Maybe Prelude.Text,
AttemptContainerDetail -> Maybe Int
exitCode :: Prelude.Maybe Prelude.Int
}
deriving (AttemptContainerDetail -> AttemptContainerDetail -> Bool
(AttemptContainerDetail -> AttemptContainerDetail -> Bool)
-> (AttemptContainerDetail -> AttemptContainerDetail -> Bool)
-> Eq AttemptContainerDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttemptContainerDetail -> AttemptContainerDetail -> Bool
$c/= :: AttemptContainerDetail -> AttemptContainerDetail -> Bool
== :: AttemptContainerDetail -> AttemptContainerDetail -> Bool
$c== :: AttemptContainerDetail -> AttemptContainerDetail -> Bool
Prelude.Eq, ReadPrec [AttemptContainerDetail]
ReadPrec AttemptContainerDetail
Int -> ReadS AttemptContainerDetail
ReadS [AttemptContainerDetail]
(Int -> ReadS AttemptContainerDetail)
-> ReadS [AttemptContainerDetail]
-> ReadPrec AttemptContainerDetail
-> ReadPrec [AttemptContainerDetail]
-> Read AttemptContainerDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttemptContainerDetail]
$creadListPrec :: ReadPrec [AttemptContainerDetail]
readPrec :: ReadPrec AttemptContainerDetail
$creadPrec :: ReadPrec AttemptContainerDetail
readList :: ReadS [AttemptContainerDetail]
$creadList :: ReadS [AttemptContainerDetail]
readsPrec :: Int -> ReadS AttemptContainerDetail
$creadsPrec :: Int -> ReadS AttemptContainerDetail
Prelude.Read, Int -> AttemptContainerDetail -> ShowS
[AttemptContainerDetail] -> ShowS
AttemptContainerDetail -> String
(Int -> AttemptContainerDetail -> ShowS)
-> (AttemptContainerDetail -> String)
-> ([AttemptContainerDetail] -> ShowS)
-> Show AttemptContainerDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttemptContainerDetail] -> ShowS
$cshowList :: [AttemptContainerDetail] -> ShowS
show :: AttemptContainerDetail -> String
$cshow :: AttemptContainerDetail -> String
showsPrec :: Int -> AttemptContainerDetail -> ShowS
$cshowsPrec :: Int -> AttemptContainerDetail -> ShowS
Prelude.Show, (forall x. AttemptContainerDetail -> Rep AttemptContainerDetail x)
-> (forall x.
Rep AttemptContainerDetail x -> AttemptContainerDetail)
-> Generic AttemptContainerDetail
forall x. Rep AttemptContainerDetail x -> AttemptContainerDetail
forall x. AttemptContainerDetail -> Rep AttemptContainerDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AttemptContainerDetail x -> AttemptContainerDetail
$cfrom :: forall x. AttemptContainerDetail -> Rep AttemptContainerDetail x
Prelude.Generic)
newAttemptContainerDetail ::
AttemptContainerDetail
newAttemptContainerDetail :: AttemptContainerDetail
newAttemptContainerDetail =
AttemptContainerDetail' :: Maybe [NetworkInterface]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> AttemptContainerDetail
AttemptContainerDetail'
{ $sel:networkInterfaces:AttemptContainerDetail' :: Maybe [NetworkInterface]
networkInterfaces =
Maybe [NetworkInterface]
forall a. Maybe a
Prelude.Nothing,
$sel:taskArn:AttemptContainerDetail' :: Maybe Text
taskArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:containerInstanceArn:AttemptContainerDetail' :: Maybe Text
containerInstanceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:reason:AttemptContainerDetail' :: Maybe Text
reason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:logStreamName:AttemptContainerDetail' :: Maybe Text
logStreamName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:exitCode:AttemptContainerDetail' :: Maybe Int
exitCode = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
attemptContainerDetail_networkInterfaces :: Lens.Lens' AttemptContainerDetail (Prelude.Maybe [NetworkInterface])
attemptContainerDetail_networkInterfaces :: (Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> AttemptContainerDetail -> f AttemptContainerDetail
attemptContainerDetail_networkInterfaces = (AttemptContainerDetail -> Maybe [NetworkInterface])
-> (AttemptContainerDetail
-> Maybe [NetworkInterface] -> AttemptContainerDetail)
-> Lens
AttemptContainerDetail
AttemptContainerDetail
(Maybe [NetworkInterface])
(Maybe [NetworkInterface])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttemptContainerDetail' {Maybe [NetworkInterface]
networkInterfaces :: Maybe [NetworkInterface]
$sel:networkInterfaces:AttemptContainerDetail' :: AttemptContainerDetail -> Maybe [NetworkInterface]
networkInterfaces} -> Maybe [NetworkInterface]
networkInterfaces) (\s :: AttemptContainerDetail
s@AttemptContainerDetail' {} Maybe [NetworkInterface]
a -> AttemptContainerDetail
s {$sel:networkInterfaces:AttemptContainerDetail' :: Maybe [NetworkInterface]
networkInterfaces = Maybe [NetworkInterface]
a} :: AttemptContainerDetail) ((Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> AttemptContainerDetail -> f AttemptContainerDetail)
-> ((Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> (Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> AttemptContainerDetail
-> f AttemptContainerDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[NetworkInterface]
[NetworkInterface]
[NetworkInterface]
[NetworkInterface]
-> Iso
(Maybe [NetworkInterface])
(Maybe [NetworkInterface])
(Maybe [NetworkInterface])
(Maybe [NetworkInterface])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[NetworkInterface]
[NetworkInterface]
[NetworkInterface]
[NetworkInterface]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
attemptContainerDetail_taskArn :: Lens.Lens' AttemptContainerDetail (Prelude.Maybe Prelude.Text)
attemptContainerDetail_taskArn :: (Maybe Text -> f (Maybe Text))
-> AttemptContainerDetail -> f AttemptContainerDetail
attemptContainerDetail_taskArn = (AttemptContainerDetail -> Maybe Text)
-> (AttemptContainerDetail -> Maybe Text -> AttemptContainerDetail)
-> Lens
AttemptContainerDetail
AttemptContainerDetail
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttemptContainerDetail' {Maybe Text
taskArn :: Maybe Text
$sel:taskArn:AttemptContainerDetail' :: AttemptContainerDetail -> Maybe Text
taskArn} -> Maybe Text
taskArn) (\s :: AttemptContainerDetail
s@AttemptContainerDetail' {} Maybe Text
a -> AttemptContainerDetail
s {$sel:taskArn:AttemptContainerDetail' :: Maybe Text
taskArn = Maybe Text
a} :: AttemptContainerDetail)
attemptContainerDetail_containerInstanceArn :: Lens.Lens' AttemptContainerDetail (Prelude.Maybe Prelude.Text)
attemptContainerDetail_containerInstanceArn :: (Maybe Text -> f (Maybe Text))
-> AttemptContainerDetail -> f AttemptContainerDetail
attemptContainerDetail_containerInstanceArn = (AttemptContainerDetail -> Maybe Text)
-> (AttemptContainerDetail -> Maybe Text -> AttemptContainerDetail)
-> Lens
AttemptContainerDetail
AttemptContainerDetail
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttemptContainerDetail' {Maybe Text
containerInstanceArn :: Maybe Text
$sel:containerInstanceArn:AttemptContainerDetail' :: AttemptContainerDetail -> Maybe Text
containerInstanceArn} -> Maybe Text
containerInstanceArn) (\s :: AttemptContainerDetail
s@AttemptContainerDetail' {} Maybe Text
a -> AttemptContainerDetail
s {$sel:containerInstanceArn:AttemptContainerDetail' :: Maybe Text
containerInstanceArn = Maybe Text
a} :: AttemptContainerDetail)
attemptContainerDetail_reason :: Lens.Lens' AttemptContainerDetail (Prelude.Maybe Prelude.Text)
attemptContainerDetail_reason :: (Maybe Text -> f (Maybe Text))
-> AttemptContainerDetail -> f AttemptContainerDetail
attemptContainerDetail_reason = (AttemptContainerDetail -> Maybe Text)
-> (AttemptContainerDetail -> Maybe Text -> AttemptContainerDetail)
-> Lens
AttemptContainerDetail
AttemptContainerDetail
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttemptContainerDetail' {Maybe Text
reason :: Maybe Text
$sel:reason:AttemptContainerDetail' :: AttemptContainerDetail -> Maybe Text
reason} -> Maybe Text
reason) (\s :: AttemptContainerDetail
s@AttemptContainerDetail' {} Maybe Text
a -> AttemptContainerDetail
s {$sel:reason:AttemptContainerDetail' :: Maybe Text
reason = Maybe Text
a} :: AttemptContainerDetail)
attemptContainerDetail_logStreamName :: Lens.Lens' AttemptContainerDetail (Prelude.Maybe Prelude.Text)
attemptContainerDetail_logStreamName :: (Maybe Text -> f (Maybe Text))
-> AttemptContainerDetail -> f AttemptContainerDetail
attemptContainerDetail_logStreamName = (AttemptContainerDetail -> Maybe Text)
-> (AttemptContainerDetail -> Maybe Text -> AttemptContainerDetail)
-> Lens
AttemptContainerDetail
AttemptContainerDetail
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttemptContainerDetail' {Maybe Text
logStreamName :: Maybe Text
$sel:logStreamName:AttemptContainerDetail' :: AttemptContainerDetail -> Maybe Text
logStreamName} -> Maybe Text
logStreamName) (\s :: AttemptContainerDetail
s@AttemptContainerDetail' {} Maybe Text
a -> AttemptContainerDetail
s {$sel:logStreamName:AttemptContainerDetail' :: Maybe Text
logStreamName = Maybe Text
a} :: AttemptContainerDetail)
attemptContainerDetail_exitCode :: Lens.Lens' AttemptContainerDetail (Prelude.Maybe Prelude.Int)
attemptContainerDetail_exitCode :: (Maybe Int -> f (Maybe Int))
-> AttemptContainerDetail -> f AttemptContainerDetail
attemptContainerDetail_exitCode = (AttemptContainerDetail -> Maybe Int)
-> (AttemptContainerDetail -> Maybe Int -> AttemptContainerDetail)
-> Lens
AttemptContainerDetail
AttemptContainerDetail
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttemptContainerDetail' {Maybe Int
exitCode :: Maybe Int
$sel:exitCode:AttemptContainerDetail' :: AttemptContainerDetail -> Maybe Int
exitCode} -> Maybe Int
exitCode) (\s :: AttemptContainerDetail
s@AttemptContainerDetail' {} Maybe Int
a -> AttemptContainerDetail
s {$sel:exitCode:AttemptContainerDetail' :: Maybe Int
exitCode = Maybe Int
a} :: AttemptContainerDetail)
instance Core.FromJSON AttemptContainerDetail where
parseJSON :: Value -> Parser AttemptContainerDetail
parseJSON =
String
-> (Object -> Parser AttemptContainerDetail)
-> Value
-> Parser AttemptContainerDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AttemptContainerDetail"
( \Object
x ->
Maybe [NetworkInterface]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> AttemptContainerDetail
AttemptContainerDetail'
(Maybe [NetworkInterface]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> AttemptContainerDetail)
-> Parser (Maybe [NetworkInterface])
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> AttemptContainerDetail)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [NetworkInterface]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"networkInterfaces"
Parser (Maybe (Maybe [NetworkInterface]))
-> Maybe [NetworkInterface] -> Parser (Maybe [NetworkInterface])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [NetworkInterface]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> AttemptContainerDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Int -> AttemptContainerDetail)
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
"taskArn")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Int -> AttemptContainerDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Int -> AttemptContainerDetail)
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
"containerInstanceArn")
Parser
(Maybe Text -> Maybe Text -> Maybe Int -> AttemptContainerDetail)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Int -> AttemptContainerDetail)
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
"reason")
Parser (Maybe Text -> Maybe Int -> AttemptContainerDetail)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> AttemptContainerDetail)
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
"logStreamName")
Parser (Maybe Int -> AttemptContainerDetail)
-> Parser (Maybe Int) -> Parser AttemptContainerDetail
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 AttemptContainerDetail
instance Prelude.NFData AttemptContainerDetail