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