{-# 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.QLDBSession.Types.ExecuteStatementRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QLDBSession.Types.ValueHolder
data ExecuteStatementRequest = ExecuteStatementRequest'
{
ExecuteStatementRequest -> Maybe [ValueHolder]
parameters :: Prelude.Maybe [ValueHolder],
ExecuteStatementRequest -> Text
transactionId :: Prelude.Text,
ExecuteStatementRequest -> Text
statement :: Prelude.Text
}
deriving (ExecuteStatementRequest -> ExecuteStatementRequest -> Bool
(ExecuteStatementRequest -> ExecuteStatementRequest -> Bool)
-> (ExecuteStatementRequest -> ExecuteStatementRequest -> Bool)
-> Eq ExecuteStatementRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExecuteStatementRequest -> ExecuteStatementRequest -> Bool
$c/= :: ExecuteStatementRequest -> ExecuteStatementRequest -> Bool
== :: ExecuteStatementRequest -> ExecuteStatementRequest -> Bool
$c== :: ExecuteStatementRequest -> ExecuteStatementRequest -> Bool
Prelude.Eq, ReadPrec [ExecuteStatementRequest]
ReadPrec ExecuteStatementRequest
Int -> ReadS ExecuteStatementRequest
ReadS [ExecuteStatementRequest]
(Int -> ReadS ExecuteStatementRequest)
-> ReadS [ExecuteStatementRequest]
-> ReadPrec ExecuteStatementRequest
-> ReadPrec [ExecuteStatementRequest]
-> Read ExecuteStatementRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExecuteStatementRequest]
$creadListPrec :: ReadPrec [ExecuteStatementRequest]
readPrec :: ReadPrec ExecuteStatementRequest
$creadPrec :: ReadPrec ExecuteStatementRequest
readList :: ReadS [ExecuteStatementRequest]
$creadList :: ReadS [ExecuteStatementRequest]
readsPrec :: Int -> ReadS ExecuteStatementRequest
$creadsPrec :: Int -> ReadS ExecuteStatementRequest
Prelude.Read, Int -> ExecuteStatementRequest -> ShowS
[ExecuteStatementRequest] -> ShowS
ExecuteStatementRequest -> String
(Int -> ExecuteStatementRequest -> ShowS)
-> (ExecuteStatementRequest -> String)
-> ([ExecuteStatementRequest] -> ShowS)
-> Show ExecuteStatementRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExecuteStatementRequest] -> ShowS
$cshowList :: [ExecuteStatementRequest] -> ShowS
show :: ExecuteStatementRequest -> String
$cshow :: ExecuteStatementRequest -> String
showsPrec :: Int -> ExecuteStatementRequest -> ShowS
$cshowsPrec :: Int -> ExecuteStatementRequest -> ShowS
Prelude.Show, (forall x.
ExecuteStatementRequest -> Rep ExecuteStatementRequest x)
-> (forall x.
Rep ExecuteStatementRequest x -> ExecuteStatementRequest)
-> Generic ExecuteStatementRequest
forall x. Rep ExecuteStatementRequest x -> ExecuteStatementRequest
forall x. ExecuteStatementRequest -> Rep ExecuteStatementRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExecuteStatementRequest x -> ExecuteStatementRequest
$cfrom :: forall x. ExecuteStatementRequest -> Rep ExecuteStatementRequest x
Prelude.Generic)
newExecuteStatementRequest ::
Prelude.Text ->
Prelude.Text ->
ExecuteStatementRequest
newExecuteStatementRequest :: Text -> Text -> ExecuteStatementRequest
newExecuteStatementRequest
Text
pTransactionId_
Text
pStatement_ =
ExecuteStatementRequest' :: Maybe [ValueHolder] -> Text -> Text -> ExecuteStatementRequest
ExecuteStatementRequest'
{ $sel:parameters:ExecuteStatementRequest' :: Maybe [ValueHolder]
parameters =
Maybe [ValueHolder]
forall a. Maybe a
Prelude.Nothing,
$sel:transactionId:ExecuteStatementRequest' :: Text
transactionId = Text
pTransactionId_,
$sel:statement:ExecuteStatementRequest' :: Text
statement = Text
pStatement_
}
executeStatementRequest_parameters :: Lens.Lens' ExecuteStatementRequest (Prelude.Maybe [ValueHolder])
executeStatementRequest_parameters :: (Maybe [ValueHolder] -> f (Maybe [ValueHolder]))
-> ExecuteStatementRequest -> f ExecuteStatementRequest
executeStatementRequest_parameters = (ExecuteStatementRequest -> Maybe [ValueHolder])
-> (ExecuteStatementRequest
-> Maybe [ValueHolder] -> ExecuteStatementRequest)
-> Lens
ExecuteStatementRequest
ExecuteStatementRequest
(Maybe [ValueHolder])
(Maybe [ValueHolder])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecuteStatementRequest' {Maybe [ValueHolder]
parameters :: Maybe [ValueHolder]
$sel:parameters:ExecuteStatementRequest' :: ExecuteStatementRequest -> Maybe [ValueHolder]
parameters} -> Maybe [ValueHolder]
parameters) (\s :: ExecuteStatementRequest
s@ExecuteStatementRequest' {} Maybe [ValueHolder]
a -> ExecuteStatementRequest
s {$sel:parameters:ExecuteStatementRequest' :: Maybe [ValueHolder]
parameters = Maybe [ValueHolder]
a} :: ExecuteStatementRequest) ((Maybe [ValueHolder] -> f (Maybe [ValueHolder]))
-> ExecuteStatementRequest -> f ExecuteStatementRequest)
-> ((Maybe [ValueHolder] -> f (Maybe [ValueHolder]))
-> Maybe [ValueHolder] -> f (Maybe [ValueHolder]))
-> (Maybe [ValueHolder] -> f (Maybe [ValueHolder]))
-> ExecuteStatementRequest
-> f ExecuteStatementRequest
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ValueHolder] [ValueHolder] [ValueHolder] [ValueHolder]
-> Iso
(Maybe [ValueHolder])
(Maybe [ValueHolder])
(Maybe [ValueHolder])
(Maybe [ValueHolder])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [ValueHolder] [ValueHolder] [ValueHolder] [ValueHolder]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
executeStatementRequest_transactionId :: Lens.Lens' ExecuteStatementRequest Prelude.Text
executeStatementRequest_transactionId :: (Text -> f Text)
-> ExecuteStatementRequest -> f ExecuteStatementRequest
executeStatementRequest_transactionId = (ExecuteStatementRequest -> Text)
-> (ExecuteStatementRequest -> Text -> ExecuteStatementRequest)
-> Lens ExecuteStatementRequest ExecuteStatementRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecuteStatementRequest' {Text
transactionId :: Text
$sel:transactionId:ExecuteStatementRequest' :: ExecuteStatementRequest -> Text
transactionId} -> Text
transactionId) (\s :: ExecuteStatementRequest
s@ExecuteStatementRequest' {} Text
a -> ExecuteStatementRequest
s {$sel:transactionId:ExecuteStatementRequest' :: Text
transactionId = Text
a} :: ExecuteStatementRequest)
executeStatementRequest_statement :: Lens.Lens' ExecuteStatementRequest Prelude.Text
executeStatementRequest_statement :: (Text -> f Text)
-> ExecuteStatementRequest -> f ExecuteStatementRequest
executeStatementRequest_statement = (ExecuteStatementRequest -> Text)
-> (ExecuteStatementRequest -> Text -> ExecuteStatementRequest)
-> Lens ExecuteStatementRequest ExecuteStatementRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExecuteStatementRequest' {Text
statement :: Text
$sel:statement:ExecuteStatementRequest' :: ExecuteStatementRequest -> Text
statement} -> Text
statement) (\s :: ExecuteStatementRequest
s@ExecuteStatementRequest' {} Text
a -> ExecuteStatementRequest
s {$sel:statement:ExecuteStatementRequest' :: Text
statement = Text
a} :: ExecuteStatementRequest)
instance Prelude.Hashable ExecuteStatementRequest
instance Prelude.NFData ExecuteStatementRequest
instance Core.ToJSON ExecuteStatementRequest where
toJSON :: ExecuteStatementRequest -> Value
toJSON ExecuteStatementRequest' {Maybe [ValueHolder]
Text
statement :: Text
transactionId :: Text
parameters :: Maybe [ValueHolder]
$sel:statement:ExecuteStatementRequest' :: ExecuteStatementRequest -> Text
$sel:transactionId:ExecuteStatementRequest' :: ExecuteStatementRequest -> Text
$sel:parameters:ExecuteStatementRequest' :: ExecuteStatementRequest -> Maybe [ValueHolder]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Parameters" Text -> [ValueHolder] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([ValueHolder] -> Pair) -> Maybe [ValueHolder] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ValueHolder]
parameters,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TransactionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
transactionId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Statement" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
statement)
]
)