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