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