{-# 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.RDS.Types.UserAuthConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types.AuthScheme
import Amazonka.RDS.Types.IAMAuthMode
data UserAuthConfig = UserAuthConfig'
{
UserAuthConfig -> Maybe IAMAuthMode
iAMAuth :: Prelude.Maybe IAMAuthMode,
UserAuthConfig -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
UserAuthConfig -> Maybe AuthScheme
authScheme :: Prelude.Maybe AuthScheme,
UserAuthConfig -> Maybe Text
secretArn :: Prelude.Maybe Prelude.Text,
UserAuthConfig -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (UserAuthConfig -> UserAuthConfig -> Bool
(UserAuthConfig -> UserAuthConfig -> Bool)
-> (UserAuthConfig -> UserAuthConfig -> Bool) -> Eq UserAuthConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserAuthConfig -> UserAuthConfig -> Bool
$c/= :: UserAuthConfig -> UserAuthConfig -> Bool
== :: UserAuthConfig -> UserAuthConfig -> Bool
$c== :: UserAuthConfig -> UserAuthConfig -> Bool
Prelude.Eq, ReadPrec [UserAuthConfig]
ReadPrec UserAuthConfig
Int -> ReadS UserAuthConfig
ReadS [UserAuthConfig]
(Int -> ReadS UserAuthConfig)
-> ReadS [UserAuthConfig]
-> ReadPrec UserAuthConfig
-> ReadPrec [UserAuthConfig]
-> Read UserAuthConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserAuthConfig]
$creadListPrec :: ReadPrec [UserAuthConfig]
readPrec :: ReadPrec UserAuthConfig
$creadPrec :: ReadPrec UserAuthConfig
readList :: ReadS [UserAuthConfig]
$creadList :: ReadS [UserAuthConfig]
readsPrec :: Int -> ReadS UserAuthConfig
$creadsPrec :: Int -> ReadS UserAuthConfig
Prelude.Read, Int -> UserAuthConfig -> ShowS
[UserAuthConfig] -> ShowS
UserAuthConfig -> String
(Int -> UserAuthConfig -> ShowS)
-> (UserAuthConfig -> String)
-> ([UserAuthConfig] -> ShowS)
-> Show UserAuthConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserAuthConfig] -> ShowS
$cshowList :: [UserAuthConfig] -> ShowS
show :: UserAuthConfig -> String
$cshow :: UserAuthConfig -> String
showsPrec :: Int -> UserAuthConfig -> ShowS
$cshowsPrec :: Int -> UserAuthConfig -> ShowS
Prelude.Show, (forall x. UserAuthConfig -> Rep UserAuthConfig x)
-> (forall x. Rep UserAuthConfig x -> UserAuthConfig)
-> Generic UserAuthConfig
forall x. Rep UserAuthConfig x -> UserAuthConfig
forall x. UserAuthConfig -> Rep UserAuthConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserAuthConfig x -> UserAuthConfig
$cfrom :: forall x. UserAuthConfig -> Rep UserAuthConfig x
Prelude.Generic)
newUserAuthConfig ::
UserAuthConfig
newUserAuthConfig :: UserAuthConfig
newUserAuthConfig =
UserAuthConfig' :: Maybe IAMAuthMode
-> Maybe Text
-> Maybe AuthScheme
-> Maybe Text
-> Maybe Text
-> UserAuthConfig
UserAuthConfig'
{ $sel:iAMAuth:UserAuthConfig' :: Maybe IAMAuthMode
iAMAuth = Maybe IAMAuthMode
forall a. Maybe a
Prelude.Nothing,
$sel:userName:UserAuthConfig' :: Maybe Text
userName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:authScheme:UserAuthConfig' :: Maybe AuthScheme
authScheme = Maybe AuthScheme
forall a. Maybe a
Prelude.Nothing,
$sel:secretArn:UserAuthConfig' :: Maybe Text
secretArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:UserAuthConfig' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
userAuthConfig_iAMAuth :: Lens.Lens' UserAuthConfig (Prelude.Maybe IAMAuthMode)
userAuthConfig_iAMAuth :: (Maybe IAMAuthMode -> f (Maybe IAMAuthMode))
-> UserAuthConfig -> f UserAuthConfig
userAuthConfig_iAMAuth = (UserAuthConfig -> Maybe IAMAuthMode)
-> (UserAuthConfig -> Maybe IAMAuthMode -> UserAuthConfig)
-> Lens
UserAuthConfig
UserAuthConfig
(Maybe IAMAuthMode)
(Maybe IAMAuthMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserAuthConfig' {Maybe IAMAuthMode
iAMAuth :: Maybe IAMAuthMode
$sel:iAMAuth:UserAuthConfig' :: UserAuthConfig -> Maybe IAMAuthMode
iAMAuth} -> Maybe IAMAuthMode
iAMAuth) (\s :: UserAuthConfig
s@UserAuthConfig' {} Maybe IAMAuthMode
a -> UserAuthConfig
s {$sel:iAMAuth:UserAuthConfig' :: Maybe IAMAuthMode
iAMAuth = Maybe IAMAuthMode
a} :: UserAuthConfig)
userAuthConfig_userName :: Lens.Lens' UserAuthConfig (Prelude.Maybe Prelude.Text)
userAuthConfig_userName :: (Maybe Text -> f (Maybe Text))
-> UserAuthConfig -> f UserAuthConfig
userAuthConfig_userName = (UserAuthConfig -> Maybe Text)
-> (UserAuthConfig -> Maybe Text -> UserAuthConfig)
-> Lens UserAuthConfig UserAuthConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserAuthConfig' {Maybe Text
userName :: Maybe Text
$sel:userName:UserAuthConfig' :: UserAuthConfig -> Maybe Text
userName} -> Maybe Text
userName) (\s :: UserAuthConfig
s@UserAuthConfig' {} Maybe Text
a -> UserAuthConfig
s {$sel:userName:UserAuthConfig' :: Maybe Text
userName = Maybe Text
a} :: UserAuthConfig)
userAuthConfig_authScheme :: Lens.Lens' UserAuthConfig (Prelude.Maybe AuthScheme)
userAuthConfig_authScheme :: (Maybe AuthScheme -> f (Maybe AuthScheme))
-> UserAuthConfig -> f UserAuthConfig
userAuthConfig_authScheme = (UserAuthConfig -> Maybe AuthScheme)
-> (UserAuthConfig -> Maybe AuthScheme -> UserAuthConfig)
-> Lens
UserAuthConfig UserAuthConfig (Maybe AuthScheme) (Maybe AuthScheme)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserAuthConfig' {Maybe AuthScheme
authScheme :: Maybe AuthScheme
$sel:authScheme:UserAuthConfig' :: UserAuthConfig -> Maybe AuthScheme
authScheme} -> Maybe AuthScheme
authScheme) (\s :: UserAuthConfig
s@UserAuthConfig' {} Maybe AuthScheme
a -> UserAuthConfig
s {$sel:authScheme:UserAuthConfig' :: Maybe AuthScheme
authScheme = Maybe AuthScheme
a} :: UserAuthConfig)
userAuthConfig_secretArn :: Lens.Lens' UserAuthConfig (Prelude.Maybe Prelude.Text)
userAuthConfig_secretArn :: (Maybe Text -> f (Maybe Text))
-> UserAuthConfig -> f UserAuthConfig
userAuthConfig_secretArn = (UserAuthConfig -> Maybe Text)
-> (UserAuthConfig -> Maybe Text -> UserAuthConfig)
-> Lens UserAuthConfig UserAuthConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserAuthConfig' {Maybe Text
secretArn :: Maybe Text
$sel:secretArn:UserAuthConfig' :: UserAuthConfig -> Maybe Text
secretArn} -> Maybe Text
secretArn) (\s :: UserAuthConfig
s@UserAuthConfig' {} Maybe Text
a -> UserAuthConfig
s {$sel:secretArn:UserAuthConfig' :: Maybe Text
secretArn = Maybe Text
a} :: UserAuthConfig)
userAuthConfig_description :: Lens.Lens' UserAuthConfig (Prelude.Maybe Prelude.Text)
userAuthConfig_description :: (Maybe Text -> f (Maybe Text))
-> UserAuthConfig -> f UserAuthConfig
userAuthConfig_description = (UserAuthConfig -> Maybe Text)
-> (UserAuthConfig -> Maybe Text -> UserAuthConfig)
-> Lens UserAuthConfig UserAuthConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserAuthConfig' {Maybe Text
description :: Maybe Text
$sel:description:UserAuthConfig' :: UserAuthConfig -> Maybe Text
description} -> Maybe Text
description) (\s :: UserAuthConfig
s@UserAuthConfig' {} Maybe Text
a -> UserAuthConfig
s {$sel:description:UserAuthConfig' :: Maybe Text
description = Maybe Text
a} :: UserAuthConfig)
instance Prelude.Hashable UserAuthConfig
instance Prelude.NFData UserAuthConfig
instance Core.ToQuery UserAuthConfig where
toQuery :: UserAuthConfig -> QueryString
toQuery UserAuthConfig' {Maybe Text
Maybe AuthScheme
Maybe IAMAuthMode
description :: Maybe Text
secretArn :: Maybe Text
authScheme :: Maybe AuthScheme
userName :: Maybe Text
iAMAuth :: Maybe IAMAuthMode
$sel:description:UserAuthConfig' :: UserAuthConfig -> Maybe Text
$sel:secretArn:UserAuthConfig' :: UserAuthConfig -> Maybe Text
$sel:authScheme:UserAuthConfig' :: UserAuthConfig -> Maybe AuthScheme
$sel:userName:UserAuthConfig' :: UserAuthConfig -> Maybe Text
$sel:iAMAuth:UserAuthConfig' :: UserAuthConfig -> Maybe IAMAuthMode
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"IAMAuth" ByteString -> Maybe IAMAuthMode -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe IAMAuthMode
iAMAuth,
ByteString
"UserName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
userName,
ByteString
"AuthScheme" ByteString -> Maybe AuthScheme -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe AuthScheme
authScheme,
ByteString
"SecretArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
secretArn,
ByteString
"Description" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
description
]