{-# 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.AwsLambdaFunctionCode where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AwsLambdaFunctionCode = AwsLambdaFunctionCode'
{
AwsLambdaFunctionCode -> Maybe Text
s3ObjectVersion :: Prelude.Maybe Prelude.Text,
AwsLambdaFunctionCode -> Maybe Text
s3Key :: Prelude.Maybe Prelude.Text,
AwsLambdaFunctionCode -> Maybe Text
zipFile :: Prelude.Maybe Prelude.Text,
AwsLambdaFunctionCode -> Maybe Text
s3Bucket :: Prelude.Maybe Prelude.Text
}
deriving (AwsLambdaFunctionCode -> AwsLambdaFunctionCode -> Bool
(AwsLambdaFunctionCode -> AwsLambdaFunctionCode -> Bool)
-> (AwsLambdaFunctionCode -> AwsLambdaFunctionCode -> Bool)
-> Eq AwsLambdaFunctionCode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsLambdaFunctionCode -> AwsLambdaFunctionCode -> Bool
$c/= :: AwsLambdaFunctionCode -> AwsLambdaFunctionCode -> Bool
== :: AwsLambdaFunctionCode -> AwsLambdaFunctionCode -> Bool
$c== :: AwsLambdaFunctionCode -> AwsLambdaFunctionCode -> Bool
Prelude.Eq, ReadPrec [AwsLambdaFunctionCode]
ReadPrec AwsLambdaFunctionCode
Int -> ReadS AwsLambdaFunctionCode
ReadS [AwsLambdaFunctionCode]
(Int -> ReadS AwsLambdaFunctionCode)
-> ReadS [AwsLambdaFunctionCode]
-> ReadPrec AwsLambdaFunctionCode
-> ReadPrec [AwsLambdaFunctionCode]
-> Read AwsLambdaFunctionCode
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsLambdaFunctionCode]
$creadListPrec :: ReadPrec [AwsLambdaFunctionCode]
readPrec :: ReadPrec AwsLambdaFunctionCode
$creadPrec :: ReadPrec AwsLambdaFunctionCode
readList :: ReadS [AwsLambdaFunctionCode]
$creadList :: ReadS [AwsLambdaFunctionCode]
readsPrec :: Int -> ReadS AwsLambdaFunctionCode
$creadsPrec :: Int -> ReadS AwsLambdaFunctionCode
Prelude.Read, Int -> AwsLambdaFunctionCode -> ShowS
[AwsLambdaFunctionCode] -> ShowS
AwsLambdaFunctionCode -> String
(Int -> AwsLambdaFunctionCode -> ShowS)
-> (AwsLambdaFunctionCode -> String)
-> ([AwsLambdaFunctionCode] -> ShowS)
-> Show AwsLambdaFunctionCode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsLambdaFunctionCode] -> ShowS
$cshowList :: [AwsLambdaFunctionCode] -> ShowS
show :: AwsLambdaFunctionCode -> String
$cshow :: AwsLambdaFunctionCode -> String
showsPrec :: Int -> AwsLambdaFunctionCode -> ShowS
$cshowsPrec :: Int -> AwsLambdaFunctionCode -> ShowS
Prelude.Show, (forall x. AwsLambdaFunctionCode -> Rep AwsLambdaFunctionCode x)
-> (forall x. Rep AwsLambdaFunctionCode x -> AwsLambdaFunctionCode)
-> Generic AwsLambdaFunctionCode
forall x. Rep AwsLambdaFunctionCode x -> AwsLambdaFunctionCode
forall x. AwsLambdaFunctionCode -> Rep AwsLambdaFunctionCode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AwsLambdaFunctionCode x -> AwsLambdaFunctionCode
$cfrom :: forall x. AwsLambdaFunctionCode -> Rep AwsLambdaFunctionCode x
Prelude.Generic)
newAwsLambdaFunctionCode ::
AwsLambdaFunctionCode
newAwsLambdaFunctionCode :: AwsLambdaFunctionCode
newAwsLambdaFunctionCode =
AwsLambdaFunctionCode' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> AwsLambdaFunctionCode
AwsLambdaFunctionCode'
{ $sel:s3ObjectVersion:AwsLambdaFunctionCode' :: Maybe Text
s3ObjectVersion =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3Key:AwsLambdaFunctionCode' :: Maybe Text
s3Key = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:zipFile:AwsLambdaFunctionCode' :: Maybe Text
zipFile = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3Bucket:AwsLambdaFunctionCode' :: Maybe Text
s3Bucket = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
awsLambdaFunctionCode_s3ObjectVersion :: Lens.Lens' AwsLambdaFunctionCode (Prelude.Maybe Prelude.Text)
awsLambdaFunctionCode_s3ObjectVersion :: (Maybe Text -> f (Maybe Text))
-> AwsLambdaFunctionCode -> f AwsLambdaFunctionCode
awsLambdaFunctionCode_s3ObjectVersion = (AwsLambdaFunctionCode -> Maybe Text)
-> (AwsLambdaFunctionCode -> Maybe Text -> AwsLambdaFunctionCode)
-> Lens
AwsLambdaFunctionCode
AwsLambdaFunctionCode
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsLambdaFunctionCode' {Maybe Text
s3ObjectVersion :: Maybe Text
$sel:s3ObjectVersion:AwsLambdaFunctionCode' :: AwsLambdaFunctionCode -> Maybe Text
s3ObjectVersion} -> Maybe Text
s3ObjectVersion) (\s :: AwsLambdaFunctionCode
s@AwsLambdaFunctionCode' {} Maybe Text
a -> AwsLambdaFunctionCode
s {$sel:s3ObjectVersion:AwsLambdaFunctionCode' :: Maybe Text
s3ObjectVersion = Maybe Text
a} :: AwsLambdaFunctionCode)
awsLambdaFunctionCode_s3Key :: Lens.Lens' AwsLambdaFunctionCode (Prelude.Maybe Prelude.Text)
awsLambdaFunctionCode_s3Key :: (Maybe Text -> f (Maybe Text))
-> AwsLambdaFunctionCode -> f AwsLambdaFunctionCode
awsLambdaFunctionCode_s3Key = (AwsLambdaFunctionCode -> Maybe Text)
-> (AwsLambdaFunctionCode -> Maybe Text -> AwsLambdaFunctionCode)
-> Lens
AwsLambdaFunctionCode
AwsLambdaFunctionCode
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsLambdaFunctionCode' {Maybe Text
s3Key :: Maybe Text
$sel:s3Key:AwsLambdaFunctionCode' :: AwsLambdaFunctionCode -> Maybe Text
s3Key} -> Maybe Text
s3Key) (\s :: AwsLambdaFunctionCode
s@AwsLambdaFunctionCode' {} Maybe Text
a -> AwsLambdaFunctionCode
s {$sel:s3Key:AwsLambdaFunctionCode' :: Maybe Text
s3Key = Maybe Text
a} :: AwsLambdaFunctionCode)
awsLambdaFunctionCode_zipFile :: Lens.Lens' AwsLambdaFunctionCode (Prelude.Maybe Prelude.Text)
awsLambdaFunctionCode_zipFile :: (Maybe Text -> f (Maybe Text))
-> AwsLambdaFunctionCode -> f AwsLambdaFunctionCode
awsLambdaFunctionCode_zipFile = (AwsLambdaFunctionCode -> Maybe Text)
-> (AwsLambdaFunctionCode -> Maybe Text -> AwsLambdaFunctionCode)
-> Lens
AwsLambdaFunctionCode
AwsLambdaFunctionCode
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsLambdaFunctionCode' {Maybe Text
zipFile :: Maybe Text
$sel:zipFile:AwsLambdaFunctionCode' :: AwsLambdaFunctionCode -> Maybe Text
zipFile} -> Maybe Text
zipFile) (\s :: AwsLambdaFunctionCode
s@AwsLambdaFunctionCode' {} Maybe Text
a -> AwsLambdaFunctionCode
s {$sel:zipFile:AwsLambdaFunctionCode' :: Maybe Text
zipFile = Maybe Text
a} :: AwsLambdaFunctionCode)
awsLambdaFunctionCode_s3Bucket :: Lens.Lens' AwsLambdaFunctionCode (Prelude.Maybe Prelude.Text)
awsLambdaFunctionCode_s3Bucket :: (Maybe Text -> f (Maybe Text))
-> AwsLambdaFunctionCode -> f AwsLambdaFunctionCode
awsLambdaFunctionCode_s3Bucket = (AwsLambdaFunctionCode -> Maybe Text)
-> (AwsLambdaFunctionCode -> Maybe Text -> AwsLambdaFunctionCode)
-> Lens
AwsLambdaFunctionCode
AwsLambdaFunctionCode
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsLambdaFunctionCode' {Maybe Text
s3Bucket :: Maybe Text
$sel:s3Bucket:AwsLambdaFunctionCode' :: AwsLambdaFunctionCode -> Maybe Text
s3Bucket} -> Maybe Text
s3Bucket) (\s :: AwsLambdaFunctionCode
s@AwsLambdaFunctionCode' {} Maybe Text
a -> AwsLambdaFunctionCode
s {$sel:s3Bucket:AwsLambdaFunctionCode' :: Maybe Text
s3Bucket = Maybe Text
a} :: AwsLambdaFunctionCode)
instance Core.FromJSON AwsLambdaFunctionCode where
parseJSON :: Value -> Parser AwsLambdaFunctionCode
parseJSON =
String
-> (Object -> Parser AwsLambdaFunctionCode)
-> Value
-> Parser AwsLambdaFunctionCode
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AwsLambdaFunctionCode"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> AwsLambdaFunctionCode
AwsLambdaFunctionCode'
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> AwsLambdaFunctionCode)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> AwsLambdaFunctionCode)
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
"S3ObjectVersion")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> AwsLambdaFunctionCode)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> AwsLambdaFunctionCode)
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
"S3Key")
Parser (Maybe Text -> Maybe Text -> AwsLambdaFunctionCode)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AwsLambdaFunctionCode)
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
"ZipFile")
Parser (Maybe Text -> AwsLambdaFunctionCode)
-> Parser (Maybe Text) -> Parser AwsLambdaFunctionCode
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
"S3Bucket")
)
instance Prelude.Hashable AwsLambdaFunctionCode
instance Prelude.NFData AwsLambdaFunctionCode
instance Core.ToJSON AwsLambdaFunctionCode where
toJSON :: AwsLambdaFunctionCode -> Value
toJSON AwsLambdaFunctionCode' {Maybe Text
s3Bucket :: Maybe Text
zipFile :: Maybe Text
s3Key :: Maybe Text
s3ObjectVersion :: Maybe Text
$sel:s3Bucket:AwsLambdaFunctionCode' :: AwsLambdaFunctionCode -> Maybe Text
$sel:zipFile:AwsLambdaFunctionCode' :: AwsLambdaFunctionCode -> Maybe Text
$sel:s3Key:AwsLambdaFunctionCode' :: AwsLambdaFunctionCode -> Maybe Text
$sel:s3ObjectVersion:AwsLambdaFunctionCode' :: AwsLambdaFunctionCode -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"S3ObjectVersion" 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
s3ObjectVersion,
(Text
"S3Key" 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
s3Key,
(Text
"ZipFile" 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
zipFile,
(Text
"S3Bucket" 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
s3Bucket
]
)