{-# 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.RDSData.Types.SqlParameter where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDSData.Types.Field
import Amazonka.RDSData.Types.TypeHint
data SqlParameter = SqlParameter'
{
SqlParameter -> Maybe Field
value :: Prelude.Maybe Field,
SqlParameter -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
SqlParameter -> Maybe TypeHint
typeHint :: Prelude.Maybe TypeHint
}
deriving (SqlParameter -> SqlParameter -> Bool
(SqlParameter -> SqlParameter -> Bool)
-> (SqlParameter -> SqlParameter -> Bool) -> Eq SqlParameter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SqlParameter -> SqlParameter -> Bool
$c/= :: SqlParameter -> SqlParameter -> Bool
== :: SqlParameter -> SqlParameter -> Bool
$c== :: SqlParameter -> SqlParameter -> Bool
Prelude.Eq, ReadPrec [SqlParameter]
ReadPrec SqlParameter
Int -> ReadS SqlParameter
ReadS [SqlParameter]
(Int -> ReadS SqlParameter)
-> ReadS [SqlParameter]
-> ReadPrec SqlParameter
-> ReadPrec [SqlParameter]
-> Read SqlParameter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SqlParameter]
$creadListPrec :: ReadPrec [SqlParameter]
readPrec :: ReadPrec SqlParameter
$creadPrec :: ReadPrec SqlParameter
readList :: ReadS [SqlParameter]
$creadList :: ReadS [SqlParameter]
readsPrec :: Int -> ReadS SqlParameter
$creadsPrec :: Int -> ReadS SqlParameter
Prelude.Read, Int -> SqlParameter -> ShowS
[SqlParameter] -> ShowS
SqlParameter -> String
(Int -> SqlParameter -> ShowS)
-> (SqlParameter -> String)
-> ([SqlParameter] -> ShowS)
-> Show SqlParameter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SqlParameter] -> ShowS
$cshowList :: [SqlParameter] -> ShowS
show :: SqlParameter -> String
$cshow :: SqlParameter -> String
showsPrec :: Int -> SqlParameter -> ShowS
$cshowsPrec :: Int -> SqlParameter -> ShowS
Prelude.Show, (forall x. SqlParameter -> Rep SqlParameter x)
-> (forall x. Rep SqlParameter x -> SqlParameter)
-> Generic SqlParameter
forall x. Rep SqlParameter x -> SqlParameter
forall x. SqlParameter -> Rep SqlParameter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SqlParameter x -> SqlParameter
$cfrom :: forall x. SqlParameter -> Rep SqlParameter x
Prelude.Generic)
newSqlParameter ::
SqlParameter
newSqlParameter :: SqlParameter
newSqlParameter =
SqlParameter' :: Maybe Field -> Maybe Text -> Maybe TypeHint -> SqlParameter
SqlParameter'
{ $sel:value:SqlParameter' :: Maybe Field
value = Maybe Field
forall a. Maybe a
Prelude.Nothing,
$sel:name:SqlParameter' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:typeHint:SqlParameter' :: Maybe TypeHint
typeHint = Maybe TypeHint
forall a. Maybe a
Prelude.Nothing
}
sqlParameter_value :: Lens.Lens' SqlParameter (Prelude.Maybe Field)
sqlParameter_value :: (Maybe Field -> f (Maybe Field)) -> SqlParameter -> f SqlParameter
sqlParameter_value = (SqlParameter -> Maybe Field)
-> (SqlParameter -> Maybe Field -> SqlParameter)
-> Lens SqlParameter SqlParameter (Maybe Field) (Maybe Field)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SqlParameter' {Maybe Field
value :: Maybe Field
$sel:value:SqlParameter' :: SqlParameter -> Maybe Field
value} -> Maybe Field
value) (\s :: SqlParameter
s@SqlParameter' {} Maybe Field
a -> SqlParameter
s {$sel:value:SqlParameter' :: Maybe Field
value = Maybe Field
a} :: SqlParameter)
sqlParameter_name :: Lens.Lens' SqlParameter (Prelude.Maybe Prelude.Text)
sqlParameter_name :: (Maybe Text -> f (Maybe Text)) -> SqlParameter -> f SqlParameter
sqlParameter_name = (SqlParameter -> Maybe Text)
-> (SqlParameter -> Maybe Text -> SqlParameter)
-> Lens SqlParameter SqlParameter (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SqlParameter' {Maybe Text
name :: Maybe Text
$sel:name:SqlParameter' :: SqlParameter -> Maybe Text
name} -> Maybe Text
name) (\s :: SqlParameter
s@SqlParameter' {} Maybe Text
a -> SqlParameter
s {$sel:name:SqlParameter' :: Maybe Text
name = Maybe Text
a} :: SqlParameter)
sqlParameter_typeHint :: Lens.Lens' SqlParameter (Prelude.Maybe TypeHint)
sqlParameter_typeHint :: (Maybe TypeHint -> f (Maybe TypeHint))
-> SqlParameter -> f SqlParameter
sqlParameter_typeHint = (SqlParameter -> Maybe TypeHint)
-> (SqlParameter -> Maybe TypeHint -> SqlParameter)
-> Lens SqlParameter SqlParameter (Maybe TypeHint) (Maybe TypeHint)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SqlParameter' {Maybe TypeHint
typeHint :: Maybe TypeHint
$sel:typeHint:SqlParameter' :: SqlParameter -> Maybe TypeHint
typeHint} -> Maybe TypeHint
typeHint) (\s :: SqlParameter
s@SqlParameter' {} Maybe TypeHint
a -> SqlParameter
s {$sel:typeHint:SqlParameter' :: Maybe TypeHint
typeHint = Maybe TypeHint
a} :: SqlParameter)
instance Prelude.Hashable SqlParameter
instance Prelude.NFData SqlParameter
instance Core.ToJSON SqlParameter where
toJSON :: SqlParameter -> Value
toJSON SqlParameter' {Maybe Text
Maybe Field
Maybe TypeHint
typeHint :: Maybe TypeHint
name :: Maybe Text
value :: Maybe Field
$sel:typeHint:SqlParameter' :: SqlParameter -> Maybe TypeHint
$sel:name:SqlParameter' :: SqlParameter -> Maybe Text
$sel:value:SqlParameter' :: SqlParameter -> Maybe Field
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"value" Text -> Field -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Field -> Pair) -> Maybe Field -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Field
value,
(Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
(Text
"typeHint" Text -> TypeHint -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TypeHint -> Pair) -> Maybe TypeHint -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TypeHint
typeHint
]
)