{-# 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.ECR.Types.ImageScanFindings where
import qualified Amazonka.Core as Core
import Amazonka.ECR.Types.FindingSeverity
import Amazonka.ECR.Types.ImageScanFinding
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ImageScanFindings = ImageScanFindings'
{
ImageScanFindings -> Maybe POSIX
imageScanCompletedAt :: Prelude.Maybe Core.POSIX,
ImageScanFindings -> Maybe [ImageScanFinding]
findings :: Prelude.Maybe [ImageScanFinding],
ImageScanFindings -> Maybe (HashMap FindingSeverity Natural)
findingSeverityCounts :: Prelude.Maybe (Prelude.HashMap FindingSeverity Prelude.Natural),
ImageScanFindings -> Maybe POSIX
vulnerabilitySourceUpdatedAt :: Prelude.Maybe Core.POSIX
}
deriving (ImageScanFindings -> ImageScanFindings -> Bool
(ImageScanFindings -> ImageScanFindings -> Bool)
-> (ImageScanFindings -> ImageScanFindings -> Bool)
-> Eq ImageScanFindings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageScanFindings -> ImageScanFindings -> Bool
$c/= :: ImageScanFindings -> ImageScanFindings -> Bool
== :: ImageScanFindings -> ImageScanFindings -> Bool
$c== :: ImageScanFindings -> ImageScanFindings -> Bool
Prelude.Eq, ReadPrec [ImageScanFindings]
ReadPrec ImageScanFindings
Int -> ReadS ImageScanFindings
ReadS [ImageScanFindings]
(Int -> ReadS ImageScanFindings)
-> ReadS [ImageScanFindings]
-> ReadPrec ImageScanFindings
-> ReadPrec [ImageScanFindings]
-> Read ImageScanFindings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImageScanFindings]
$creadListPrec :: ReadPrec [ImageScanFindings]
readPrec :: ReadPrec ImageScanFindings
$creadPrec :: ReadPrec ImageScanFindings
readList :: ReadS [ImageScanFindings]
$creadList :: ReadS [ImageScanFindings]
readsPrec :: Int -> ReadS ImageScanFindings
$creadsPrec :: Int -> ReadS ImageScanFindings
Prelude.Read, Int -> ImageScanFindings -> ShowS
[ImageScanFindings] -> ShowS
ImageScanFindings -> String
(Int -> ImageScanFindings -> ShowS)
-> (ImageScanFindings -> String)
-> ([ImageScanFindings] -> ShowS)
-> Show ImageScanFindings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImageScanFindings] -> ShowS
$cshowList :: [ImageScanFindings] -> ShowS
show :: ImageScanFindings -> String
$cshow :: ImageScanFindings -> String
showsPrec :: Int -> ImageScanFindings -> ShowS
$cshowsPrec :: Int -> ImageScanFindings -> ShowS
Prelude.Show, (forall x. ImageScanFindings -> Rep ImageScanFindings x)
-> (forall x. Rep ImageScanFindings x -> ImageScanFindings)
-> Generic ImageScanFindings
forall x. Rep ImageScanFindings x -> ImageScanFindings
forall x. ImageScanFindings -> Rep ImageScanFindings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImageScanFindings x -> ImageScanFindings
$cfrom :: forall x. ImageScanFindings -> Rep ImageScanFindings x
Prelude.Generic)
newImageScanFindings ::
ImageScanFindings
newImageScanFindings :: ImageScanFindings
newImageScanFindings =
ImageScanFindings' :: Maybe POSIX
-> Maybe [ImageScanFinding]
-> Maybe (HashMap FindingSeverity Natural)
-> Maybe POSIX
-> ImageScanFindings
ImageScanFindings'
{ $sel:imageScanCompletedAt:ImageScanFindings' :: Maybe POSIX
imageScanCompletedAt =
Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:findings:ImageScanFindings' :: Maybe [ImageScanFinding]
findings = Maybe [ImageScanFinding]
forall a. Maybe a
Prelude.Nothing,
$sel:findingSeverityCounts:ImageScanFindings' :: Maybe (HashMap FindingSeverity Natural)
findingSeverityCounts = Maybe (HashMap FindingSeverity Natural)
forall a. Maybe a
Prelude.Nothing,
$sel:vulnerabilitySourceUpdatedAt:ImageScanFindings' :: Maybe POSIX
vulnerabilitySourceUpdatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
imageScanFindings_imageScanCompletedAt :: Lens.Lens' ImageScanFindings (Prelude.Maybe Prelude.UTCTime)
imageScanFindings_imageScanCompletedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ImageScanFindings -> f ImageScanFindings
imageScanFindings_imageScanCompletedAt = (ImageScanFindings -> Maybe POSIX)
-> (ImageScanFindings -> Maybe POSIX -> ImageScanFindings)
-> Lens
ImageScanFindings ImageScanFindings (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageScanFindings' {Maybe POSIX
imageScanCompletedAt :: Maybe POSIX
$sel:imageScanCompletedAt:ImageScanFindings' :: ImageScanFindings -> Maybe POSIX
imageScanCompletedAt} -> Maybe POSIX
imageScanCompletedAt) (\s :: ImageScanFindings
s@ImageScanFindings' {} Maybe POSIX
a -> ImageScanFindings
s {$sel:imageScanCompletedAt:ImageScanFindings' :: Maybe POSIX
imageScanCompletedAt = Maybe POSIX
a} :: ImageScanFindings) ((Maybe POSIX -> f (Maybe POSIX))
-> ImageScanFindings -> f ImageScanFindings)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ImageScanFindings
-> f ImageScanFindings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
imageScanFindings_findings :: Lens.Lens' ImageScanFindings (Prelude.Maybe [ImageScanFinding])
imageScanFindings_findings :: (Maybe [ImageScanFinding] -> f (Maybe [ImageScanFinding]))
-> ImageScanFindings -> f ImageScanFindings
imageScanFindings_findings = (ImageScanFindings -> Maybe [ImageScanFinding])
-> (ImageScanFindings
-> Maybe [ImageScanFinding] -> ImageScanFindings)
-> Lens
ImageScanFindings
ImageScanFindings
(Maybe [ImageScanFinding])
(Maybe [ImageScanFinding])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageScanFindings' {Maybe [ImageScanFinding]
findings :: Maybe [ImageScanFinding]
$sel:findings:ImageScanFindings' :: ImageScanFindings -> Maybe [ImageScanFinding]
findings} -> Maybe [ImageScanFinding]
findings) (\s :: ImageScanFindings
s@ImageScanFindings' {} Maybe [ImageScanFinding]
a -> ImageScanFindings
s {$sel:findings:ImageScanFindings' :: Maybe [ImageScanFinding]
findings = Maybe [ImageScanFinding]
a} :: ImageScanFindings) ((Maybe [ImageScanFinding] -> f (Maybe [ImageScanFinding]))
-> ImageScanFindings -> f ImageScanFindings)
-> ((Maybe [ImageScanFinding] -> f (Maybe [ImageScanFinding]))
-> Maybe [ImageScanFinding] -> f (Maybe [ImageScanFinding]))
-> (Maybe [ImageScanFinding] -> f (Maybe [ImageScanFinding]))
-> ImageScanFindings
-> f ImageScanFindings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ImageScanFinding]
[ImageScanFinding]
[ImageScanFinding]
[ImageScanFinding]
-> Iso
(Maybe [ImageScanFinding])
(Maybe [ImageScanFinding])
(Maybe [ImageScanFinding])
(Maybe [ImageScanFinding])
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
[ImageScanFinding]
[ImageScanFinding]
[ImageScanFinding]
[ImageScanFinding]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
imageScanFindings_findingSeverityCounts :: Lens.Lens' ImageScanFindings (Prelude.Maybe (Prelude.HashMap FindingSeverity Prelude.Natural))
imageScanFindings_findingSeverityCounts :: (Maybe (HashMap FindingSeverity Natural)
-> f (Maybe (HashMap FindingSeverity Natural)))
-> ImageScanFindings -> f ImageScanFindings
imageScanFindings_findingSeverityCounts = (ImageScanFindings -> Maybe (HashMap FindingSeverity Natural))
-> (ImageScanFindings
-> Maybe (HashMap FindingSeverity Natural) -> ImageScanFindings)
-> Lens
ImageScanFindings
ImageScanFindings
(Maybe (HashMap FindingSeverity Natural))
(Maybe (HashMap FindingSeverity Natural))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageScanFindings' {Maybe (HashMap FindingSeverity Natural)
findingSeverityCounts :: Maybe (HashMap FindingSeverity Natural)
$sel:findingSeverityCounts:ImageScanFindings' :: ImageScanFindings -> Maybe (HashMap FindingSeverity Natural)
findingSeverityCounts} -> Maybe (HashMap FindingSeverity Natural)
findingSeverityCounts) (\s :: ImageScanFindings
s@ImageScanFindings' {} Maybe (HashMap FindingSeverity Natural)
a -> ImageScanFindings
s {$sel:findingSeverityCounts:ImageScanFindings' :: Maybe (HashMap FindingSeverity Natural)
findingSeverityCounts = Maybe (HashMap FindingSeverity Natural)
a} :: ImageScanFindings) ((Maybe (HashMap FindingSeverity Natural)
-> f (Maybe (HashMap FindingSeverity Natural)))
-> ImageScanFindings -> f ImageScanFindings)
-> ((Maybe (HashMap FindingSeverity Natural)
-> f (Maybe (HashMap FindingSeverity Natural)))
-> Maybe (HashMap FindingSeverity Natural)
-> f (Maybe (HashMap FindingSeverity Natural)))
-> (Maybe (HashMap FindingSeverity Natural)
-> f (Maybe (HashMap FindingSeverity Natural)))
-> ImageScanFindings
-> f ImageScanFindings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap FindingSeverity Natural)
(HashMap FindingSeverity Natural)
(HashMap FindingSeverity Natural)
(HashMap FindingSeverity Natural)
-> Iso
(Maybe (HashMap FindingSeverity Natural))
(Maybe (HashMap FindingSeverity Natural))
(Maybe (HashMap FindingSeverity Natural))
(Maybe (HashMap FindingSeverity Natural))
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
(HashMap FindingSeverity Natural)
(HashMap FindingSeverity Natural)
(HashMap FindingSeverity Natural)
(HashMap FindingSeverity Natural)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
imageScanFindings_vulnerabilitySourceUpdatedAt :: Lens.Lens' ImageScanFindings (Prelude.Maybe Prelude.UTCTime)
imageScanFindings_vulnerabilitySourceUpdatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ImageScanFindings -> f ImageScanFindings
imageScanFindings_vulnerabilitySourceUpdatedAt = (ImageScanFindings -> Maybe POSIX)
-> (ImageScanFindings -> Maybe POSIX -> ImageScanFindings)
-> Lens
ImageScanFindings ImageScanFindings (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageScanFindings' {Maybe POSIX
vulnerabilitySourceUpdatedAt :: Maybe POSIX
$sel:vulnerabilitySourceUpdatedAt:ImageScanFindings' :: ImageScanFindings -> Maybe POSIX
vulnerabilitySourceUpdatedAt} -> Maybe POSIX
vulnerabilitySourceUpdatedAt) (\s :: ImageScanFindings
s@ImageScanFindings' {} Maybe POSIX
a -> ImageScanFindings
s {$sel:vulnerabilitySourceUpdatedAt:ImageScanFindings' :: Maybe POSIX
vulnerabilitySourceUpdatedAt = Maybe POSIX
a} :: ImageScanFindings) ((Maybe POSIX -> f (Maybe POSIX))
-> ImageScanFindings -> f ImageScanFindings)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ImageScanFindings
-> f ImageScanFindings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON ImageScanFindings where
parseJSON :: Value -> Parser ImageScanFindings
parseJSON =
String
-> (Object -> Parser ImageScanFindings)
-> Value
-> Parser ImageScanFindings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ImageScanFindings"
( \Object
x ->
Maybe POSIX
-> Maybe [ImageScanFinding]
-> Maybe (HashMap FindingSeverity Natural)
-> Maybe POSIX
-> ImageScanFindings
ImageScanFindings'
(Maybe POSIX
-> Maybe [ImageScanFinding]
-> Maybe (HashMap FindingSeverity Natural)
-> Maybe POSIX
-> ImageScanFindings)
-> Parser (Maybe POSIX)
-> Parser
(Maybe [ImageScanFinding]
-> Maybe (HashMap FindingSeverity Natural)
-> Maybe POSIX
-> ImageScanFindings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"imageScanCompletedAt")
Parser
(Maybe [ImageScanFinding]
-> Maybe (HashMap FindingSeverity Natural)
-> Maybe POSIX
-> ImageScanFindings)
-> Parser (Maybe [ImageScanFinding])
-> Parser
(Maybe (HashMap FindingSeverity Natural)
-> Maybe POSIX -> ImageScanFindings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [ImageScanFinding]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"findings" Parser (Maybe (Maybe [ImageScanFinding]))
-> Maybe [ImageScanFinding] -> Parser (Maybe [ImageScanFinding])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ImageScanFinding]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe (HashMap FindingSeverity Natural)
-> Maybe POSIX -> ImageScanFindings)
-> Parser (Maybe (HashMap FindingSeverity Natural))
-> Parser (Maybe POSIX -> ImageScanFindings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Parser (Maybe (Maybe (HashMap FindingSeverity Natural)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"findingSeverityCounts"
Parser (Maybe (Maybe (HashMap FindingSeverity Natural)))
-> Maybe (HashMap FindingSeverity Natural)
-> Parser (Maybe (HashMap FindingSeverity Natural))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap FindingSeverity Natural)
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe POSIX -> ImageScanFindings)
-> Parser (Maybe POSIX) -> Parser ImageScanFindings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"vulnerabilitySourceUpdatedAt")
)
instance Prelude.Hashable ImageScanFindings
instance Prelude.NFData ImageScanFindings