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