{-# 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.AccountTakeoverActionsType
-- 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.AccountTakeoverActionsType where

import Amazonka.CognitoIdentityProvider.Types.AccountTakeoverActionType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Account takeover actions type.
--
-- /See:/ 'newAccountTakeoverActionsType' smart constructor.
data AccountTakeoverActionsType = AccountTakeoverActionsType'
  { -- | Action to take for a low risk.
    AccountTakeoverActionsType -> Maybe AccountTakeoverActionType
lowAction :: Prelude.Maybe AccountTakeoverActionType,
    -- | Action to take for a high risk.
    AccountTakeoverActionsType -> Maybe AccountTakeoverActionType
highAction :: Prelude.Maybe AccountTakeoverActionType,
    -- | Action to take for a medium risk.
    AccountTakeoverActionsType -> Maybe AccountTakeoverActionType
mediumAction :: Prelude.Maybe AccountTakeoverActionType
  }
  deriving (AccountTakeoverActionsType -> AccountTakeoverActionsType -> Bool
(AccountTakeoverActionsType -> AccountTakeoverActionsType -> Bool)
-> (AccountTakeoverActionsType
    -> AccountTakeoverActionsType -> Bool)
-> Eq AccountTakeoverActionsType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountTakeoverActionsType -> AccountTakeoverActionsType -> Bool
$c/= :: AccountTakeoverActionsType -> AccountTakeoverActionsType -> Bool
== :: AccountTakeoverActionsType -> AccountTakeoverActionsType -> Bool
$c== :: AccountTakeoverActionsType -> AccountTakeoverActionsType -> Bool
Prelude.Eq, ReadPrec [AccountTakeoverActionsType]
ReadPrec AccountTakeoverActionsType
Int -> ReadS AccountTakeoverActionsType
ReadS [AccountTakeoverActionsType]
(Int -> ReadS AccountTakeoverActionsType)
-> ReadS [AccountTakeoverActionsType]
-> ReadPrec AccountTakeoverActionsType
-> ReadPrec [AccountTakeoverActionsType]
-> Read AccountTakeoverActionsType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccountTakeoverActionsType]
$creadListPrec :: ReadPrec [AccountTakeoverActionsType]
readPrec :: ReadPrec AccountTakeoverActionsType
$creadPrec :: ReadPrec AccountTakeoverActionsType
readList :: ReadS [AccountTakeoverActionsType]
$creadList :: ReadS [AccountTakeoverActionsType]
readsPrec :: Int -> ReadS AccountTakeoverActionsType
$creadsPrec :: Int -> ReadS AccountTakeoverActionsType
Prelude.Read, Int -> AccountTakeoverActionsType -> ShowS
[AccountTakeoverActionsType] -> ShowS
AccountTakeoverActionsType -> String
(Int -> AccountTakeoverActionsType -> ShowS)
-> (AccountTakeoverActionsType -> String)
-> ([AccountTakeoverActionsType] -> ShowS)
-> Show AccountTakeoverActionsType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountTakeoverActionsType] -> ShowS
$cshowList :: [AccountTakeoverActionsType] -> ShowS
show :: AccountTakeoverActionsType -> String
$cshow :: AccountTakeoverActionsType -> String
showsPrec :: Int -> AccountTakeoverActionsType -> ShowS
$cshowsPrec :: Int -> AccountTakeoverActionsType -> ShowS
Prelude.Show, (forall x.
 AccountTakeoverActionsType -> Rep AccountTakeoverActionsType x)
-> (forall x.
    Rep AccountTakeoverActionsType x -> AccountTakeoverActionsType)
-> Generic AccountTakeoverActionsType
forall x.
Rep AccountTakeoverActionsType x -> AccountTakeoverActionsType
forall x.
AccountTakeoverActionsType -> Rep AccountTakeoverActionsType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AccountTakeoverActionsType x -> AccountTakeoverActionsType
$cfrom :: forall x.
AccountTakeoverActionsType -> Rep AccountTakeoverActionsType x
Prelude.Generic)

-- |
-- Create a value of 'AccountTakeoverActionsType' 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:
--
-- 'lowAction', 'accountTakeoverActionsType_lowAction' - Action to take for a low risk.
--
-- 'highAction', 'accountTakeoverActionsType_highAction' - Action to take for a high risk.
--
-- 'mediumAction', 'accountTakeoverActionsType_mediumAction' - Action to take for a medium risk.
newAccountTakeoverActionsType ::
  AccountTakeoverActionsType
newAccountTakeoverActionsType :: AccountTakeoverActionsType
newAccountTakeoverActionsType =
  AccountTakeoverActionsType' :: Maybe AccountTakeoverActionType
-> Maybe AccountTakeoverActionType
-> Maybe AccountTakeoverActionType
-> AccountTakeoverActionsType
AccountTakeoverActionsType'
    { $sel:lowAction:AccountTakeoverActionsType' :: Maybe AccountTakeoverActionType
lowAction =
        Maybe AccountTakeoverActionType
forall a. Maybe a
Prelude.Nothing,
      $sel:highAction:AccountTakeoverActionsType' :: Maybe AccountTakeoverActionType
highAction = Maybe AccountTakeoverActionType
forall a. Maybe a
Prelude.Nothing,
      $sel:mediumAction:AccountTakeoverActionsType' :: Maybe AccountTakeoverActionType
mediumAction = Maybe AccountTakeoverActionType
forall a. Maybe a
Prelude.Nothing
    }

-- | Action to take for a low risk.
accountTakeoverActionsType_lowAction :: Lens.Lens' AccountTakeoverActionsType (Prelude.Maybe AccountTakeoverActionType)
accountTakeoverActionsType_lowAction :: (Maybe AccountTakeoverActionType
 -> f (Maybe AccountTakeoverActionType))
-> AccountTakeoverActionsType -> f AccountTakeoverActionsType
accountTakeoverActionsType_lowAction = (AccountTakeoverActionsType -> Maybe AccountTakeoverActionType)
-> (AccountTakeoverActionsType
    -> Maybe AccountTakeoverActionType -> AccountTakeoverActionsType)
-> Lens
     AccountTakeoverActionsType
     AccountTakeoverActionsType
     (Maybe AccountTakeoverActionType)
     (Maybe AccountTakeoverActionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountTakeoverActionsType' {Maybe AccountTakeoverActionType
lowAction :: Maybe AccountTakeoverActionType
$sel:lowAction:AccountTakeoverActionsType' :: AccountTakeoverActionsType -> Maybe AccountTakeoverActionType
lowAction} -> Maybe AccountTakeoverActionType
lowAction) (\s :: AccountTakeoverActionsType
s@AccountTakeoverActionsType' {} Maybe AccountTakeoverActionType
a -> AccountTakeoverActionsType
s {$sel:lowAction:AccountTakeoverActionsType' :: Maybe AccountTakeoverActionType
lowAction = Maybe AccountTakeoverActionType
a} :: AccountTakeoverActionsType)

-- | Action to take for a high risk.
accountTakeoverActionsType_highAction :: Lens.Lens' AccountTakeoverActionsType (Prelude.Maybe AccountTakeoverActionType)
accountTakeoverActionsType_highAction :: (Maybe AccountTakeoverActionType
 -> f (Maybe AccountTakeoverActionType))
-> AccountTakeoverActionsType -> f AccountTakeoverActionsType
accountTakeoverActionsType_highAction = (AccountTakeoverActionsType -> Maybe AccountTakeoverActionType)
-> (AccountTakeoverActionsType
    -> Maybe AccountTakeoverActionType -> AccountTakeoverActionsType)
-> Lens
     AccountTakeoverActionsType
     AccountTakeoverActionsType
     (Maybe AccountTakeoverActionType)
     (Maybe AccountTakeoverActionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountTakeoverActionsType' {Maybe AccountTakeoverActionType
highAction :: Maybe AccountTakeoverActionType
$sel:highAction:AccountTakeoverActionsType' :: AccountTakeoverActionsType -> Maybe AccountTakeoverActionType
highAction} -> Maybe AccountTakeoverActionType
highAction) (\s :: AccountTakeoverActionsType
s@AccountTakeoverActionsType' {} Maybe AccountTakeoverActionType
a -> AccountTakeoverActionsType
s {$sel:highAction:AccountTakeoverActionsType' :: Maybe AccountTakeoverActionType
highAction = Maybe AccountTakeoverActionType
a} :: AccountTakeoverActionsType)

-- | Action to take for a medium risk.
accountTakeoverActionsType_mediumAction :: Lens.Lens' AccountTakeoverActionsType (Prelude.Maybe AccountTakeoverActionType)
accountTakeoverActionsType_mediumAction :: (Maybe AccountTakeoverActionType
 -> f (Maybe AccountTakeoverActionType))
-> AccountTakeoverActionsType -> f AccountTakeoverActionsType
accountTakeoverActionsType_mediumAction = (AccountTakeoverActionsType -> Maybe AccountTakeoverActionType)
-> (AccountTakeoverActionsType
    -> Maybe AccountTakeoverActionType -> AccountTakeoverActionsType)
-> Lens
     AccountTakeoverActionsType
     AccountTakeoverActionsType
     (Maybe AccountTakeoverActionType)
     (Maybe AccountTakeoverActionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountTakeoverActionsType' {Maybe AccountTakeoverActionType
mediumAction :: Maybe AccountTakeoverActionType
$sel:mediumAction:AccountTakeoverActionsType' :: AccountTakeoverActionsType -> Maybe AccountTakeoverActionType
mediumAction} -> Maybe AccountTakeoverActionType
mediumAction) (\s :: AccountTakeoverActionsType
s@AccountTakeoverActionsType' {} Maybe AccountTakeoverActionType
a -> AccountTakeoverActionsType
s {$sel:mediumAction:AccountTakeoverActionsType' :: Maybe AccountTakeoverActionType
mediumAction = Maybe AccountTakeoverActionType
a} :: AccountTakeoverActionsType)

instance Core.FromJSON AccountTakeoverActionsType where
  parseJSON :: Value -> Parser AccountTakeoverActionsType
parseJSON =
    String
-> (Object -> Parser AccountTakeoverActionsType)
-> Value
-> Parser AccountTakeoverActionsType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AccountTakeoverActionsType"
      ( \Object
x ->
          Maybe AccountTakeoverActionType
-> Maybe AccountTakeoverActionType
-> Maybe AccountTakeoverActionType
-> AccountTakeoverActionsType
AccountTakeoverActionsType'
            (Maybe AccountTakeoverActionType
 -> Maybe AccountTakeoverActionType
 -> Maybe AccountTakeoverActionType
 -> AccountTakeoverActionsType)
-> Parser (Maybe AccountTakeoverActionType)
-> Parser
     (Maybe AccountTakeoverActionType
      -> Maybe AccountTakeoverActionType -> AccountTakeoverActionsType)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AccountTakeoverActionType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LowAction")
            Parser
  (Maybe AccountTakeoverActionType
   -> Maybe AccountTakeoverActionType -> AccountTakeoverActionsType)
-> Parser (Maybe AccountTakeoverActionType)
-> Parser
     (Maybe AccountTakeoverActionType -> AccountTakeoverActionsType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AccountTakeoverActionType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HighAction")
            Parser
  (Maybe AccountTakeoverActionType -> AccountTakeoverActionsType)
-> Parser (Maybe AccountTakeoverActionType)
-> Parser AccountTakeoverActionsType
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AccountTakeoverActionType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MediumAction")
      )

instance Prelude.Hashable AccountTakeoverActionsType

instance Prelude.NFData AccountTakeoverActionsType

instance Core.ToJSON AccountTakeoverActionsType where
  toJSON :: AccountTakeoverActionsType -> Value
toJSON AccountTakeoverActionsType' {Maybe AccountTakeoverActionType
mediumAction :: Maybe AccountTakeoverActionType
highAction :: Maybe AccountTakeoverActionType
lowAction :: Maybe AccountTakeoverActionType
$sel:mediumAction:AccountTakeoverActionsType' :: AccountTakeoverActionsType -> Maybe AccountTakeoverActionType
$sel:highAction:AccountTakeoverActionsType' :: AccountTakeoverActionsType -> Maybe AccountTakeoverActionType
$sel:lowAction:AccountTakeoverActionsType' :: AccountTakeoverActionsType -> Maybe AccountTakeoverActionType
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"LowAction" Text -> AccountTakeoverActionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AccountTakeoverActionType -> Pair)
-> Maybe AccountTakeoverActionType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AccountTakeoverActionType
lowAction,
            (Text
"HighAction" Text -> AccountTakeoverActionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AccountTakeoverActionType -> Pair)
-> Maybe AccountTakeoverActionType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AccountTakeoverActionType
highAction,
            (Text
"MediumAction" Text -> AccountTakeoverActionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AccountTakeoverActionType -> Pair)
-> Maybe AccountTakeoverActionType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AccountTakeoverActionType
mediumAction
          ]
      )