{-# 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.Lambda.Types.EnvironmentError where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data EnvironmentError = EnvironmentError'
{
EnvironmentError -> Maybe Text
errorCode :: Prelude.Maybe Prelude.Text,
EnvironmentError -> Maybe (Sensitive Text)
message :: Prelude.Maybe (Data.Sensitive Prelude.Text)
}
deriving (EnvironmentError -> EnvironmentError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnvironmentError -> EnvironmentError -> Bool
$c/= :: EnvironmentError -> EnvironmentError -> Bool
== :: EnvironmentError -> EnvironmentError -> Bool
$c== :: EnvironmentError -> EnvironmentError -> Bool
Prelude.Eq, Int -> EnvironmentError -> ShowS
[EnvironmentError] -> ShowS
EnvironmentError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnvironmentError] -> ShowS
$cshowList :: [EnvironmentError] -> ShowS
show :: EnvironmentError -> String
$cshow :: EnvironmentError -> String
showsPrec :: Int -> EnvironmentError -> ShowS
$cshowsPrec :: Int -> EnvironmentError -> ShowS
Prelude.Show, forall x. Rep EnvironmentError x -> EnvironmentError
forall x. EnvironmentError -> Rep EnvironmentError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnvironmentError x -> EnvironmentError
$cfrom :: forall x. EnvironmentError -> Rep EnvironmentError x
Prelude.Generic)
newEnvironmentError ::
EnvironmentError
newEnvironmentError :: EnvironmentError
newEnvironmentError =
EnvironmentError'
{ $sel:errorCode:EnvironmentError' :: Maybe Text
errorCode = forall a. Maybe a
Prelude.Nothing,
$sel:message:EnvironmentError' :: Maybe (Sensitive Text)
message = forall a. Maybe a
Prelude.Nothing
}
environmentError_errorCode :: Lens.Lens' EnvironmentError (Prelude.Maybe Prelude.Text)
environmentError_errorCode :: Lens' EnvironmentError (Maybe Text)
environmentError_errorCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentError' {Maybe Text
errorCode :: Maybe Text
$sel:errorCode:EnvironmentError' :: EnvironmentError -> Maybe Text
errorCode} -> Maybe Text
errorCode) (\s :: EnvironmentError
s@EnvironmentError' {} Maybe Text
a -> EnvironmentError
s {$sel:errorCode:EnvironmentError' :: Maybe Text
errorCode = Maybe Text
a} :: EnvironmentError)
environmentError_message :: Lens.Lens' EnvironmentError (Prelude.Maybe Prelude.Text)
environmentError_message :: Lens' EnvironmentError (Maybe Text)
environmentError_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentError' {Maybe (Sensitive Text)
message :: Maybe (Sensitive Text)
$sel:message:EnvironmentError' :: EnvironmentError -> Maybe (Sensitive Text)
message} -> Maybe (Sensitive Text)
message) (\s :: EnvironmentError
s@EnvironmentError' {} Maybe (Sensitive Text)
a -> EnvironmentError
s {$sel:message:EnvironmentError' :: Maybe (Sensitive Text)
message = Maybe (Sensitive Text)
a} :: EnvironmentError) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
instance Data.FromJSON EnvironmentError where
parseJSON :: Value -> Parser EnvironmentError
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EnvironmentError"
( \Object
x ->
Maybe Text -> Maybe (Sensitive Text) -> EnvironmentError
EnvironmentError'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ErrorCode")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Message")
)
instance Prelude.Hashable EnvironmentError where
hashWithSalt :: Int -> EnvironmentError -> Int
hashWithSalt Int
_salt EnvironmentError' {Maybe Text
Maybe (Sensitive Text)
message :: Maybe (Sensitive Text)
errorCode :: Maybe Text
$sel:message:EnvironmentError' :: EnvironmentError -> Maybe (Sensitive Text)
$sel:errorCode:EnvironmentError' :: EnvironmentError -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
message
instance Prelude.NFData EnvironmentError where
rnf :: EnvironmentError -> ()
rnf EnvironmentError' {Maybe Text
Maybe (Sensitive Text)
message :: Maybe (Sensitive Text)
errorCode :: Maybe Text
$sel:message:EnvironmentError' :: EnvironmentError -> Maybe (Sensitive Text)
$sel:errorCode:EnvironmentError' :: EnvironmentError -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
message