{-# 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.CloudWatchEvents.Types.RedshiftDataParameters where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RedshiftDataParameters = RedshiftDataParameters'
{
RedshiftDataParameters -> Maybe Text
dbUser :: Prelude.Maybe Prelude.Text,
RedshiftDataParameters -> Maybe Text
secretManagerArn :: Prelude.Maybe Prelude.Text,
RedshiftDataParameters -> Maybe Text
statementName :: Prelude.Maybe Prelude.Text,
RedshiftDataParameters -> Maybe Bool
withEvent :: Prelude.Maybe Prelude.Bool,
RedshiftDataParameters -> Text
database :: Prelude.Text,
RedshiftDataParameters -> Text
sql :: Prelude.Text
}
deriving (RedshiftDataParameters -> RedshiftDataParameters -> Bool
(RedshiftDataParameters -> RedshiftDataParameters -> Bool)
-> (RedshiftDataParameters -> RedshiftDataParameters -> Bool)
-> Eq RedshiftDataParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RedshiftDataParameters -> RedshiftDataParameters -> Bool
$c/= :: RedshiftDataParameters -> RedshiftDataParameters -> Bool
== :: RedshiftDataParameters -> RedshiftDataParameters -> Bool
$c== :: RedshiftDataParameters -> RedshiftDataParameters -> Bool
Prelude.Eq, ReadPrec [RedshiftDataParameters]
ReadPrec RedshiftDataParameters
Int -> ReadS RedshiftDataParameters
ReadS [RedshiftDataParameters]
(Int -> ReadS RedshiftDataParameters)
-> ReadS [RedshiftDataParameters]
-> ReadPrec RedshiftDataParameters
-> ReadPrec [RedshiftDataParameters]
-> Read RedshiftDataParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RedshiftDataParameters]
$creadListPrec :: ReadPrec [RedshiftDataParameters]
readPrec :: ReadPrec RedshiftDataParameters
$creadPrec :: ReadPrec RedshiftDataParameters
readList :: ReadS [RedshiftDataParameters]
$creadList :: ReadS [RedshiftDataParameters]
readsPrec :: Int -> ReadS RedshiftDataParameters
$creadsPrec :: Int -> ReadS RedshiftDataParameters
Prelude.Read, Int -> RedshiftDataParameters -> ShowS
[RedshiftDataParameters] -> ShowS
RedshiftDataParameters -> String
(Int -> RedshiftDataParameters -> ShowS)
-> (RedshiftDataParameters -> String)
-> ([RedshiftDataParameters] -> ShowS)
-> Show RedshiftDataParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RedshiftDataParameters] -> ShowS
$cshowList :: [RedshiftDataParameters] -> ShowS
show :: RedshiftDataParameters -> String
$cshow :: RedshiftDataParameters -> String
showsPrec :: Int -> RedshiftDataParameters -> ShowS
$cshowsPrec :: Int -> RedshiftDataParameters -> ShowS
Prelude.Show, (forall x. RedshiftDataParameters -> Rep RedshiftDataParameters x)
-> (forall x.
Rep RedshiftDataParameters x -> RedshiftDataParameters)
-> Generic RedshiftDataParameters
forall x. Rep RedshiftDataParameters x -> RedshiftDataParameters
forall x. RedshiftDataParameters -> Rep RedshiftDataParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RedshiftDataParameters x -> RedshiftDataParameters
$cfrom :: forall x. RedshiftDataParameters -> Rep RedshiftDataParameters x
Prelude.Generic)
newRedshiftDataParameters ::
Prelude.Text ->
Prelude.Text ->
RedshiftDataParameters
newRedshiftDataParameters :: Text -> Text -> RedshiftDataParameters
newRedshiftDataParameters Text
pDatabase_ Text
pSql_ =
RedshiftDataParameters' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Text
-> Text
-> RedshiftDataParameters
RedshiftDataParameters'
{ $sel:dbUser:RedshiftDataParameters' :: Maybe Text
dbUser = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:secretManagerArn:RedshiftDataParameters' :: Maybe Text
secretManagerArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:statementName:RedshiftDataParameters' :: Maybe Text
statementName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:withEvent:RedshiftDataParameters' :: Maybe Bool
withEvent = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:database:RedshiftDataParameters' :: Text
database = Text
pDatabase_,
$sel:sql:RedshiftDataParameters' :: Text
sql = Text
pSql_
}
redshiftDataParameters_dbUser :: Lens.Lens' RedshiftDataParameters (Prelude.Maybe Prelude.Text)
redshiftDataParameters_dbUser :: (Maybe Text -> f (Maybe Text))
-> RedshiftDataParameters -> f RedshiftDataParameters
redshiftDataParameters_dbUser = (RedshiftDataParameters -> Maybe Text)
-> (RedshiftDataParameters -> Maybe Text -> RedshiftDataParameters)
-> Lens
RedshiftDataParameters
RedshiftDataParameters
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDataParameters' {Maybe Text
dbUser :: Maybe Text
$sel:dbUser:RedshiftDataParameters' :: RedshiftDataParameters -> Maybe Text
dbUser} -> Maybe Text
dbUser) (\s :: RedshiftDataParameters
s@RedshiftDataParameters' {} Maybe Text
a -> RedshiftDataParameters
s {$sel:dbUser:RedshiftDataParameters' :: Maybe Text
dbUser = Maybe Text
a} :: RedshiftDataParameters)
redshiftDataParameters_secretManagerArn :: Lens.Lens' RedshiftDataParameters (Prelude.Maybe Prelude.Text)
redshiftDataParameters_secretManagerArn :: (Maybe Text -> f (Maybe Text))
-> RedshiftDataParameters -> f RedshiftDataParameters
redshiftDataParameters_secretManagerArn = (RedshiftDataParameters -> Maybe Text)
-> (RedshiftDataParameters -> Maybe Text -> RedshiftDataParameters)
-> Lens
RedshiftDataParameters
RedshiftDataParameters
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDataParameters' {Maybe Text
secretManagerArn :: Maybe Text
$sel:secretManagerArn:RedshiftDataParameters' :: RedshiftDataParameters -> Maybe Text
secretManagerArn} -> Maybe Text
secretManagerArn) (\s :: RedshiftDataParameters
s@RedshiftDataParameters' {} Maybe Text
a -> RedshiftDataParameters
s {$sel:secretManagerArn:RedshiftDataParameters' :: Maybe Text
secretManagerArn = Maybe Text
a} :: RedshiftDataParameters)
redshiftDataParameters_statementName :: Lens.Lens' RedshiftDataParameters (Prelude.Maybe Prelude.Text)
redshiftDataParameters_statementName :: (Maybe Text -> f (Maybe Text))
-> RedshiftDataParameters -> f RedshiftDataParameters
redshiftDataParameters_statementName = (RedshiftDataParameters -> Maybe Text)
-> (RedshiftDataParameters -> Maybe Text -> RedshiftDataParameters)
-> Lens
RedshiftDataParameters
RedshiftDataParameters
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDataParameters' {Maybe Text
statementName :: Maybe Text
$sel:statementName:RedshiftDataParameters' :: RedshiftDataParameters -> Maybe Text
statementName} -> Maybe Text
statementName) (\s :: RedshiftDataParameters
s@RedshiftDataParameters' {} Maybe Text
a -> RedshiftDataParameters
s {$sel:statementName:RedshiftDataParameters' :: Maybe Text
statementName = Maybe Text
a} :: RedshiftDataParameters)
redshiftDataParameters_withEvent :: Lens.Lens' RedshiftDataParameters (Prelude.Maybe Prelude.Bool)
redshiftDataParameters_withEvent :: (Maybe Bool -> f (Maybe Bool))
-> RedshiftDataParameters -> f RedshiftDataParameters
redshiftDataParameters_withEvent = (RedshiftDataParameters -> Maybe Bool)
-> (RedshiftDataParameters -> Maybe Bool -> RedshiftDataParameters)
-> Lens
RedshiftDataParameters
RedshiftDataParameters
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDataParameters' {Maybe Bool
withEvent :: Maybe Bool
$sel:withEvent:RedshiftDataParameters' :: RedshiftDataParameters -> Maybe Bool
withEvent} -> Maybe Bool
withEvent) (\s :: RedshiftDataParameters
s@RedshiftDataParameters' {} Maybe Bool
a -> RedshiftDataParameters
s {$sel:withEvent:RedshiftDataParameters' :: Maybe Bool
withEvent = Maybe Bool
a} :: RedshiftDataParameters)
redshiftDataParameters_database :: Lens.Lens' RedshiftDataParameters Prelude.Text
redshiftDataParameters_database :: (Text -> f Text)
-> RedshiftDataParameters -> f RedshiftDataParameters
redshiftDataParameters_database = (RedshiftDataParameters -> Text)
-> (RedshiftDataParameters -> Text -> RedshiftDataParameters)
-> Lens RedshiftDataParameters RedshiftDataParameters Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDataParameters' {Text
database :: Text
$sel:database:RedshiftDataParameters' :: RedshiftDataParameters -> Text
database} -> Text
database) (\s :: RedshiftDataParameters
s@RedshiftDataParameters' {} Text
a -> RedshiftDataParameters
s {$sel:database:RedshiftDataParameters' :: Text
database = Text
a} :: RedshiftDataParameters)
redshiftDataParameters_sql :: Lens.Lens' RedshiftDataParameters Prelude.Text
redshiftDataParameters_sql :: (Text -> f Text)
-> RedshiftDataParameters -> f RedshiftDataParameters
redshiftDataParameters_sql = (RedshiftDataParameters -> Text)
-> (RedshiftDataParameters -> Text -> RedshiftDataParameters)
-> Lens RedshiftDataParameters RedshiftDataParameters Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDataParameters' {Text
sql :: Text
$sel:sql:RedshiftDataParameters' :: RedshiftDataParameters -> Text
sql} -> Text
sql) (\s :: RedshiftDataParameters
s@RedshiftDataParameters' {} Text
a -> RedshiftDataParameters
s {$sel:sql:RedshiftDataParameters' :: Text
sql = Text
a} :: RedshiftDataParameters)
instance Core.FromJSON RedshiftDataParameters where
parseJSON :: Value -> Parser RedshiftDataParameters
parseJSON =
String
-> (Object -> Parser RedshiftDataParameters)
-> Value
-> Parser RedshiftDataParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RedshiftDataParameters"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Text
-> Text
-> RedshiftDataParameters
RedshiftDataParameters'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Text
-> Text
-> RedshiftDataParameters)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Bool
-> Text
-> Text
-> RedshiftDataParameters)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DbUser")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Bool
-> Text
-> Text
-> RedshiftDataParameters)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Bool -> Text -> Text -> RedshiftDataParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SecretManagerArn")
Parser
(Maybe Text
-> Maybe Bool -> Text -> Text -> RedshiftDataParameters)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> Text -> Text -> RedshiftDataParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatementName")
Parser (Maybe Bool -> Text -> Text -> RedshiftDataParameters)
-> Parser (Maybe Bool)
-> Parser (Text -> Text -> RedshiftDataParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WithEvent")
Parser (Text -> Text -> RedshiftDataParameters)
-> Parser Text -> Parser (Text -> RedshiftDataParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Database")
Parser (Text -> RedshiftDataParameters)
-> Parser Text -> Parser RedshiftDataParameters
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Sql")
)
instance Prelude.Hashable RedshiftDataParameters
instance Prelude.NFData RedshiftDataParameters
instance Core.ToJSON RedshiftDataParameters where
toJSON :: RedshiftDataParameters -> Value
toJSON RedshiftDataParameters' {Maybe Bool
Maybe Text
Text
sql :: Text
database :: Text
withEvent :: Maybe Bool
statementName :: Maybe Text
secretManagerArn :: Maybe Text
dbUser :: Maybe Text
$sel:sql:RedshiftDataParameters' :: RedshiftDataParameters -> Text
$sel:database:RedshiftDataParameters' :: RedshiftDataParameters -> Text
$sel:withEvent:RedshiftDataParameters' :: RedshiftDataParameters -> Maybe Bool
$sel:statementName:RedshiftDataParameters' :: RedshiftDataParameters -> Maybe Text
$sel:secretManagerArn:RedshiftDataParameters' :: RedshiftDataParameters -> Maybe Text
$sel:dbUser:RedshiftDataParameters' :: RedshiftDataParameters -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DbUser" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
dbUser,
(Text
"SecretManagerArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
secretManagerArn,
(Text
"StatementName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
statementName,
(Text
"WithEvent" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
withEvent,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Database" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
database),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Sql" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sql)
]
)