{-# 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.SecurityHub.Types.ContainerDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ContainerDetails = ContainerDetails'
{
ContainerDetails -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ContainerDetails -> Maybe Text
imageId :: Prelude.Maybe Prelude.Text,
ContainerDetails -> Maybe Text
imageName :: Prelude.Maybe Prelude.Text,
ContainerDetails -> Maybe Text
launchedAt :: Prelude.Maybe Prelude.Text
}
deriving (ContainerDetails -> ContainerDetails -> Bool
(ContainerDetails -> ContainerDetails -> Bool)
-> (ContainerDetails -> ContainerDetails -> Bool)
-> Eq ContainerDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContainerDetails -> ContainerDetails -> Bool
$c/= :: ContainerDetails -> ContainerDetails -> Bool
== :: ContainerDetails -> ContainerDetails -> Bool
$c== :: ContainerDetails -> ContainerDetails -> Bool
Prelude.Eq, ReadPrec [ContainerDetails]
ReadPrec ContainerDetails
Int -> ReadS ContainerDetails
ReadS [ContainerDetails]
(Int -> ReadS ContainerDetails)
-> ReadS [ContainerDetails]
-> ReadPrec ContainerDetails
-> ReadPrec [ContainerDetails]
-> Read ContainerDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContainerDetails]
$creadListPrec :: ReadPrec [ContainerDetails]
readPrec :: ReadPrec ContainerDetails
$creadPrec :: ReadPrec ContainerDetails
readList :: ReadS [ContainerDetails]
$creadList :: ReadS [ContainerDetails]
readsPrec :: Int -> ReadS ContainerDetails
$creadsPrec :: Int -> ReadS ContainerDetails
Prelude.Read, Int -> ContainerDetails -> ShowS
[ContainerDetails] -> ShowS
ContainerDetails -> String
(Int -> ContainerDetails -> ShowS)
-> (ContainerDetails -> String)
-> ([ContainerDetails] -> ShowS)
-> Show ContainerDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContainerDetails] -> ShowS
$cshowList :: [ContainerDetails] -> ShowS
show :: ContainerDetails -> String
$cshow :: ContainerDetails -> String
showsPrec :: Int -> ContainerDetails -> ShowS
$cshowsPrec :: Int -> ContainerDetails -> ShowS
Prelude.Show, (forall x. ContainerDetails -> Rep ContainerDetails x)
-> (forall x. Rep ContainerDetails x -> ContainerDetails)
-> Generic ContainerDetails
forall x. Rep ContainerDetails x -> ContainerDetails
forall x. ContainerDetails -> Rep ContainerDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContainerDetails x -> ContainerDetails
$cfrom :: forall x. ContainerDetails -> Rep ContainerDetails x
Prelude.Generic)
newContainerDetails ::
ContainerDetails
newContainerDetails :: ContainerDetails
newContainerDetails =
ContainerDetails' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ContainerDetails
ContainerDetails'
{ $sel:name:ContainerDetails' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:imageId:ContainerDetails' :: Maybe Text
imageId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:imageName:ContainerDetails' :: Maybe Text
imageName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:launchedAt:ContainerDetails' :: Maybe Text
launchedAt = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
containerDetails_name :: Lens.Lens' ContainerDetails (Prelude.Maybe Prelude.Text)
containerDetails_name :: (Maybe Text -> f (Maybe Text))
-> ContainerDetails -> f ContainerDetails
containerDetails_name = (ContainerDetails -> Maybe Text)
-> (ContainerDetails -> Maybe Text -> ContainerDetails)
-> Lens ContainerDetails ContainerDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerDetails' {Maybe Text
name :: Maybe Text
$sel:name:ContainerDetails' :: ContainerDetails -> Maybe Text
name} -> Maybe Text
name) (\s :: ContainerDetails
s@ContainerDetails' {} Maybe Text
a -> ContainerDetails
s {$sel:name:ContainerDetails' :: Maybe Text
name = Maybe Text
a} :: ContainerDetails)
containerDetails_imageId :: Lens.Lens' ContainerDetails (Prelude.Maybe Prelude.Text)
containerDetails_imageId :: (Maybe Text -> f (Maybe Text))
-> ContainerDetails -> f ContainerDetails
containerDetails_imageId = (ContainerDetails -> Maybe Text)
-> (ContainerDetails -> Maybe Text -> ContainerDetails)
-> Lens ContainerDetails ContainerDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerDetails' {Maybe Text
imageId :: Maybe Text
$sel:imageId:ContainerDetails' :: ContainerDetails -> Maybe Text
imageId} -> Maybe Text
imageId) (\s :: ContainerDetails
s@ContainerDetails' {} Maybe Text
a -> ContainerDetails
s {$sel:imageId:ContainerDetails' :: Maybe Text
imageId = Maybe Text
a} :: ContainerDetails)
containerDetails_imageName :: Lens.Lens' ContainerDetails (Prelude.Maybe Prelude.Text)
containerDetails_imageName :: (Maybe Text -> f (Maybe Text))
-> ContainerDetails -> f ContainerDetails
containerDetails_imageName = (ContainerDetails -> Maybe Text)
-> (ContainerDetails -> Maybe Text -> ContainerDetails)
-> Lens ContainerDetails ContainerDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerDetails' {Maybe Text
imageName :: Maybe Text
$sel:imageName:ContainerDetails' :: ContainerDetails -> Maybe Text
imageName} -> Maybe Text
imageName) (\s :: ContainerDetails
s@ContainerDetails' {} Maybe Text
a -> ContainerDetails
s {$sel:imageName:ContainerDetails' :: Maybe Text
imageName = Maybe Text
a} :: ContainerDetails)
containerDetails_launchedAt :: Lens.Lens' ContainerDetails (Prelude.Maybe Prelude.Text)
containerDetails_launchedAt :: (Maybe Text -> f (Maybe Text))
-> ContainerDetails -> f ContainerDetails
containerDetails_launchedAt = (ContainerDetails -> Maybe Text)
-> (ContainerDetails -> Maybe Text -> ContainerDetails)
-> Lens ContainerDetails ContainerDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerDetails' {Maybe Text
launchedAt :: Maybe Text
$sel:launchedAt:ContainerDetails' :: ContainerDetails -> Maybe Text
launchedAt} -> Maybe Text
launchedAt) (\s :: ContainerDetails
s@ContainerDetails' {} Maybe Text
a -> ContainerDetails
s {$sel:launchedAt:ContainerDetails' :: Maybe Text
launchedAt = Maybe Text
a} :: ContainerDetails)
instance Core.FromJSON ContainerDetails where
parseJSON :: Value -> Parser ContainerDetails
parseJSON =
String
-> (Object -> Parser ContainerDetails)
-> Value
-> Parser ContainerDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ContainerDetails"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ContainerDetails
ContainerDetails'
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ContainerDetails)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> ContainerDetails)
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
"Name")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> ContainerDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ContainerDetails)
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
"ImageId")
Parser (Maybe Text -> Maybe Text -> ContainerDetails)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ContainerDetails)
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
"ImageName")
Parser (Maybe Text -> ContainerDetails)
-> Parser (Maybe Text) -> Parser ContainerDetails
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
"LaunchedAt")
)
instance Prelude.Hashable ContainerDetails
instance Prelude.NFData ContainerDetails
instance Core.ToJSON ContainerDetails where
toJSON :: ContainerDetails -> Value
toJSON ContainerDetails' {Maybe Text
launchedAt :: Maybe Text
imageName :: Maybe Text
imageId :: Maybe Text
name :: Maybe Text
$sel:launchedAt:ContainerDetails' :: ContainerDetails -> Maybe Text
$sel:imageName:ContainerDetails' :: ContainerDetails -> Maybe Text
$sel:imageId:ContainerDetails' :: ContainerDetails -> Maybe Text
$sel:name:ContainerDetails' :: ContainerDetails -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
(Text
"ImageId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
imageId,
(Text
"ImageName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
imageName,
(Text
"LaunchedAt" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
launchedAt
]
)