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