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