{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CognitoIdentityProvider.Types.LambdaConfigType
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CognitoIdentityProvider.Types.LambdaConfigType where

import Amazonka.CognitoIdentityProvider.Types.CustomEmailLambdaVersionConfigType
import Amazonka.CognitoIdentityProvider.Types.CustomSMSLambdaVersionConfigType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Specifies the configuration for Lambda triggers.
--
-- /See:/ 'newLambdaConfigType' smart constructor.
data LambdaConfigType = LambdaConfigType'
  { -- | A pre-authentication Lambda trigger.
    LambdaConfigType -> Maybe Text
preAuthentication :: Prelude.Maybe Prelude.Text,
    -- | Creates an authentication challenge.
    LambdaConfigType -> Maybe Text
createAuthChallenge :: Prelude.Maybe Prelude.Text,
    -- | Verifies the authentication challenge response.
    LambdaConfigType -> Maybe Text
verifyAuthChallengeResponse :: Prelude.Maybe Prelude.Text,
    -- | A custom SMS sender Lambda trigger.
    LambdaConfigType -> Maybe CustomSMSLambdaVersionConfigType
customSMSSender :: Prelude.Maybe CustomSMSLambdaVersionConfigType,
    -- | A post-authentication Lambda trigger.
    LambdaConfigType -> Maybe Text
postAuthentication :: Prelude.Maybe Prelude.Text,
    -- | A custom Message Lambda trigger.
    LambdaConfigType -> Maybe Text
customMessage :: Prelude.Maybe Prelude.Text,
    -- | Defines the authentication challenge.
    LambdaConfigType -> Maybe Text
defineAuthChallenge :: Prelude.Maybe Prelude.Text,
    -- | A custom email sender Lambda trigger.
    LambdaConfigType -> Maybe CustomEmailLambdaVersionConfigType
customEmailSender :: Prelude.Maybe CustomEmailLambdaVersionConfigType,
    -- | The Amazon Resource Name of Key Management Service
    -- </kms/latest/developerguide/concepts.html#master_keys Customer master keys>
    -- . Amazon Cognito uses the key to encrypt codes and temporary passwords
    -- sent to @CustomEmailSender@ and @CustomSMSSender@.
    LambdaConfigType -> Maybe Text
kmsKeyID :: Prelude.Maybe Prelude.Text,
    -- | A post-confirmation Lambda trigger.
    LambdaConfigType -> Maybe Text
postConfirmation :: Prelude.Maybe Prelude.Text,
    -- | A Lambda trigger that is invoked before token generation.
    LambdaConfigType -> Maybe Text
preTokenGeneration :: Prelude.Maybe Prelude.Text,
    -- | The user migration Lambda config type.
    LambdaConfigType -> Maybe Text
userMigration :: Prelude.Maybe Prelude.Text,
    -- | A pre-registration Lambda trigger.
    LambdaConfigType -> Maybe Text
preSignUp :: Prelude.Maybe Prelude.Text
  }
  deriving (LambdaConfigType -> LambdaConfigType -> Bool
(LambdaConfigType -> LambdaConfigType -> Bool)
-> (LambdaConfigType -> LambdaConfigType -> Bool)
-> Eq LambdaConfigType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaConfigType -> LambdaConfigType -> Bool
$c/= :: LambdaConfigType -> LambdaConfigType -> Bool
== :: LambdaConfigType -> LambdaConfigType -> Bool
$c== :: LambdaConfigType -> LambdaConfigType -> Bool
Prelude.Eq, ReadPrec [LambdaConfigType]
ReadPrec LambdaConfigType
Int -> ReadS LambdaConfigType
ReadS [LambdaConfigType]
(Int -> ReadS LambdaConfigType)
-> ReadS [LambdaConfigType]
-> ReadPrec LambdaConfigType
-> ReadPrec [LambdaConfigType]
-> Read LambdaConfigType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LambdaConfigType]
$creadListPrec :: ReadPrec [LambdaConfigType]
readPrec :: ReadPrec LambdaConfigType
$creadPrec :: ReadPrec LambdaConfigType
readList :: ReadS [LambdaConfigType]
$creadList :: ReadS [LambdaConfigType]
readsPrec :: Int -> ReadS LambdaConfigType
$creadsPrec :: Int -> ReadS LambdaConfigType
Prelude.Read, Int -> LambdaConfigType -> ShowS
[LambdaConfigType] -> ShowS
LambdaConfigType -> String
(Int -> LambdaConfigType -> ShowS)
-> (LambdaConfigType -> String)
-> ([LambdaConfigType] -> ShowS)
-> Show LambdaConfigType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaConfigType] -> ShowS
$cshowList :: [LambdaConfigType] -> ShowS
show :: LambdaConfigType -> String
$cshow :: LambdaConfigType -> String
showsPrec :: Int -> LambdaConfigType -> ShowS
$cshowsPrec :: Int -> LambdaConfigType -> ShowS
Prelude.Show, (forall x. LambdaConfigType -> Rep LambdaConfigType x)
-> (forall x. Rep LambdaConfigType x -> LambdaConfigType)
-> Generic LambdaConfigType
forall x. Rep LambdaConfigType x -> LambdaConfigType
forall x. LambdaConfigType -> Rep LambdaConfigType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LambdaConfigType x -> LambdaConfigType
$cfrom :: forall x. LambdaConfigType -> Rep LambdaConfigType x
Prelude.Generic)

-- |
-- Create a value of 'LambdaConfigType' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'preAuthentication', 'lambdaConfigType_preAuthentication' - A pre-authentication Lambda trigger.
--
-- 'createAuthChallenge', 'lambdaConfigType_createAuthChallenge' - Creates an authentication challenge.
--
-- 'verifyAuthChallengeResponse', 'lambdaConfigType_verifyAuthChallengeResponse' - Verifies the authentication challenge response.
--
-- 'customSMSSender', 'lambdaConfigType_customSMSSender' - A custom SMS sender Lambda trigger.
--
-- 'postAuthentication', 'lambdaConfigType_postAuthentication' - A post-authentication Lambda trigger.
--
-- 'customMessage', 'lambdaConfigType_customMessage' - A custom Message Lambda trigger.
--
-- 'defineAuthChallenge', 'lambdaConfigType_defineAuthChallenge' - Defines the authentication challenge.
--
-- 'customEmailSender', 'lambdaConfigType_customEmailSender' - A custom email sender Lambda trigger.
--
-- 'kmsKeyID', 'lambdaConfigType_kmsKeyID' - The Amazon Resource Name of Key Management Service
-- </kms/latest/developerguide/concepts.html#master_keys Customer master keys>
-- . Amazon Cognito uses the key to encrypt codes and temporary passwords
-- sent to @CustomEmailSender@ and @CustomSMSSender@.
--
-- 'postConfirmation', 'lambdaConfigType_postConfirmation' - A post-confirmation Lambda trigger.
--
-- 'preTokenGeneration', 'lambdaConfigType_preTokenGeneration' - A Lambda trigger that is invoked before token generation.
--
-- 'userMigration', 'lambdaConfigType_userMigration' - The user migration Lambda config type.
--
-- 'preSignUp', 'lambdaConfigType_preSignUp' - A pre-registration Lambda trigger.
newLambdaConfigType ::
  LambdaConfigType
newLambdaConfigType :: LambdaConfigType
newLambdaConfigType =
  LambdaConfigType' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CustomSMSLambdaVersionConfigType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CustomEmailLambdaVersionConfigType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LambdaConfigType
LambdaConfigType'
    { $sel:preAuthentication:LambdaConfigType' :: Maybe Text
preAuthentication =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createAuthChallenge:LambdaConfigType' :: Maybe Text
createAuthChallenge = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:verifyAuthChallengeResponse:LambdaConfigType' :: Maybe Text
verifyAuthChallengeResponse = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customSMSSender:LambdaConfigType' :: Maybe CustomSMSLambdaVersionConfigType
customSMSSender = Maybe CustomSMSLambdaVersionConfigType
forall a. Maybe a
Prelude.Nothing,
      $sel:postAuthentication:LambdaConfigType' :: Maybe Text
postAuthentication = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customMessage:LambdaConfigType' :: Maybe Text
customMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defineAuthChallenge:LambdaConfigType' :: Maybe Text
defineAuthChallenge = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customEmailSender:LambdaConfigType' :: Maybe CustomEmailLambdaVersionConfigType
customEmailSender = Maybe CustomEmailLambdaVersionConfigType
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyID:LambdaConfigType' :: Maybe Text
kmsKeyID = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:postConfirmation:LambdaConfigType' :: Maybe Text
postConfirmation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:preTokenGeneration:LambdaConfigType' :: Maybe Text
preTokenGeneration = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userMigration:LambdaConfigType' :: Maybe Text
userMigration = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:preSignUp:LambdaConfigType' :: Maybe Text
preSignUp = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A pre-authentication Lambda trigger.
lambdaConfigType_preAuthentication :: Lens.Lens' LambdaConfigType (Prelude.Maybe Prelude.Text)
lambdaConfigType_preAuthentication :: (Maybe Text -> f (Maybe Text))
-> LambdaConfigType -> f LambdaConfigType
lambdaConfigType_preAuthentication = (LambdaConfigType -> Maybe Text)
-> (LambdaConfigType -> Maybe Text -> LambdaConfigType)
-> Lens LambdaConfigType LambdaConfigType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaConfigType' {Maybe Text
preAuthentication :: Maybe Text
$sel:preAuthentication:LambdaConfigType' :: LambdaConfigType -> Maybe Text
preAuthentication} -> Maybe Text
preAuthentication) (\s :: LambdaConfigType
s@LambdaConfigType' {} Maybe Text
a -> LambdaConfigType
s {$sel:preAuthentication:LambdaConfigType' :: Maybe Text
preAuthentication = Maybe Text
a} :: LambdaConfigType)

-- | Creates an authentication challenge.
lambdaConfigType_createAuthChallenge :: Lens.Lens' LambdaConfigType (Prelude.Maybe Prelude.Text)
lambdaConfigType_createAuthChallenge :: (Maybe Text -> f (Maybe Text))
-> LambdaConfigType -> f LambdaConfigType
lambdaConfigType_createAuthChallenge = (LambdaConfigType -> Maybe Text)
-> (LambdaConfigType -> Maybe Text -> LambdaConfigType)
-> Lens LambdaConfigType LambdaConfigType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaConfigType' {Maybe Text
createAuthChallenge :: Maybe Text
$sel:createAuthChallenge:LambdaConfigType' :: LambdaConfigType -> Maybe Text
createAuthChallenge} -> Maybe Text
createAuthChallenge) (\s :: LambdaConfigType
s@LambdaConfigType' {} Maybe Text
a -> LambdaConfigType
s {$sel:createAuthChallenge:LambdaConfigType' :: Maybe Text
createAuthChallenge = Maybe Text
a} :: LambdaConfigType)

-- | Verifies the authentication challenge response.
lambdaConfigType_verifyAuthChallengeResponse :: Lens.Lens' LambdaConfigType (Prelude.Maybe Prelude.Text)
lambdaConfigType_verifyAuthChallengeResponse :: (Maybe Text -> f (Maybe Text))
-> LambdaConfigType -> f LambdaConfigType
lambdaConfigType_verifyAuthChallengeResponse = (LambdaConfigType -> Maybe Text)
-> (LambdaConfigType -> Maybe Text -> LambdaConfigType)
-> Lens LambdaConfigType LambdaConfigType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaConfigType' {Maybe Text
verifyAuthChallengeResponse :: Maybe Text
$sel:verifyAuthChallengeResponse:LambdaConfigType' :: LambdaConfigType -> Maybe Text
verifyAuthChallengeResponse} -> Maybe Text
verifyAuthChallengeResponse) (\s :: LambdaConfigType
s@LambdaConfigType' {} Maybe Text
a -> LambdaConfigType
s {$sel:verifyAuthChallengeResponse:LambdaConfigType' :: Maybe Text
verifyAuthChallengeResponse = Maybe Text
a} :: LambdaConfigType)

-- | A custom SMS sender Lambda trigger.
lambdaConfigType_customSMSSender :: Lens.Lens' LambdaConfigType (Prelude.Maybe CustomSMSLambdaVersionConfigType)
lambdaConfigType_customSMSSender :: (Maybe CustomSMSLambdaVersionConfigType
 -> f (Maybe CustomSMSLambdaVersionConfigType))
-> LambdaConfigType -> f LambdaConfigType
lambdaConfigType_customSMSSender = (LambdaConfigType -> Maybe CustomSMSLambdaVersionConfigType)
-> (LambdaConfigType
    -> Maybe CustomSMSLambdaVersionConfigType -> LambdaConfigType)
-> Lens
     LambdaConfigType
     LambdaConfigType
     (Maybe CustomSMSLambdaVersionConfigType)
     (Maybe CustomSMSLambdaVersionConfigType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaConfigType' {Maybe CustomSMSLambdaVersionConfigType
customSMSSender :: Maybe CustomSMSLambdaVersionConfigType
$sel:customSMSSender:LambdaConfigType' :: LambdaConfigType -> Maybe CustomSMSLambdaVersionConfigType
customSMSSender} -> Maybe CustomSMSLambdaVersionConfigType
customSMSSender) (\s :: LambdaConfigType
s@LambdaConfigType' {} Maybe CustomSMSLambdaVersionConfigType
a -> LambdaConfigType
s {$sel:customSMSSender:LambdaConfigType' :: Maybe CustomSMSLambdaVersionConfigType
customSMSSender = Maybe CustomSMSLambdaVersionConfigType
a} :: LambdaConfigType)

-- | A post-authentication Lambda trigger.
lambdaConfigType_postAuthentication :: Lens.Lens' LambdaConfigType (Prelude.Maybe Prelude.Text)
lambdaConfigType_postAuthentication :: (Maybe Text -> f (Maybe Text))
-> LambdaConfigType -> f LambdaConfigType
lambdaConfigType_postAuthentication = (LambdaConfigType -> Maybe Text)
-> (LambdaConfigType -> Maybe Text -> LambdaConfigType)
-> Lens LambdaConfigType LambdaConfigType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaConfigType' {Maybe Text
postAuthentication :: Maybe Text
$sel:postAuthentication:LambdaConfigType' :: LambdaConfigType -> Maybe Text
postAuthentication} -> Maybe Text
postAuthentication) (\s :: LambdaConfigType
s@LambdaConfigType' {} Maybe Text
a -> LambdaConfigType
s {$sel:postAuthentication:LambdaConfigType' :: Maybe Text
postAuthentication = Maybe Text
a} :: LambdaConfigType)

-- | A custom Message Lambda trigger.
lambdaConfigType_customMessage :: Lens.Lens' LambdaConfigType (Prelude.Maybe Prelude.Text)
lambdaConfigType_customMessage :: (Maybe Text -> f (Maybe Text))
-> LambdaConfigType -> f LambdaConfigType
lambdaConfigType_customMessage = (LambdaConfigType -> Maybe Text)
-> (LambdaConfigType -> Maybe Text -> LambdaConfigType)
-> Lens LambdaConfigType LambdaConfigType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaConfigType' {Maybe Text
customMessage :: Maybe Text
$sel:customMessage:LambdaConfigType' :: LambdaConfigType -> Maybe Text
customMessage} -> Maybe Text
customMessage) (\s :: LambdaConfigType
s@LambdaConfigType' {} Maybe Text
a -> LambdaConfigType
s {$sel:customMessage:LambdaConfigType' :: Maybe Text
customMessage = Maybe Text
a} :: LambdaConfigType)

-- | Defines the authentication challenge.
lambdaConfigType_defineAuthChallenge :: Lens.Lens' LambdaConfigType (Prelude.Maybe Prelude.Text)
lambdaConfigType_defineAuthChallenge :: (Maybe Text -> f (Maybe Text))
-> LambdaConfigType -> f LambdaConfigType
lambdaConfigType_defineAuthChallenge = (LambdaConfigType -> Maybe Text)
-> (LambdaConfigType -> Maybe Text -> LambdaConfigType)
-> Lens LambdaConfigType LambdaConfigType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaConfigType' {Maybe Text
defineAuthChallenge :: Maybe Text
$sel:defineAuthChallenge:LambdaConfigType' :: LambdaConfigType -> Maybe Text
defineAuthChallenge} -> Maybe Text
defineAuthChallenge) (\s :: LambdaConfigType
s@LambdaConfigType' {} Maybe Text
a -> LambdaConfigType
s {$sel:defineAuthChallenge:LambdaConfigType' :: Maybe Text
defineAuthChallenge = Maybe Text
a} :: LambdaConfigType)

-- | A custom email sender Lambda trigger.
lambdaConfigType_customEmailSender :: Lens.Lens' LambdaConfigType (Prelude.Maybe CustomEmailLambdaVersionConfigType)
lambdaConfigType_customEmailSender :: (Maybe CustomEmailLambdaVersionConfigType
 -> f (Maybe CustomEmailLambdaVersionConfigType))
-> LambdaConfigType -> f LambdaConfigType
lambdaConfigType_customEmailSender = (LambdaConfigType -> Maybe CustomEmailLambdaVersionConfigType)
-> (LambdaConfigType
    -> Maybe CustomEmailLambdaVersionConfigType -> LambdaConfigType)
-> Lens
     LambdaConfigType
     LambdaConfigType
     (Maybe CustomEmailLambdaVersionConfigType)
     (Maybe CustomEmailLambdaVersionConfigType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaConfigType' {Maybe CustomEmailLambdaVersionConfigType
customEmailSender :: Maybe CustomEmailLambdaVersionConfigType
$sel:customEmailSender:LambdaConfigType' :: LambdaConfigType -> Maybe CustomEmailLambdaVersionConfigType
customEmailSender} -> Maybe CustomEmailLambdaVersionConfigType
customEmailSender) (\s :: LambdaConfigType
s@LambdaConfigType' {} Maybe CustomEmailLambdaVersionConfigType
a -> LambdaConfigType
s {$sel:customEmailSender:LambdaConfigType' :: Maybe CustomEmailLambdaVersionConfigType
customEmailSender = Maybe CustomEmailLambdaVersionConfigType
a} :: LambdaConfigType)

-- | The Amazon Resource Name of Key Management Service
-- </kms/latest/developerguide/concepts.html#master_keys Customer master keys>
-- . Amazon Cognito uses the key to encrypt codes and temporary passwords
-- sent to @CustomEmailSender@ and @CustomSMSSender@.
lambdaConfigType_kmsKeyID :: Lens.Lens' LambdaConfigType (Prelude.Maybe Prelude.Text)
lambdaConfigType_kmsKeyID :: (Maybe Text -> f (Maybe Text))
-> LambdaConfigType -> f LambdaConfigType
lambdaConfigType_kmsKeyID = (LambdaConfigType -> Maybe Text)
-> (LambdaConfigType -> Maybe Text -> LambdaConfigType)
-> Lens LambdaConfigType LambdaConfigType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaConfigType' {Maybe Text
kmsKeyID :: Maybe Text
$sel:kmsKeyID:LambdaConfigType' :: LambdaConfigType -> Maybe Text
kmsKeyID} -> Maybe Text
kmsKeyID) (\s :: LambdaConfigType
s@LambdaConfigType' {} Maybe Text
a -> LambdaConfigType
s {$sel:kmsKeyID:LambdaConfigType' :: Maybe Text
kmsKeyID = Maybe Text
a} :: LambdaConfigType)

-- | A post-confirmation Lambda trigger.
lambdaConfigType_postConfirmation :: Lens.Lens' LambdaConfigType (Prelude.Maybe Prelude.Text)
lambdaConfigType_postConfirmation :: (Maybe Text -> f (Maybe Text))
-> LambdaConfigType -> f LambdaConfigType
lambdaConfigType_postConfirmation = (LambdaConfigType -> Maybe Text)
-> (LambdaConfigType -> Maybe Text -> LambdaConfigType)
-> Lens LambdaConfigType LambdaConfigType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaConfigType' {Maybe Text
postConfirmation :: Maybe Text
$sel:postConfirmation:LambdaConfigType' :: LambdaConfigType -> Maybe Text
postConfirmation} -> Maybe Text
postConfirmation) (\s :: LambdaConfigType
s@LambdaConfigType' {} Maybe Text
a -> LambdaConfigType
s {$sel:postConfirmation:LambdaConfigType' :: Maybe Text
postConfirmation = Maybe Text
a} :: LambdaConfigType)

-- | A Lambda trigger that is invoked before token generation.
lambdaConfigType_preTokenGeneration :: Lens.Lens' LambdaConfigType (Prelude.Maybe Prelude.Text)
lambdaConfigType_preTokenGeneration :: (Maybe Text -> f (Maybe Text))
-> LambdaConfigType -> f LambdaConfigType
lambdaConfigType_preTokenGeneration = (LambdaConfigType -> Maybe Text)
-> (LambdaConfigType -> Maybe Text -> LambdaConfigType)
-> Lens LambdaConfigType LambdaConfigType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaConfigType' {Maybe Text
preTokenGeneration :: Maybe Text
$sel:preTokenGeneration:LambdaConfigType' :: LambdaConfigType -> Maybe Text
preTokenGeneration} -> Maybe Text
preTokenGeneration) (\s :: LambdaConfigType
s@LambdaConfigType' {} Maybe Text
a -> LambdaConfigType
s {$sel:preTokenGeneration:LambdaConfigType' :: Maybe Text
preTokenGeneration = Maybe Text
a} :: LambdaConfigType)

-- | The user migration Lambda config type.
lambdaConfigType_userMigration :: Lens.Lens' LambdaConfigType (Prelude.Maybe Prelude.Text)
lambdaConfigType_userMigration :: (Maybe Text -> f (Maybe Text))
-> LambdaConfigType -> f LambdaConfigType
lambdaConfigType_userMigration = (LambdaConfigType -> Maybe Text)
-> (LambdaConfigType -> Maybe Text -> LambdaConfigType)
-> Lens LambdaConfigType LambdaConfigType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaConfigType' {Maybe Text
userMigration :: Maybe Text
$sel:userMigration:LambdaConfigType' :: LambdaConfigType -> Maybe Text
userMigration} -> Maybe Text
userMigration) (\s :: LambdaConfigType
s@LambdaConfigType' {} Maybe Text
a -> LambdaConfigType
s {$sel:userMigration:LambdaConfigType' :: Maybe Text
userMigration = Maybe Text
a} :: LambdaConfigType)

-- | A pre-registration Lambda trigger.
lambdaConfigType_preSignUp :: Lens.Lens' LambdaConfigType (Prelude.Maybe Prelude.Text)
lambdaConfigType_preSignUp :: (Maybe Text -> f (Maybe Text))
-> LambdaConfigType -> f LambdaConfigType
lambdaConfigType_preSignUp = (LambdaConfigType -> Maybe Text)
-> (LambdaConfigType -> Maybe Text -> LambdaConfigType)
-> Lens LambdaConfigType LambdaConfigType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaConfigType' {Maybe Text
preSignUp :: Maybe Text
$sel:preSignUp:LambdaConfigType' :: LambdaConfigType -> Maybe Text
preSignUp} -> Maybe Text
preSignUp) (\s :: LambdaConfigType
s@LambdaConfigType' {} Maybe Text
a -> LambdaConfigType
s {$sel:preSignUp:LambdaConfigType' :: Maybe Text
preSignUp = Maybe Text
a} :: LambdaConfigType)

instance Core.FromJSON LambdaConfigType where
  parseJSON :: Value -> Parser LambdaConfigType
parseJSON =
    String
-> (Object -> Parser LambdaConfigType)
-> Value
-> Parser LambdaConfigType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LambdaConfigType"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CustomSMSLambdaVersionConfigType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CustomEmailLambdaVersionConfigType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LambdaConfigType
LambdaConfigType'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe CustomSMSLambdaVersionConfigType
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe CustomEmailLambdaVersionConfigType
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> LambdaConfigType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe CustomSMSLambdaVersionConfigType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe CustomEmailLambdaVersionConfigType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> LambdaConfigType)
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
"PreAuthentication")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe CustomSMSLambdaVersionConfigType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe CustomEmailLambdaVersionConfigType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> LambdaConfigType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe CustomSMSLambdaVersionConfigType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe CustomEmailLambdaVersionConfigType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> LambdaConfigType)
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
"CreateAuthChallenge")
            Parser
  (Maybe Text
   -> Maybe CustomSMSLambdaVersionConfigType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe CustomEmailLambdaVersionConfigType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> LambdaConfigType)
-> Parser (Maybe Text)
-> Parser
     (Maybe CustomSMSLambdaVersionConfigType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe CustomEmailLambdaVersionConfigType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> LambdaConfigType)
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
"VerifyAuthChallengeResponse")
            Parser
  (Maybe CustomSMSLambdaVersionConfigType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe CustomEmailLambdaVersionConfigType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> LambdaConfigType)
-> Parser (Maybe CustomSMSLambdaVersionConfigType)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe CustomEmailLambdaVersionConfigType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> LambdaConfigType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CustomSMSLambdaVersionConfigType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CustomSMSSender")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe CustomEmailLambdaVersionConfigType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> LambdaConfigType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe CustomEmailLambdaVersionConfigType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> LambdaConfigType)
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
"PostAuthentication")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe CustomEmailLambdaVersionConfigType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> LambdaConfigType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe CustomEmailLambdaVersionConfigType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> LambdaConfigType)
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
"CustomMessage")
            Parser
  (Maybe Text
   -> Maybe CustomEmailLambdaVersionConfigType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> LambdaConfigType)
-> Parser (Maybe Text)
-> Parser
     (Maybe CustomEmailLambdaVersionConfigType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> LambdaConfigType)
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
"DefineAuthChallenge")
            Parser
  (Maybe CustomEmailLambdaVersionConfigType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> LambdaConfigType)
-> Parser (Maybe CustomEmailLambdaVersionConfigType)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> LambdaConfigType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CustomEmailLambdaVersionConfigType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CustomEmailSender")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> LambdaConfigType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> LambdaConfigType)
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
"KMSKeyID")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> LambdaConfigType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> LambdaConfigType)
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
"PostConfirmation")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> LambdaConfigType)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> LambdaConfigType)
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
"PreTokenGeneration")
            Parser (Maybe Text -> Maybe Text -> LambdaConfigType)
-> Parser (Maybe Text) -> Parser (Maybe Text -> LambdaConfigType)
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
"UserMigration")
            Parser (Maybe Text -> LambdaConfigType)
-> Parser (Maybe Text) -> Parser LambdaConfigType
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
"PreSignUp")
      )

instance Prelude.Hashable LambdaConfigType

instance Prelude.NFData LambdaConfigType

instance Core.ToJSON LambdaConfigType where
  toJSON :: LambdaConfigType -> Value
toJSON LambdaConfigType' {Maybe Text
Maybe CustomEmailLambdaVersionConfigType
Maybe CustomSMSLambdaVersionConfigType
preSignUp :: Maybe Text
userMigration :: Maybe Text
preTokenGeneration :: Maybe Text
postConfirmation :: Maybe Text
kmsKeyID :: Maybe Text
customEmailSender :: Maybe CustomEmailLambdaVersionConfigType
defineAuthChallenge :: Maybe Text
customMessage :: Maybe Text
postAuthentication :: Maybe Text
customSMSSender :: Maybe CustomSMSLambdaVersionConfigType
verifyAuthChallengeResponse :: Maybe Text
createAuthChallenge :: Maybe Text
preAuthentication :: Maybe Text
$sel:preSignUp:LambdaConfigType' :: LambdaConfigType -> Maybe Text
$sel:userMigration:LambdaConfigType' :: LambdaConfigType -> Maybe Text
$sel:preTokenGeneration:LambdaConfigType' :: LambdaConfigType -> Maybe Text
$sel:postConfirmation:LambdaConfigType' :: LambdaConfigType -> Maybe Text
$sel:kmsKeyID:LambdaConfigType' :: LambdaConfigType -> Maybe Text
$sel:customEmailSender:LambdaConfigType' :: LambdaConfigType -> Maybe CustomEmailLambdaVersionConfigType
$sel:defineAuthChallenge:LambdaConfigType' :: LambdaConfigType -> Maybe Text
$sel:customMessage:LambdaConfigType' :: LambdaConfigType -> Maybe Text
$sel:postAuthentication:LambdaConfigType' :: LambdaConfigType -> Maybe Text
$sel:customSMSSender:LambdaConfigType' :: LambdaConfigType -> Maybe CustomSMSLambdaVersionConfigType
$sel:verifyAuthChallengeResponse:LambdaConfigType' :: LambdaConfigType -> Maybe Text
$sel:createAuthChallenge:LambdaConfigType' :: LambdaConfigType -> Maybe Text
$sel:preAuthentication:LambdaConfigType' :: LambdaConfigType -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"PreAuthentication" 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
preAuthentication,
            (Text
"CreateAuthChallenge" 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
createAuthChallenge,
            (Text
"VerifyAuthChallengeResponse" 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
verifyAuthChallengeResponse,
            (Text
"CustomSMSSender" Text -> CustomSMSLambdaVersionConfigType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (CustomSMSLambdaVersionConfigType -> Pair)
-> Maybe CustomSMSLambdaVersionConfigType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CustomSMSLambdaVersionConfigType
customSMSSender,
            (Text
"PostAuthentication" 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
postAuthentication,
            (Text
"CustomMessage" 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
customMessage,
            (Text
"DefineAuthChallenge" 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
defineAuthChallenge,
            (Text
"CustomEmailSender" Text -> CustomEmailLambdaVersionConfigType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (CustomEmailLambdaVersionConfigType -> Pair)
-> Maybe CustomEmailLambdaVersionConfigType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CustomEmailLambdaVersionConfigType
customEmailSender,
            (Text
"KMSKeyID" 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
kmsKeyID,
            (Text
"PostConfirmation" 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
postConfirmation,
            (Text
"PreTokenGeneration" 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
preTokenGeneration,
            (Text
"UserMigration" 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
userMigration,
            (Text
"PreSignUp" 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
preSignUp
          ]
      )