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