{-# 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.MachineLearning.Types.RedshiftDatabaseCredentials where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RedshiftDatabaseCredentials = RedshiftDatabaseCredentials'
{ RedshiftDatabaseCredentials -> Text
username :: Prelude.Text,
RedshiftDatabaseCredentials -> Text
password :: Prelude.Text
}
deriving (RedshiftDatabaseCredentials -> RedshiftDatabaseCredentials -> Bool
(RedshiftDatabaseCredentials
-> RedshiftDatabaseCredentials -> Bool)
-> (RedshiftDatabaseCredentials
-> RedshiftDatabaseCredentials -> Bool)
-> Eq RedshiftDatabaseCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RedshiftDatabaseCredentials -> RedshiftDatabaseCredentials -> Bool
$c/= :: RedshiftDatabaseCredentials -> RedshiftDatabaseCredentials -> Bool
== :: RedshiftDatabaseCredentials -> RedshiftDatabaseCredentials -> Bool
$c== :: RedshiftDatabaseCredentials -> RedshiftDatabaseCredentials -> Bool
Prelude.Eq, ReadPrec [RedshiftDatabaseCredentials]
ReadPrec RedshiftDatabaseCredentials
Int -> ReadS RedshiftDatabaseCredentials
ReadS [RedshiftDatabaseCredentials]
(Int -> ReadS RedshiftDatabaseCredentials)
-> ReadS [RedshiftDatabaseCredentials]
-> ReadPrec RedshiftDatabaseCredentials
-> ReadPrec [RedshiftDatabaseCredentials]
-> Read RedshiftDatabaseCredentials
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RedshiftDatabaseCredentials]
$creadListPrec :: ReadPrec [RedshiftDatabaseCredentials]
readPrec :: ReadPrec RedshiftDatabaseCredentials
$creadPrec :: ReadPrec RedshiftDatabaseCredentials
readList :: ReadS [RedshiftDatabaseCredentials]
$creadList :: ReadS [RedshiftDatabaseCredentials]
readsPrec :: Int -> ReadS RedshiftDatabaseCredentials
$creadsPrec :: Int -> ReadS RedshiftDatabaseCredentials
Prelude.Read, Int -> RedshiftDatabaseCredentials -> ShowS
[RedshiftDatabaseCredentials] -> ShowS
RedshiftDatabaseCredentials -> String
(Int -> RedshiftDatabaseCredentials -> ShowS)
-> (RedshiftDatabaseCredentials -> String)
-> ([RedshiftDatabaseCredentials] -> ShowS)
-> Show RedshiftDatabaseCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RedshiftDatabaseCredentials] -> ShowS
$cshowList :: [RedshiftDatabaseCredentials] -> ShowS
show :: RedshiftDatabaseCredentials -> String
$cshow :: RedshiftDatabaseCredentials -> String
showsPrec :: Int -> RedshiftDatabaseCredentials -> ShowS
$cshowsPrec :: Int -> RedshiftDatabaseCredentials -> ShowS
Prelude.Show, (forall x.
RedshiftDatabaseCredentials -> Rep RedshiftDatabaseCredentials x)
-> (forall x.
Rep RedshiftDatabaseCredentials x -> RedshiftDatabaseCredentials)
-> Generic RedshiftDatabaseCredentials
forall x.
Rep RedshiftDatabaseCredentials x -> RedshiftDatabaseCredentials
forall x.
RedshiftDatabaseCredentials -> Rep RedshiftDatabaseCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RedshiftDatabaseCredentials x -> RedshiftDatabaseCredentials
$cfrom :: forall x.
RedshiftDatabaseCredentials -> Rep RedshiftDatabaseCredentials x
Prelude.Generic)
newRedshiftDatabaseCredentials ::
Prelude.Text ->
Prelude.Text ->
RedshiftDatabaseCredentials
newRedshiftDatabaseCredentials :: Text -> Text -> RedshiftDatabaseCredentials
newRedshiftDatabaseCredentials Text
pUsername_ Text
pPassword_ =
RedshiftDatabaseCredentials' :: Text -> Text -> RedshiftDatabaseCredentials
RedshiftDatabaseCredentials'
{ $sel:username:RedshiftDatabaseCredentials' :: Text
username = Text
pUsername_,
$sel:password:RedshiftDatabaseCredentials' :: Text
password = Text
pPassword_
}
redshiftDatabaseCredentials_username :: Lens.Lens' RedshiftDatabaseCredentials Prelude.Text
redshiftDatabaseCredentials_username :: (Text -> f Text)
-> RedshiftDatabaseCredentials -> f RedshiftDatabaseCredentials
redshiftDatabaseCredentials_username = (RedshiftDatabaseCredentials -> Text)
-> (RedshiftDatabaseCredentials
-> Text -> RedshiftDatabaseCredentials)
-> Lens
RedshiftDatabaseCredentials RedshiftDatabaseCredentials Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDatabaseCredentials' {Text
username :: Text
$sel:username:RedshiftDatabaseCredentials' :: RedshiftDatabaseCredentials -> Text
username} -> Text
username) (\s :: RedshiftDatabaseCredentials
s@RedshiftDatabaseCredentials' {} Text
a -> RedshiftDatabaseCredentials
s {$sel:username:RedshiftDatabaseCredentials' :: Text
username = Text
a} :: RedshiftDatabaseCredentials)
redshiftDatabaseCredentials_password :: Lens.Lens' RedshiftDatabaseCredentials Prelude.Text
redshiftDatabaseCredentials_password :: (Text -> f Text)
-> RedshiftDatabaseCredentials -> f RedshiftDatabaseCredentials
redshiftDatabaseCredentials_password = (RedshiftDatabaseCredentials -> Text)
-> (RedshiftDatabaseCredentials
-> Text -> RedshiftDatabaseCredentials)
-> Lens
RedshiftDatabaseCredentials RedshiftDatabaseCredentials Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDatabaseCredentials' {Text
password :: Text
$sel:password:RedshiftDatabaseCredentials' :: RedshiftDatabaseCredentials -> Text
password} -> Text
password) (\s :: RedshiftDatabaseCredentials
s@RedshiftDatabaseCredentials' {} Text
a -> RedshiftDatabaseCredentials
s {$sel:password:RedshiftDatabaseCredentials' :: Text
password = Text
a} :: RedshiftDatabaseCredentials)
instance Prelude.Hashable RedshiftDatabaseCredentials
instance Prelude.NFData RedshiftDatabaseCredentials
instance Core.ToJSON RedshiftDatabaseCredentials where
toJSON :: RedshiftDatabaseCredentials -> Value
toJSON RedshiftDatabaseCredentials' {Text
password :: Text
username :: Text
$sel:password:RedshiftDatabaseCredentials' :: RedshiftDatabaseCredentials -> Text
$sel:username:RedshiftDatabaseCredentials' :: RedshiftDatabaseCredentials -> Text
..} =
[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
"Username" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
username),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Password" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
password)
]
)