{-# 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.AuroraParameters where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data AuroraParameters = AuroraParameters'
{
AuroraParameters -> Text
host :: Prelude.Text,
AuroraParameters -> Natural
port :: Prelude.Natural,
AuroraParameters -> Text
database :: Prelude.Text
}
deriving (AuroraParameters -> AuroraParameters -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuroraParameters -> AuroraParameters -> Bool
$c/= :: AuroraParameters -> AuroraParameters -> Bool
== :: AuroraParameters -> AuroraParameters -> Bool
$c== :: AuroraParameters -> AuroraParameters -> Bool
Prelude.Eq, ReadPrec [AuroraParameters]
ReadPrec AuroraParameters
Int -> ReadS AuroraParameters
ReadS [AuroraParameters]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AuroraParameters]
$creadListPrec :: ReadPrec [AuroraParameters]
readPrec :: ReadPrec AuroraParameters
$creadPrec :: ReadPrec AuroraParameters
readList :: ReadS [AuroraParameters]
$creadList :: ReadS [AuroraParameters]
readsPrec :: Int -> ReadS AuroraParameters
$creadsPrec :: Int -> ReadS AuroraParameters
Prelude.Read, Int -> AuroraParameters -> ShowS
[AuroraParameters] -> ShowS
AuroraParameters -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AuroraParameters] -> ShowS
$cshowList :: [AuroraParameters] -> ShowS
show :: AuroraParameters -> String
$cshow :: AuroraParameters -> String
showsPrec :: Int -> AuroraParameters -> ShowS
$cshowsPrec :: Int -> AuroraParameters -> ShowS
Prelude.Show, forall x. Rep AuroraParameters x -> AuroraParameters
forall x. AuroraParameters -> Rep AuroraParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AuroraParameters x -> AuroraParameters
$cfrom :: forall x. AuroraParameters -> Rep AuroraParameters x
Prelude.Generic)
newAuroraParameters ::
Prelude.Text ->
Prelude.Natural ->
Prelude.Text ->
AuroraParameters
newAuroraParameters :: Text -> Natural -> Text -> AuroraParameters
newAuroraParameters Text
pHost_ Natural
pPort_ Text
pDatabase_ =
AuroraParameters'
{ $sel:host:AuroraParameters' :: Text
host = Text
pHost_,
$sel:port:AuroraParameters' :: Natural
port = Natural
pPort_,
$sel:database:AuroraParameters' :: Text
database = Text
pDatabase_
}
auroraParameters_host :: Lens.Lens' AuroraParameters Prelude.Text
auroraParameters_host :: Lens' AuroraParameters Text
auroraParameters_host = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuroraParameters' {Text
host :: Text
$sel:host:AuroraParameters' :: AuroraParameters -> Text
host} -> Text
host) (\s :: AuroraParameters
s@AuroraParameters' {} Text
a -> AuroraParameters
s {$sel:host:AuroraParameters' :: Text
host = Text
a} :: AuroraParameters)
auroraParameters_port :: Lens.Lens' AuroraParameters Prelude.Natural
auroraParameters_port :: Lens' AuroraParameters Natural
auroraParameters_port = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuroraParameters' {Natural
port :: Natural
$sel:port:AuroraParameters' :: AuroraParameters -> Natural
port} -> Natural
port) (\s :: AuroraParameters
s@AuroraParameters' {} Natural
a -> AuroraParameters
s {$sel:port:AuroraParameters' :: Natural
port = Natural
a} :: AuroraParameters)
auroraParameters_database :: Lens.Lens' AuroraParameters Prelude.Text
auroraParameters_database :: Lens' AuroraParameters Text
auroraParameters_database = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuroraParameters' {Text
database :: Text
$sel:database:AuroraParameters' :: AuroraParameters -> Text
database} -> Text
database) (\s :: AuroraParameters
s@AuroraParameters' {} Text
a -> AuroraParameters
s {$sel:database:AuroraParameters' :: Text
database = Text
a} :: AuroraParameters)
instance Data.FromJSON AuroraParameters where
parseJSON :: Value -> Parser AuroraParameters
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AuroraParameters"
( \Object
x ->
Text -> Natural -> Text -> AuroraParameters
AuroraParameters'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Host")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Port")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Database")
)
instance Prelude.Hashable AuroraParameters where
hashWithSalt :: Int -> AuroraParameters -> Int
hashWithSalt Int
_salt AuroraParameters' {Natural
Text
database :: Text
port :: Natural
host :: Text
$sel:database:AuroraParameters' :: AuroraParameters -> Text
$sel:port:AuroraParameters' :: AuroraParameters -> Natural
$sel:host:AuroraParameters' :: AuroraParameters -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
host
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
port
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
database
instance Prelude.NFData AuroraParameters where
rnf :: AuroraParameters -> ()
rnf AuroraParameters' {Natural
Text
database :: Text
port :: Natural
host :: Text
$sel:database:AuroraParameters' :: AuroraParameters -> Text
$sel:port:AuroraParameters' :: AuroraParameters -> Natural
$sel:host:AuroraParameters' :: AuroraParameters -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
host
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
port
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
database
instance Data.ToJSON AuroraParameters where
toJSON :: AuroraParameters -> Value
toJSON AuroraParameters' {Natural
Text
database :: Text
port :: Natural
host :: Text
$sel:database:AuroraParameters' :: AuroraParameters -> Text
$sel:port:AuroraParameters' :: AuroraParameters -> Natural
$sel:host:AuroraParameters' :: AuroraParameters -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Host" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
host),
forall a. a -> Maybe a
Prelude.Just (Key
"Port" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
port),
forall a. a -> Maybe a
Prelude.Just (Key
"Database" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
database)
]
)