{-# 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.Athena.Types.PreparedStatement where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PreparedStatement = PreparedStatement'
{
PreparedStatement -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
PreparedStatement -> Maybe Text
queryStatement :: Prelude.Maybe Prelude.Text,
PreparedStatement -> Maybe Text
statementName :: Prelude.Maybe Prelude.Text,
PreparedStatement -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
PreparedStatement -> Maybe Text
workGroupName :: Prelude.Maybe Prelude.Text
}
deriving (PreparedStatement -> PreparedStatement -> Bool
(PreparedStatement -> PreparedStatement -> Bool)
-> (PreparedStatement -> PreparedStatement -> Bool)
-> Eq PreparedStatement
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PreparedStatement -> PreparedStatement -> Bool
$c/= :: PreparedStatement -> PreparedStatement -> Bool
== :: PreparedStatement -> PreparedStatement -> Bool
$c== :: PreparedStatement -> PreparedStatement -> Bool
Prelude.Eq, ReadPrec [PreparedStatement]
ReadPrec PreparedStatement
Int -> ReadS PreparedStatement
ReadS [PreparedStatement]
(Int -> ReadS PreparedStatement)
-> ReadS [PreparedStatement]
-> ReadPrec PreparedStatement
-> ReadPrec [PreparedStatement]
-> Read PreparedStatement
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PreparedStatement]
$creadListPrec :: ReadPrec [PreparedStatement]
readPrec :: ReadPrec PreparedStatement
$creadPrec :: ReadPrec PreparedStatement
readList :: ReadS [PreparedStatement]
$creadList :: ReadS [PreparedStatement]
readsPrec :: Int -> ReadS PreparedStatement
$creadsPrec :: Int -> ReadS PreparedStatement
Prelude.Read, Int -> PreparedStatement -> ShowS
[PreparedStatement] -> ShowS
PreparedStatement -> String
(Int -> PreparedStatement -> ShowS)
-> (PreparedStatement -> String)
-> ([PreparedStatement] -> ShowS)
-> Show PreparedStatement
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PreparedStatement] -> ShowS
$cshowList :: [PreparedStatement] -> ShowS
show :: PreparedStatement -> String
$cshow :: PreparedStatement -> String
showsPrec :: Int -> PreparedStatement -> ShowS
$cshowsPrec :: Int -> PreparedStatement -> ShowS
Prelude.Show, (forall x. PreparedStatement -> Rep PreparedStatement x)
-> (forall x. Rep PreparedStatement x -> PreparedStatement)
-> Generic PreparedStatement
forall x. Rep PreparedStatement x -> PreparedStatement
forall x. PreparedStatement -> Rep PreparedStatement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PreparedStatement x -> PreparedStatement
$cfrom :: forall x. PreparedStatement -> Rep PreparedStatement x
Prelude.Generic)
newPreparedStatement ::
PreparedStatement
newPreparedStatement :: PreparedStatement
newPreparedStatement =
PreparedStatement' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PreparedStatement
PreparedStatement'
{ $sel:lastModifiedTime:PreparedStatement' :: Maybe POSIX
lastModifiedTime =
Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:queryStatement:PreparedStatement' :: Maybe Text
queryStatement = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:statementName:PreparedStatement' :: Maybe Text
statementName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:PreparedStatement' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:workGroupName:PreparedStatement' :: Maybe Text
workGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
preparedStatement_lastModifiedTime :: Lens.Lens' PreparedStatement (Prelude.Maybe Prelude.UTCTime)
preparedStatement_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PreparedStatement -> f PreparedStatement
preparedStatement_lastModifiedTime = (PreparedStatement -> Maybe POSIX)
-> (PreparedStatement -> Maybe POSIX -> PreparedStatement)
-> Lens
PreparedStatement PreparedStatement (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PreparedStatement' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:PreparedStatement' :: PreparedStatement -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: PreparedStatement
s@PreparedStatement' {} Maybe POSIX
a -> PreparedStatement
s {$sel:lastModifiedTime:PreparedStatement' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: PreparedStatement) ((Maybe POSIX -> f (Maybe POSIX))
-> PreparedStatement -> f PreparedStatement)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PreparedStatement
-> f PreparedStatement
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
preparedStatement_queryStatement :: Lens.Lens' PreparedStatement (Prelude.Maybe Prelude.Text)
preparedStatement_queryStatement :: (Maybe Text -> f (Maybe Text))
-> PreparedStatement -> f PreparedStatement
preparedStatement_queryStatement = (PreparedStatement -> Maybe Text)
-> (PreparedStatement -> Maybe Text -> PreparedStatement)
-> Lens
PreparedStatement PreparedStatement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PreparedStatement' {Maybe Text
queryStatement :: Maybe Text
$sel:queryStatement:PreparedStatement' :: PreparedStatement -> Maybe Text
queryStatement} -> Maybe Text
queryStatement) (\s :: PreparedStatement
s@PreparedStatement' {} Maybe Text
a -> PreparedStatement
s {$sel:queryStatement:PreparedStatement' :: Maybe Text
queryStatement = Maybe Text
a} :: PreparedStatement)
preparedStatement_statementName :: Lens.Lens' PreparedStatement (Prelude.Maybe Prelude.Text)
preparedStatement_statementName :: (Maybe Text -> f (Maybe Text))
-> PreparedStatement -> f PreparedStatement
preparedStatement_statementName = (PreparedStatement -> Maybe Text)
-> (PreparedStatement -> Maybe Text -> PreparedStatement)
-> Lens
PreparedStatement PreparedStatement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PreparedStatement' {Maybe Text
statementName :: Maybe Text
$sel:statementName:PreparedStatement' :: PreparedStatement -> Maybe Text
statementName} -> Maybe Text
statementName) (\s :: PreparedStatement
s@PreparedStatement' {} Maybe Text
a -> PreparedStatement
s {$sel:statementName:PreparedStatement' :: Maybe Text
statementName = Maybe Text
a} :: PreparedStatement)
preparedStatement_description :: Lens.Lens' PreparedStatement (Prelude.Maybe Prelude.Text)
preparedStatement_description :: (Maybe Text -> f (Maybe Text))
-> PreparedStatement -> f PreparedStatement
preparedStatement_description = (PreparedStatement -> Maybe Text)
-> (PreparedStatement -> Maybe Text -> PreparedStatement)
-> Lens
PreparedStatement PreparedStatement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PreparedStatement' {Maybe Text
description :: Maybe Text
$sel:description:PreparedStatement' :: PreparedStatement -> Maybe Text
description} -> Maybe Text
description) (\s :: PreparedStatement
s@PreparedStatement' {} Maybe Text
a -> PreparedStatement
s {$sel:description:PreparedStatement' :: Maybe Text
description = Maybe Text
a} :: PreparedStatement)
preparedStatement_workGroupName :: Lens.Lens' PreparedStatement (Prelude.Maybe Prelude.Text)
preparedStatement_workGroupName :: (Maybe Text -> f (Maybe Text))
-> PreparedStatement -> f PreparedStatement
preparedStatement_workGroupName = (PreparedStatement -> Maybe Text)
-> (PreparedStatement -> Maybe Text -> PreparedStatement)
-> Lens
PreparedStatement PreparedStatement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PreparedStatement' {Maybe Text
workGroupName :: Maybe Text
$sel:workGroupName:PreparedStatement' :: PreparedStatement -> Maybe Text
workGroupName} -> Maybe Text
workGroupName) (\s :: PreparedStatement
s@PreparedStatement' {} Maybe Text
a -> PreparedStatement
s {$sel:workGroupName:PreparedStatement' :: Maybe Text
workGroupName = Maybe Text
a} :: PreparedStatement)
instance Core.FromJSON PreparedStatement where
parseJSON :: Value -> Parser PreparedStatement
parseJSON =
String
-> (Object -> Parser PreparedStatement)
-> Value
-> Parser PreparedStatement
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PreparedStatement"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PreparedStatement
PreparedStatement'
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PreparedStatement)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> PreparedStatement)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastModifiedTime")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> PreparedStatement)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> PreparedStatement)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QueryStatement")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> PreparedStatement)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> PreparedStatement)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatementName")
Parser (Maybe Text -> Maybe Text -> PreparedStatement)
-> Parser (Maybe Text) -> Parser (Maybe Text -> PreparedStatement)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
Parser (Maybe Text -> PreparedStatement)
-> Parser (Maybe Text) -> Parser PreparedStatement
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WorkGroupName")
)
instance Prelude.Hashable PreparedStatement
instance Prelude.NFData PreparedStatement