{-# 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.UsernameConfigurationType where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UsernameConfigurationType = UsernameConfigurationType'
{
UsernameConfigurationType -> Bool
caseSensitive :: Prelude.Bool
}
deriving (UsernameConfigurationType -> UsernameConfigurationType -> Bool
(UsernameConfigurationType -> UsernameConfigurationType -> Bool)
-> (UsernameConfigurationType -> UsernameConfigurationType -> Bool)
-> Eq UsernameConfigurationType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UsernameConfigurationType -> UsernameConfigurationType -> Bool
$c/= :: UsernameConfigurationType -> UsernameConfigurationType -> Bool
== :: UsernameConfigurationType -> UsernameConfigurationType -> Bool
$c== :: UsernameConfigurationType -> UsernameConfigurationType -> Bool
Prelude.Eq, ReadPrec [UsernameConfigurationType]
ReadPrec UsernameConfigurationType
Int -> ReadS UsernameConfigurationType
ReadS [UsernameConfigurationType]
(Int -> ReadS UsernameConfigurationType)
-> ReadS [UsernameConfigurationType]
-> ReadPrec UsernameConfigurationType
-> ReadPrec [UsernameConfigurationType]
-> Read UsernameConfigurationType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UsernameConfigurationType]
$creadListPrec :: ReadPrec [UsernameConfigurationType]
readPrec :: ReadPrec UsernameConfigurationType
$creadPrec :: ReadPrec UsernameConfigurationType
readList :: ReadS [UsernameConfigurationType]
$creadList :: ReadS [UsernameConfigurationType]
readsPrec :: Int -> ReadS UsernameConfigurationType
$creadsPrec :: Int -> ReadS UsernameConfigurationType
Prelude.Read, Int -> UsernameConfigurationType -> ShowS
[UsernameConfigurationType] -> ShowS
UsernameConfigurationType -> String
(Int -> UsernameConfigurationType -> ShowS)
-> (UsernameConfigurationType -> String)
-> ([UsernameConfigurationType] -> ShowS)
-> Show UsernameConfigurationType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UsernameConfigurationType] -> ShowS
$cshowList :: [UsernameConfigurationType] -> ShowS
show :: UsernameConfigurationType -> String
$cshow :: UsernameConfigurationType -> String
showsPrec :: Int -> UsernameConfigurationType -> ShowS
$cshowsPrec :: Int -> UsernameConfigurationType -> ShowS
Prelude.Show, (forall x.
UsernameConfigurationType -> Rep UsernameConfigurationType x)
-> (forall x.
Rep UsernameConfigurationType x -> UsernameConfigurationType)
-> Generic UsernameConfigurationType
forall x.
Rep UsernameConfigurationType x -> UsernameConfigurationType
forall x.
UsernameConfigurationType -> Rep UsernameConfigurationType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UsernameConfigurationType x -> UsernameConfigurationType
$cfrom :: forall x.
UsernameConfigurationType -> Rep UsernameConfigurationType x
Prelude.Generic)
newUsernameConfigurationType ::
Prelude.Bool ->
UsernameConfigurationType
newUsernameConfigurationType :: Bool -> UsernameConfigurationType
newUsernameConfigurationType Bool
pCaseSensitive_ =
UsernameConfigurationType' :: Bool -> UsernameConfigurationType
UsernameConfigurationType'
{ $sel:caseSensitive:UsernameConfigurationType' :: Bool
caseSensitive =
Bool
pCaseSensitive_
}
usernameConfigurationType_caseSensitive :: Lens.Lens' UsernameConfigurationType Prelude.Bool
usernameConfigurationType_caseSensitive :: (Bool -> f Bool)
-> UsernameConfigurationType -> f UsernameConfigurationType
usernameConfigurationType_caseSensitive = (UsernameConfigurationType -> Bool)
-> (UsernameConfigurationType -> Bool -> UsernameConfigurationType)
-> Lens
UsernameConfigurationType UsernameConfigurationType Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsernameConfigurationType' {Bool
caseSensitive :: Bool
$sel:caseSensitive:UsernameConfigurationType' :: UsernameConfigurationType -> Bool
caseSensitive} -> Bool
caseSensitive) (\s :: UsernameConfigurationType
s@UsernameConfigurationType' {} Bool
a -> UsernameConfigurationType
s {$sel:caseSensitive:UsernameConfigurationType' :: Bool
caseSensitive = Bool
a} :: UsernameConfigurationType)
instance Core.FromJSON UsernameConfigurationType where
parseJSON :: Value -> Parser UsernameConfigurationType
parseJSON =
String
-> (Object -> Parser UsernameConfigurationType)
-> Value
-> Parser UsernameConfigurationType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UsernameConfigurationType"
( \Object
x ->
Bool -> UsernameConfigurationType
UsernameConfigurationType'
(Bool -> UsernameConfigurationType)
-> Parser Bool -> Parser UsernameConfigurationType
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CaseSensitive")
)
instance Prelude.Hashable UsernameConfigurationType
instance Prelude.NFData UsernameConfigurationType
instance Core.ToJSON UsernameConfigurationType where
toJSON :: UsernameConfigurationType -> Value
toJSON UsernameConfigurationType' {Bool
caseSensitive :: Bool
$sel:caseSensitive:UsernameConfigurationType' :: UsernameConfigurationType -> Bool
..} =
[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
"CaseSensitive" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
caseSensitive)
]
)