{-# 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.ImageScanFinding where
import qualified Amazonka.Core as Core
import Amazonka.ECR.Types.Attribute
import Amazonka.ECR.Types.FindingSeverity
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ImageScanFinding = ImageScanFinding'
{
ImageScanFinding -> Maybe FindingSeverity
severity :: Prelude.Maybe FindingSeverity,
ImageScanFinding -> Maybe Text
uri :: Prelude.Maybe Prelude.Text,
ImageScanFinding -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ImageScanFinding -> Maybe [Attribute]
attributes :: Prelude.Maybe [Attribute],
ImageScanFinding -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (ImageScanFinding -> ImageScanFinding -> Bool
(ImageScanFinding -> ImageScanFinding -> Bool)
-> (ImageScanFinding -> ImageScanFinding -> Bool)
-> Eq ImageScanFinding
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageScanFinding -> ImageScanFinding -> Bool
$c/= :: ImageScanFinding -> ImageScanFinding -> Bool
== :: ImageScanFinding -> ImageScanFinding -> Bool
$c== :: ImageScanFinding -> ImageScanFinding -> Bool
Prelude.Eq, ReadPrec [ImageScanFinding]
ReadPrec ImageScanFinding
Int -> ReadS ImageScanFinding
ReadS [ImageScanFinding]
(Int -> ReadS ImageScanFinding)
-> ReadS [ImageScanFinding]
-> ReadPrec ImageScanFinding
-> ReadPrec [ImageScanFinding]
-> Read ImageScanFinding
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImageScanFinding]
$creadListPrec :: ReadPrec [ImageScanFinding]
readPrec :: ReadPrec ImageScanFinding
$creadPrec :: ReadPrec ImageScanFinding
readList :: ReadS [ImageScanFinding]
$creadList :: ReadS [ImageScanFinding]
readsPrec :: Int -> ReadS ImageScanFinding
$creadsPrec :: Int -> ReadS ImageScanFinding
Prelude.Read, Int -> ImageScanFinding -> ShowS
[ImageScanFinding] -> ShowS
ImageScanFinding -> String
(Int -> ImageScanFinding -> ShowS)
-> (ImageScanFinding -> String)
-> ([ImageScanFinding] -> ShowS)
-> Show ImageScanFinding
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImageScanFinding] -> ShowS
$cshowList :: [ImageScanFinding] -> ShowS
show :: ImageScanFinding -> String
$cshow :: ImageScanFinding -> String
showsPrec :: Int -> ImageScanFinding -> ShowS
$cshowsPrec :: Int -> ImageScanFinding -> ShowS
Prelude.Show, (forall x. ImageScanFinding -> Rep ImageScanFinding x)
-> (forall x. Rep ImageScanFinding x -> ImageScanFinding)
-> Generic ImageScanFinding
forall x. Rep ImageScanFinding x -> ImageScanFinding
forall x. ImageScanFinding -> Rep ImageScanFinding x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImageScanFinding x -> ImageScanFinding
$cfrom :: forall x. ImageScanFinding -> Rep ImageScanFinding x
Prelude.Generic)
newImageScanFinding ::
ImageScanFinding
newImageScanFinding :: ImageScanFinding
newImageScanFinding =
ImageScanFinding' :: Maybe FindingSeverity
-> Maybe Text
-> Maybe Text
-> Maybe [Attribute]
-> Maybe Text
-> ImageScanFinding
ImageScanFinding'
{ $sel:severity:ImageScanFinding' :: Maybe FindingSeverity
severity = Maybe FindingSeverity
forall a. Maybe a
Prelude.Nothing,
$sel:uri:ImageScanFinding' :: Maybe Text
uri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:ImageScanFinding' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:attributes:ImageScanFinding' :: Maybe [Attribute]
attributes = Maybe [Attribute]
forall a. Maybe a
Prelude.Nothing,
$sel:description:ImageScanFinding' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
imageScanFinding_severity :: Lens.Lens' ImageScanFinding (Prelude.Maybe FindingSeverity)
imageScanFinding_severity :: (Maybe FindingSeverity -> f (Maybe FindingSeverity))
-> ImageScanFinding -> f ImageScanFinding
imageScanFinding_severity = (ImageScanFinding -> Maybe FindingSeverity)
-> (ImageScanFinding -> Maybe FindingSeverity -> ImageScanFinding)
-> Lens
ImageScanFinding
ImageScanFinding
(Maybe FindingSeverity)
(Maybe FindingSeverity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageScanFinding' {Maybe FindingSeverity
severity :: Maybe FindingSeverity
$sel:severity:ImageScanFinding' :: ImageScanFinding -> Maybe FindingSeverity
severity} -> Maybe FindingSeverity
severity) (\s :: ImageScanFinding
s@ImageScanFinding' {} Maybe FindingSeverity
a -> ImageScanFinding
s {$sel:severity:ImageScanFinding' :: Maybe FindingSeverity
severity = Maybe FindingSeverity
a} :: ImageScanFinding)
imageScanFinding_uri :: Lens.Lens' ImageScanFinding (Prelude.Maybe Prelude.Text)
imageScanFinding_uri :: (Maybe Text -> f (Maybe Text))
-> ImageScanFinding -> f ImageScanFinding
imageScanFinding_uri = (ImageScanFinding -> Maybe Text)
-> (ImageScanFinding -> Maybe Text -> ImageScanFinding)
-> Lens ImageScanFinding ImageScanFinding (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageScanFinding' {Maybe Text
uri :: Maybe Text
$sel:uri:ImageScanFinding' :: ImageScanFinding -> Maybe Text
uri} -> Maybe Text
uri) (\s :: ImageScanFinding
s@ImageScanFinding' {} Maybe Text
a -> ImageScanFinding
s {$sel:uri:ImageScanFinding' :: Maybe Text
uri = Maybe Text
a} :: ImageScanFinding)
imageScanFinding_name :: Lens.Lens' ImageScanFinding (Prelude.Maybe Prelude.Text)
imageScanFinding_name :: (Maybe Text -> f (Maybe Text))
-> ImageScanFinding -> f ImageScanFinding
imageScanFinding_name = (ImageScanFinding -> Maybe Text)
-> (ImageScanFinding -> Maybe Text -> ImageScanFinding)
-> Lens ImageScanFinding ImageScanFinding (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageScanFinding' {Maybe Text
name :: Maybe Text
$sel:name:ImageScanFinding' :: ImageScanFinding -> Maybe Text
name} -> Maybe Text
name) (\s :: ImageScanFinding
s@ImageScanFinding' {} Maybe Text
a -> ImageScanFinding
s {$sel:name:ImageScanFinding' :: Maybe Text
name = Maybe Text
a} :: ImageScanFinding)
imageScanFinding_attributes :: Lens.Lens' ImageScanFinding (Prelude.Maybe [Attribute])
imageScanFinding_attributes :: (Maybe [Attribute] -> f (Maybe [Attribute]))
-> ImageScanFinding -> f ImageScanFinding
imageScanFinding_attributes = (ImageScanFinding -> Maybe [Attribute])
-> (ImageScanFinding -> Maybe [Attribute] -> ImageScanFinding)
-> Lens
ImageScanFinding
ImageScanFinding
(Maybe [Attribute])
(Maybe [Attribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageScanFinding' {Maybe [Attribute]
attributes :: Maybe [Attribute]
$sel:attributes:ImageScanFinding' :: ImageScanFinding -> Maybe [Attribute]
attributes} -> Maybe [Attribute]
attributes) (\s :: ImageScanFinding
s@ImageScanFinding' {} Maybe [Attribute]
a -> ImageScanFinding
s {$sel:attributes:ImageScanFinding' :: Maybe [Attribute]
attributes = Maybe [Attribute]
a} :: ImageScanFinding) ((Maybe [Attribute] -> f (Maybe [Attribute]))
-> ImageScanFinding -> f ImageScanFinding)
-> ((Maybe [Attribute] -> f (Maybe [Attribute]))
-> Maybe [Attribute] -> f (Maybe [Attribute]))
-> (Maybe [Attribute] -> f (Maybe [Attribute]))
-> ImageScanFinding
-> f ImageScanFinding
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Attribute] [Attribute] [Attribute] [Attribute]
-> Iso
(Maybe [Attribute])
(Maybe [Attribute])
(Maybe [Attribute])
(Maybe [Attribute])
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 [Attribute] [Attribute] [Attribute] [Attribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
imageScanFinding_description :: Lens.Lens' ImageScanFinding (Prelude.Maybe Prelude.Text)
imageScanFinding_description :: (Maybe Text -> f (Maybe Text))
-> ImageScanFinding -> f ImageScanFinding
imageScanFinding_description = (ImageScanFinding -> Maybe Text)
-> (ImageScanFinding -> Maybe Text -> ImageScanFinding)
-> Lens ImageScanFinding ImageScanFinding (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageScanFinding' {Maybe Text
description :: Maybe Text
$sel:description:ImageScanFinding' :: ImageScanFinding -> Maybe Text
description} -> Maybe Text
description) (\s :: ImageScanFinding
s@ImageScanFinding' {} Maybe Text
a -> ImageScanFinding
s {$sel:description:ImageScanFinding' :: Maybe Text
description = Maybe Text
a} :: ImageScanFinding)
instance Core.FromJSON ImageScanFinding where
parseJSON :: Value -> Parser ImageScanFinding
parseJSON =
String
-> (Object -> Parser ImageScanFinding)
-> Value
-> Parser ImageScanFinding
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ImageScanFinding"
( \Object
x ->
Maybe FindingSeverity
-> Maybe Text
-> Maybe Text
-> Maybe [Attribute]
-> Maybe Text
-> ImageScanFinding
ImageScanFinding'
(Maybe FindingSeverity
-> Maybe Text
-> Maybe Text
-> Maybe [Attribute]
-> Maybe Text
-> ImageScanFinding)
-> Parser (Maybe FindingSeverity)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe [Attribute]
-> Maybe Text
-> ImageScanFinding)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe FindingSeverity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"severity")
Parser
(Maybe Text
-> Maybe Text
-> Maybe [Attribute]
-> Maybe Text
-> ImageScanFinding)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe [Attribute] -> Maybe Text -> ImageScanFinding)
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
"uri")
Parser
(Maybe Text -> Maybe [Attribute] -> Maybe Text -> ImageScanFinding)
-> Parser (Maybe Text)
-> Parser (Maybe [Attribute] -> Maybe Text -> ImageScanFinding)
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
"name")
Parser (Maybe [Attribute] -> Maybe Text -> ImageScanFinding)
-> Parser (Maybe [Attribute])
-> Parser (Maybe Text -> ImageScanFinding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Attribute]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"attributes" Parser (Maybe (Maybe [Attribute]))
-> Maybe [Attribute] -> Parser (Maybe [Attribute])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Attribute]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> ImageScanFinding)
-> Parser (Maybe Text) -> Parser ImageScanFinding
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
"description")
)
instance Prelude.Hashable ImageScanFinding
instance Prelude.NFData ImageScanFinding