{-# 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.MemoryDb.Types.AuthenticationMode where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MemoryDb.Types.InputAuthenticationType
import qualified Amazonka.Prelude as Prelude
data AuthenticationMode = AuthenticationMode'
{
AuthenticationMode -> Maybe (NonEmpty Text)
passwords :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
AuthenticationMode -> Maybe InputAuthenticationType
type' :: Prelude.Maybe InputAuthenticationType
}
deriving (AuthenticationMode -> AuthenticationMode -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuthenticationMode -> AuthenticationMode -> Bool
$c/= :: AuthenticationMode -> AuthenticationMode -> Bool
== :: AuthenticationMode -> AuthenticationMode -> Bool
$c== :: AuthenticationMode -> AuthenticationMode -> Bool
Prelude.Eq, ReadPrec [AuthenticationMode]
ReadPrec AuthenticationMode
Int -> ReadS AuthenticationMode
ReadS [AuthenticationMode]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AuthenticationMode]
$creadListPrec :: ReadPrec [AuthenticationMode]
readPrec :: ReadPrec AuthenticationMode
$creadPrec :: ReadPrec AuthenticationMode
readList :: ReadS [AuthenticationMode]
$creadList :: ReadS [AuthenticationMode]
readsPrec :: Int -> ReadS AuthenticationMode
$creadsPrec :: Int -> ReadS AuthenticationMode
Prelude.Read, Int -> AuthenticationMode -> ShowS
[AuthenticationMode] -> ShowS
AuthenticationMode -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AuthenticationMode] -> ShowS
$cshowList :: [AuthenticationMode] -> ShowS
show :: AuthenticationMode -> String
$cshow :: AuthenticationMode -> String
showsPrec :: Int -> AuthenticationMode -> ShowS
$cshowsPrec :: Int -> AuthenticationMode -> ShowS
Prelude.Show, forall x. Rep AuthenticationMode x -> AuthenticationMode
forall x. AuthenticationMode -> Rep AuthenticationMode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AuthenticationMode x -> AuthenticationMode
$cfrom :: forall x. AuthenticationMode -> Rep AuthenticationMode x
Prelude.Generic)
newAuthenticationMode ::
AuthenticationMode
newAuthenticationMode :: AuthenticationMode
newAuthenticationMode =
AuthenticationMode'
{ $sel:passwords:AuthenticationMode' :: Maybe (NonEmpty Text)
passwords = forall a. Maybe a
Prelude.Nothing,
$sel:type':AuthenticationMode' :: Maybe InputAuthenticationType
type' = forall a. Maybe a
Prelude.Nothing
}
authenticationMode_passwords :: Lens.Lens' AuthenticationMode (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
authenticationMode_passwords :: Lens' AuthenticationMode (Maybe (NonEmpty Text))
authenticationMode_passwords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationMode' {Maybe (NonEmpty Text)
passwords :: Maybe (NonEmpty Text)
$sel:passwords:AuthenticationMode' :: AuthenticationMode -> Maybe (NonEmpty Text)
passwords} -> Maybe (NonEmpty Text)
passwords) (\s :: AuthenticationMode
s@AuthenticationMode' {} Maybe (NonEmpty Text)
a -> AuthenticationMode
s {$sel:passwords:AuthenticationMode' :: Maybe (NonEmpty Text)
passwords = Maybe (NonEmpty Text)
a} :: AuthenticationMode) 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
authenticationMode_type :: Lens.Lens' AuthenticationMode (Prelude.Maybe InputAuthenticationType)
authenticationMode_type :: Lens' AuthenticationMode (Maybe InputAuthenticationType)
authenticationMode_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationMode' {Maybe InputAuthenticationType
type' :: Maybe InputAuthenticationType
$sel:type':AuthenticationMode' :: AuthenticationMode -> Maybe InputAuthenticationType
type'} -> Maybe InputAuthenticationType
type') (\s :: AuthenticationMode
s@AuthenticationMode' {} Maybe InputAuthenticationType
a -> AuthenticationMode
s {$sel:type':AuthenticationMode' :: Maybe InputAuthenticationType
type' = Maybe InputAuthenticationType
a} :: AuthenticationMode)
instance Prelude.Hashable AuthenticationMode where
hashWithSalt :: Int -> AuthenticationMode -> Int
hashWithSalt Int
_salt AuthenticationMode' {Maybe (NonEmpty Text)
Maybe InputAuthenticationType
type' :: Maybe InputAuthenticationType
passwords :: Maybe (NonEmpty Text)
$sel:type':AuthenticationMode' :: AuthenticationMode -> Maybe InputAuthenticationType
$sel:passwords:AuthenticationMode' :: AuthenticationMode -> Maybe (NonEmpty Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
passwords
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InputAuthenticationType
type'
instance Prelude.NFData AuthenticationMode where
rnf :: AuthenticationMode -> ()
rnf AuthenticationMode' {Maybe (NonEmpty Text)
Maybe InputAuthenticationType
type' :: Maybe InputAuthenticationType
passwords :: Maybe (NonEmpty Text)
$sel:type':AuthenticationMode' :: AuthenticationMode -> Maybe InputAuthenticationType
$sel:passwords:AuthenticationMode' :: AuthenticationMode -> Maybe (NonEmpty Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
passwords
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InputAuthenticationType
type'
instance Data.ToJSON AuthenticationMode where
toJSON :: AuthenticationMode -> Value
toJSON AuthenticationMode' {Maybe (NonEmpty Text)
Maybe InputAuthenticationType
type' :: Maybe InputAuthenticationType
passwords :: Maybe (NonEmpty Text)
$sel:type':AuthenticationMode' :: AuthenticationMode -> Maybe InputAuthenticationType
$sel:passwords:AuthenticationMode' :: AuthenticationMode -> Maybe (NonEmpty Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Passwords" 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 (NonEmpty Text)
passwords,
(Key
"Type" 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 InputAuthenticationType
type'
]
)