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