{-# 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.MySqlParameters 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 MySqlParameters = MySqlParameters'
{
MySqlParameters -> Text
host :: Prelude.Text,
MySqlParameters -> Natural
port :: Prelude.Natural,
MySqlParameters -> Text
database :: Prelude.Text
}
deriving (MySqlParameters -> MySqlParameters -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MySqlParameters -> MySqlParameters -> Bool
$c/= :: MySqlParameters -> MySqlParameters -> Bool
== :: MySqlParameters -> MySqlParameters -> Bool
$c== :: MySqlParameters -> MySqlParameters -> Bool
Prelude.Eq, ReadPrec [MySqlParameters]
ReadPrec MySqlParameters
Int -> ReadS MySqlParameters
ReadS [MySqlParameters]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MySqlParameters]
$creadListPrec :: ReadPrec [MySqlParameters]
readPrec :: ReadPrec MySqlParameters
$creadPrec :: ReadPrec MySqlParameters
readList :: ReadS [MySqlParameters]
$creadList :: ReadS [MySqlParameters]
readsPrec :: Int -> ReadS MySqlParameters
$creadsPrec :: Int -> ReadS MySqlParameters
Prelude.Read, Int -> MySqlParameters -> ShowS
[MySqlParameters] -> ShowS
MySqlParameters -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MySqlParameters] -> ShowS
$cshowList :: [MySqlParameters] -> ShowS
show :: MySqlParameters -> String
$cshow :: MySqlParameters -> String
showsPrec :: Int -> MySqlParameters -> ShowS
$cshowsPrec :: Int -> MySqlParameters -> ShowS
Prelude.Show, forall x. Rep MySqlParameters x -> MySqlParameters
forall x. MySqlParameters -> Rep MySqlParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MySqlParameters x -> MySqlParameters
$cfrom :: forall x. MySqlParameters -> Rep MySqlParameters x
Prelude.Generic)
newMySqlParameters ::
Prelude.Text ->
Prelude.Natural ->
Prelude.Text ->
MySqlParameters
newMySqlParameters :: Text -> Natural -> Text -> MySqlParameters
newMySqlParameters Text
pHost_ Natural
pPort_ Text
pDatabase_ =
MySqlParameters'
{ $sel:host:MySqlParameters' :: Text
host = Text
pHost_,
$sel:port:MySqlParameters' :: Natural
port = Natural
pPort_,
$sel:database:MySqlParameters' :: Text
database = Text
pDatabase_
}
mySqlParameters_host :: Lens.Lens' MySqlParameters Prelude.Text
mySqlParameters_host :: Lens' MySqlParameters Text
mySqlParameters_host = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MySqlParameters' {Text
host :: Text
$sel:host:MySqlParameters' :: MySqlParameters -> Text
host} -> Text
host) (\s :: MySqlParameters
s@MySqlParameters' {} Text
a -> MySqlParameters
s {$sel:host:MySqlParameters' :: Text
host = Text
a} :: MySqlParameters)
mySqlParameters_port :: Lens.Lens' MySqlParameters Prelude.Natural
mySqlParameters_port :: Lens' MySqlParameters Natural
mySqlParameters_port = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MySqlParameters' {Natural
port :: Natural
$sel:port:MySqlParameters' :: MySqlParameters -> Natural
port} -> Natural
port) (\s :: MySqlParameters
s@MySqlParameters' {} Natural
a -> MySqlParameters
s {$sel:port:MySqlParameters' :: Natural
port = Natural
a} :: MySqlParameters)
mySqlParameters_database :: Lens.Lens' MySqlParameters Prelude.Text
mySqlParameters_database :: Lens' MySqlParameters Text
mySqlParameters_database = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MySqlParameters' {Text
database :: Text
$sel:database:MySqlParameters' :: MySqlParameters -> Text
database} -> Text
database) (\s :: MySqlParameters
s@MySqlParameters' {} Text
a -> MySqlParameters
s {$sel:database:MySqlParameters' :: Text
database = Text
a} :: MySqlParameters)
instance Data.FromJSON MySqlParameters where
parseJSON :: Value -> Parser MySqlParameters
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"MySqlParameters"
( \Object
x ->
Text -> Natural -> Text -> MySqlParameters
MySqlParameters'
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 MySqlParameters where
hashWithSalt :: Int -> MySqlParameters -> Int
hashWithSalt Int
_salt MySqlParameters' {Natural
Text
database :: Text
port :: Natural
host :: Text
$sel:database:MySqlParameters' :: MySqlParameters -> Text
$sel:port:MySqlParameters' :: MySqlParameters -> Natural
$sel:host:MySqlParameters' :: MySqlParameters -> 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 MySqlParameters where
rnf :: MySqlParameters -> ()
rnf MySqlParameters' {Natural
Text
database :: Text
port :: Natural
host :: Text
$sel:database:MySqlParameters' :: MySqlParameters -> Text
$sel:port:MySqlParameters' :: MySqlParameters -> Natural
$sel:host:MySqlParameters' :: MySqlParameters -> 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 MySqlParameters where
toJSON :: MySqlParameters -> Value
toJSON MySqlParameters' {Natural
Text
database :: Text
port :: Natural
host :: Text
$sel:database:MySqlParameters' :: MySqlParameters -> Text
$sel:port:MySqlParameters' :: MySqlParameters -> Natural
$sel:host:MySqlParameters' :: MySqlParameters -> 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)
]
)