{-# 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.CognitoIdentityProvider.Types.RiskExceptionConfigurationType 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 RiskExceptionConfigurationType = RiskExceptionConfigurationType'
{
RiskExceptionConfigurationType -> Maybe [Text]
blockedIPRangeList :: Prelude.Maybe [Prelude.Text],
RiskExceptionConfigurationType -> Maybe [Text]
skippedIPRangeList :: Prelude.Maybe [Prelude.Text]
}
deriving (RiskExceptionConfigurationType
-> RiskExceptionConfigurationType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RiskExceptionConfigurationType
-> RiskExceptionConfigurationType -> Bool
$c/= :: RiskExceptionConfigurationType
-> RiskExceptionConfigurationType -> Bool
== :: RiskExceptionConfigurationType
-> RiskExceptionConfigurationType -> Bool
$c== :: RiskExceptionConfigurationType
-> RiskExceptionConfigurationType -> Bool
Prelude.Eq, ReadPrec [RiskExceptionConfigurationType]
ReadPrec RiskExceptionConfigurationType
Int -> ReadS RiskExceptionConfigurationType
ReadS [RiskExceptionConfigurationType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RiskExceptionConfigurationType]
$creadListPrec :: ReadPrec [RiskExceptionConfigurationType]
readPrec :: ReadPrec RiskExceptionConfigurationType
$creadPrec :: ReadPrec RiskExceptionConfigurationType
readList :: ReadS [RiskExceptionConfigurationType]
$creadList :: ReadS [RiskExceptionConfigurationType]
readsPrec :: Int -> ReadS RiskExceptionConfigurationType
$creadsPrec :: Int -> ReadS RiskExceptionConfigurationType
Prelude.Read, Int -> RiskExceptionConfigurationType -> ShowS
[RiskExceptionConfigurationType] -> ShowS
RiskExceptionConfigurationType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RiskExceptionConfigurationType] -> ShowS
$cshowList :: [RiskExceptionConfigurationType] -> ShowS
show :: RiskExceptionConfigurationType -> String
$cshow :: RiskExceptionConfigurationType -> String
showsPrec :: Int -> RiskExceptionConfigurationType -> ShowS
$cshowsPrec :: Int -> RiskExceptionConfigurationType -> ShowS
Prelude.Show, forall x.
Rep RiskExceptionConfigurationType x
-> RiskExceptionConfigurationType
forall x.
RiskExceptionConfigurationType
-> Rep RiskExceptionConfigurationType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RiskExceptionConfigurationType x
-> RiskExceptionConfigurationType
$cfrom :: forall x.
RiskExceptionConfigurationType
-> Rep RiskExceptionConfigurationType x
Prelude.Generic)
newRiskExceptionConfigurationType ::
RiskExceptionConfigurationType
newRiskExceptionConfigurationType :: RiskExceptionConfigurationType
newRiskExceptionConfigurationType =
RiskExceptionConfigurationType'
{ $sel:blockedIPRangeList:RiskExceptionConfigurationType' :: Maybe [Text]
blockedIPRangeList =
forall a. Maybe a
Prelude.Nothing,
$sel:skippedIPRangeList:RiskExceptionConfigurationType' :: Maybe [Text]
skippedIPRangeList = forall a. Maybe a
Prelude.Nothing
}
riskExceptionConfigurationType_blockedIPRangeList :: Lens.Lens' RiskExceptionConfigurationType (Prelude.Maybe [Prelude.Text])
riskExceptionConfigurationType_blockedIPRangeList :: Lens' RiskExceptionConfigurationType (Maybe [Text])
riskExceptionConfigurationType_blockedIPRangeList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RiskExceptionConfigurationType' {Maybe [Text]
blockedIPRangeList :: Maybe [Text]
$sel:blockedIPRangeList:RiskExceptionConfigurationType' :: RiskExceptionConfigurationType -> Maybe [Text]
blockedIPRangeList} -> Maybe [Text]
blockedIPRangeList) (\s :: RiskExceptionConfigurationType
s@RiskExceptionConfigurationType' {} Maybe [Text]
a -> RiskExceptionConfigurationType
s {$sel:blockedIPRangeList:RiskExceptionConfigurationType' :: Maybe [Text]
blockedIPRangeList = Maybe [Text]
a} :: RiskExceptionConfigurationType) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
riskExceptionConfigurationType_skippedIPRangeList :: Lens.Lens' RiskExceptionConfigurationType (Prelude.Maybe [Prelude.Text])
riskExceptionConfigurationType_skippedIPRangeList :: Lens' RiskExceptionConfigurationType (Maybe [Text])
riskExceptionConfigurationType_skippedIPRangeList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RiskExceptionConfigurationType' {Maybe [Text]
skippedIPRangeList :: Maybe [Text]
$sel:skippedIPRangeList:RiskExceptionConfigurationType' :: RiskExceptionConfigurationType -> Maybe [Text]
skippedIPRangeList} -> Maybe [Text]
skippedIPRangeList) (\s :: RiskExceptionConfigurationType
s@RiskExceptionConfigurationType' {} Maybe [Text]
a -> RiskExceptionConfigurationType
s {$sel:skippedIPRangeList:RiskExceptionConfigurationType' :: Maybe [Text]
skippedIPRangeList = Maybe [Text]
a} :: RiskExceptionConfigurationType) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON RiskExceptionConfigurationType where
parseJSON :: Value -> Parser RiskExceptionConfigurationType
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RiskExceptionConfigurationType"
( \Object
x ->
Maybe [Text] -> Maybe [Text] -> RiskExceptionConfigurationType
RiskExceptionConfigurationType'
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
"BlockedIPRangeList"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
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
"SkippedIPRangeList"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
)
instance
Prelude.Hashable
RiskExceptionConfigurationType
where
hashWithSalt :: Int -> RiskExceptionConfigurationType -> Int
hashWithSalt
Int
_salt
RiskExceptionConfigurationType' {Maybe [Text]
skippedIPRangeList :: Maybe [Text]
blockedIPRangeList :: Maybe [Text]
$sel:skippedIPRangeList:RiskExceptionConfigurationType' :: RiskExceptionConfigurationType -> Maybe [Text]
$sel:blockedIPRangeList:RiskExceptionConfigurationType' :: RiskExceptionConfigurationType -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
blockedIPRangeList
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
skippedIPRangeList
instance
Prelude.NFData
RiskExceptionConfigurationType
where
rnf :: RiskExceptionConfigurationType -> ()
rnf RiskExceptionConfigurationType' {Maybe [Text]
skippedIPRangeList :: Maybe [Text]
blockedIPRangeList :: Maybe [Text]
$sel:skippedIPRangeList:RiskExceptionConfigurationType' :: RiskExceptionConfigurationType -> Maybe [Text]
$sel:blockedIPRangeList:RiskExceptionConfigurationType' :: RiskExceptionConfigurationType -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
blockedIPRangeList
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
skippedIPRangeList
instance Data.ToJSON RiskExceptionConfigurationType where
toJSON :: RiskExceptionConfigurationType -> Value
toJSON RiskExceptionConfigurationType' {Maybe [Text]
skippedIPRangeList :: Maybe [Text]
blockedIPRangeList :: Maybe [Text]
$sel:skippedIPRangeList:RiskExceptionConfigurationType' :: RiskExceptionConfigurationType -> Maybe [Text]
$sel:blockedIPRangeList:RiskExceptionConfigurationType' :: RiskExceptionConfigurationType -> Maybe [Text]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"BlockedIPRangeList" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
blockedIPRangeList,
(Key
"SkippedIPRangeList" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
skippedIPRangeList
]
)