{-# 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.QueryExecution where
import Amazonka.Athena.Types.EngineVersion
import Amazonka.Athena.Types.QueryExecutionContext
import Amazonka.Athena.Types.QueryExecutionStatistics
import Amazonka.Athena.Types.QueryExecutionStatus
import Amazonka.Athena.Types.ResultConfiguration
import Amazonka.Athena.Types.StatementType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data QueryExecution = QueryExecution'
{
QueryExecution -> Maybe EngineVersion
engineVersion :: Prelude.Maybe EngineVersion,
QueryExecution -> Maybe QueryExecutionStatus
status :: Prelude.Maybe QueryExecutionStatus,
QueryExecution -> Maybe QueryExecutionContext
queryExecutionContext :: Prelude.Maybe QueryExecutionContext,
QueryExecution -> Maybe ResultConfiguration
resultConfiguration :: Prelude.Maybe ResultConfiguration,
QueryExecution -> Maybe Text
query :: Prelude.Maybe Prelude.Text,
QueryExecution -> Maybe StatementType
statementType :: Prelude.Maybe StatementType,
QueryExecution -> Maybe QueryExecutionStatistics
statistics :: Prelude.Maybe QueryExecutionStatistics,
QueryExecution -> Maybe Text
queryExecutionId :: Prelude.Maybe Prelude.Text,
QueryExecution -> Maybe Text
workGroup :: Prelude.Maybe Prelude.Text
}
deriving (QueryExecution -> QueryExecution -> Bool
(QueryExecution -> QueryExecution -> Bool)
-> (QueryExecution -> QueryExecution -> Bool) -> Eq QueryExecution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QueryExecution -> QueryExecution -> Bool
$c/= :: QueryExecution -> QueryExecution -> Bool
== :: QueryExecution -> QueryExecution -> Bool
$c== :: QueryExecution -> QueryExecution -> Bool
Prelude.Eq, ReadPrec [QueryExecution]
ReadPrec QueryExecution
Int -> ReadS QueryExecution
ReadS [QueryExecution]
(Int -> ReadS QueryExecution)
-> ReadS [QueryExecution]
-> ReadPrec QueryExecution
-> ReadPrec [QueryExecution]
-> Read QueryExecution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [QueryExecution]
$creadListPrec :: ReadPrec [QueryExecution]
readPrec :: ReadPrec QueryExecution
$creadPrec :: ReadPrec QueryExecution
readList :: ReadS [QueryExecution]
$creadList :: ReadS [QueryExecution]
readsPrec :: Int -> ReadS QueryExecution
$creadsPrec :: Int -> ReadS QueryExecution
Prelude.Read, Int -> QueryExecution -> ShowS
[QueryExecution] -> ShowS
QueryExecution -> String
(Int -> QueryExecution -> ShowS)
-> (QueryExecution -> String)
-> ([QueryExecution] -> ShowS)
-> Show QueryExecution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QueryExecution] -> ShowS
$cshowList :: [QueryExecution] -> ShowS
show :: QueryExecution -> String
$cshow :: QueryExecution -> String
showsPrec :: Int -> QueryExecution -> ShowS
$cshowsPrec :: Int -> QueryExecution -> ShowS
Prelude.Show, (forall x. QueryExecution -> Rep QueryExecution x)
-> (forall x. Rep QueryExecution x -> QueryExecution)
-> Generic QueryExecution
forall x. Rep QueryExecution x -> QueryExecution
forall x. QueryExecution -> Rep QueryExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep QueryExecution x -> QueryExecution
$cfrom :: forall x. QueryExecution -> Rep QueryExecution x
Prelude.Generic)
newQueryExecution ::
QueryExecution
newQueryExecution :: QueryExecution
newQueryExecution =
QueryExecution' :: Maybe EngineVersion
-> Maybe QueryExecutionStatus
-> Maybe QueryExecutionContext
-> Maybe ResultConfiguration
-> Maybe Text
-> Maybe StatementType
-> Maybe QueryExecutionStatistics
-> Maybe Text
-> Maybe Text
-> QueryExecution
QueryExecution'
{ $sel:engineVersion:QueryExecution' :: Maybe EngineVersion
engineVersion = Maybe EngineVersion
forall a. Maybe a
Prelude.Nothing,
$sel:status:QueryExecution' :: Maybe QueryExecutionStatus
status = Maybe QueryExecutionStatus
forall a. Maybe a
Prelude.Nothing,
$sel:queryExecutionContext:QueryExecution' :: Maybe QueryExecutionContext
queryExecutionContext = Maybe QueryExecutionContext
forall a. Maybe a
Prelude.Nothing,
$sel:resultConfiguration:QueryExecution' :: Maybe ResultConfiguration
resultConfiguration = Maybe ResultConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:query:QueryExecution' :: Maybe Text
query = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:statementType:QueryExecution' :: Maybe StatementType
statementType = Maybe StatementType
forall a. Maybe a
Prelude.Nothing,
$sel:statistics:QueryExecution' :: Maybe QueryExecutionStatistics
statistics = Maybe QueryExecutionStatistics
forall a. Maybe a
Prelude.Nothing,
$sel:queryExecutionId:QueryExecution' :: Maybe Text
queryExecutionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:workGroup:QueryExecution' :: Maybe Text
workGroup = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
queryExecution_engineVersion :: Lens.Lens' QueryExecution (Prelude.Maybe EngineVersion)
queryExecution_engineVersion :: (Maybe EngineVersion -> f (Maybe EngineVersion))
-> QueryExecution -> f QueryExecution
queryExecution_engineVersion = (QueryExecution -> Maybe EngineVersion)
-> (QueryExecution -> Maybe EngineVersion -> QueryExecution)
-> Lens
QueryExecution
QueryExecution
(Maybe EngineVersion)
(Maybe EngineVersion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryExecution' {Maybe EngineVersion
engineVersion :: Maybe EngineVersion
$sel:engineVersion:QueryExecution' :: QueryExecution -> Maybe EngineVersion
engineVersion} -> Maybe EngineVersion
engineVersion) (\s :: QueryExecution
s@QueryExecution' {} Maybe EngineVersion
a -> QueryExecution
s {$sel:engineVersion:QueryExecution' :: Maybe EngineVersion
engineVersion = Maybe EngineVersion
a} :: QueryExecution)
queryExecution_status :: Lens.Lens' QueryExecution (Prelude.Maybe QueryExecutionStatus)
queryExecution_status :: (Maybe QueryExecutionStatus -> f (Maybe QueryExecutionStatus))
-> QueryExecution -> f QueryExecution
queryExecution_status = (QueryExecution -> Maybe QueryExecutionStatus)
-> (QueryExecution -> Maybe QueryExecutionStatus -> QueryExecution)
-> Lens
QueryExecution
QueryExecution
(Maybe QueryExecutionStatus)
(Maybe QueryExecutionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryExecution' {Maybe QueryExecutionStatus
status :: Maybe QueryExecutionStatus
$sel:status:QueryExecution' :: QueryExecution -> Maybe QueryExecutionStatus
status} -> Maybe QueryExecutionStatus
status) (\s :: QueryExecution
s@QueryExecution' {} Maybe QueryExecutionStatus
a -> QueryExecution
s {$sel:status:QueryExecution' :: Maybe QueryExecutionStatus
status = Maybe QueryExecutionStatus
a} :: QueryExecution)
queryExecution_queryExecutionContext :: Lens.Lens' QueryExecution (Prelude.Maybe QueryExecutionContext)
queryExecution_queryExecutionContext :: (Maybe QueryExecutionContext -> f (Maybe QueryExecutionContext))
-> QueryExecution -> f QueryExecution
queryExecution_queryExecutionContext = (QueryExecution -> Maybe QueryExecutionContext)
-> (QueryExecution
-> Maybe QueryExecutionContext -> QueryExecution)
-> Lens
QueryExecution
QueryExecution
(Maybe QueryExecutionContext)
(Maybe QueryExecutionContext)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryExecution' {Maybe QueryExecutionContext
queryExecutionContext :: Maybe QueryExecutionContext
$sel:queryExecutionContext:QueryExecution' :: QueryExecution -> Maybe QueryExecutionContext
queryExecutionContext} -> Maybe QueryExecutionContext
queryExecutionContext) (\s :: QueryExecution
s@QueryExecution' {} Maybe QueryExecutionContext
a -> QueryExecution
s {$sel:queryExecutionContext:QueryExecution' :: Maybe QueryExecutionContext
queryExecutionContext = Maybe QueryExecutionContext
a} :: QueryExecution)
queryExecution_resultConfiguration :: Lens.Lens' QueryExecution (Prelude.Maybe ResultConfiguration)
queryExecution_resultConfiguration :: (Maybe ResultConfiguration -> f (Maybe ResultConfiguration))
-> QueryExecution -> f QueryExecution
queryExecution_resultConfiguration = (QueryExecution -> Maybe ResultConfiguration)
-> (QueryExecution -> Maybe ResultConfiguration -> QueryExecution)
-> Lens
QueryExecution
QueryExecution
(Maybe ResultConfiguration)
(Maybe ResultConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryExecution' {Maybe ResultConfiguration
resultConfiguration :: Maybe ResultConfiguration
$sel:resultConfiguration:QueryExecution' :: QueryExecution -> Maybe ResultConfiguration
resultConfiguration} -> Maybe ResultConfiguration
resultConfiguration) (\s :: QueryExecution
s@QueryExecution' {} Maybe ResultConfiguration
a -> QueryExecution
s {$sel:resultConfiguration:QueryExecution' :: Maybe ResultConfiguration
resultConfiguration = Maybe ResultConfiguration
a} :: QueryExecution)
queryExecution_query :: Lens.Lens' QueryExecution (Prelude.Maybe Prelude.Text)
queryExecution_query :: (Maybe Text -> f (Maybe Text))
-> QueryExecution -> f QueryExecution
queryExecution_query = (QueryExecution -> Maybe Text)
-> (QueryExecution -> Maybe Text -> QueryExecution)
-> Lens QueryExecution QueryExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryExecution' {Maybe Text
query :: Maybe Text
$sel:query:QueryExecution' :: QueryExecution -> Maybe Text
query} -> Maybe Text
query) (\s :: QueryExecution
s@QueryExecution' {} Maybe Text
a -> QueryExecution
s {$sel:query:QueryExecution' :: Maybe Text
query = Maybe Text
a} :: QueryExecution)
queryExecution_statementType :: Lens.Lens' QueryExecution (Prelude.Maybe StatementType)
queryExecution_statementType :: (Maybe StatementType -> f (Maybe StatementType))
-> QueryExecution -> f QueryExecution
queryExecution_statementType = (QueryExecution -> Maybe StatementType)
-> (QueryExecution -> Maybe StatementType -> QueryExecution)
-> Lens
QueryExecution
QueryExecution
(Maybe StatementType)
(Maybe StatementType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryExecution' {Maybe StatementType
statementType :: Maybe StatementType
$sel:statementType:QueryExecution' :: QueryExecution -> Maybe StatementType
statementType} -> Maybe StatementType
statementType) (\s :: QueryExecution
s@QueryExecution' {} Maybe StatementType
a -> QueryExecution
s {$sel:statementType:QueryExecution' :: Maybe StatementType
statementType = Maybe StatementType
a} :: QueryExecution)
queryExecution_statistics :: Lens.Lens' QueryExecution (Prelude.Maybe QueryExecutionStatistics)
queryExecution_statistics :: (Maybe QueryExecutionStatistics
-> f (Maybe QueryExecutionStatistics))
-> QueryExecution -> f QueryExecution
queryExecution_statistics = (QueryExecution -> Maybe QueryExecutionStatistics)
-> (QueryExecution
-> Maybe QueryExecutionStatistics -> QueryExecution)
-> Lens
QueryExecution
QueryExecution
(Maybe QueryExecutionStatistics)
(Maybe QueryExecutionStatistics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryExecution' {Maybe QueryExecutionStatistics
statistics :: Maybe QueryExecutionStatistics
$sel:statistics:QueryExecution' :: QueryExecution -> Maybe QueryExecutionStatistics
statistics} -> Maybe QueryExecutionStatistics
statistics) (\s :: QueryExecution
s@QueryExecution' {} Maybe QueryExecutionStatistics
a -> QueryExecution
s {$sel:statistics:QueryExecution' :: Maybe QueryExecutionStatistics
statistics = Maybe QueryExecutionStatistics
a} :: QueryExecution)
queryExecution_queryExecutionId :: Lens.Lens' QueryExecution (Prelude.Maybe Prelude.Text)
queryExecution_queryExecutionId :: (Maybe Text -> f (Maybe Text))
-> QueryExecution -> f QueryExecution
queryExecution_queryExecutionId = (QueryExecution -> Maybe Text)
-> (QueryExecution -> Maybe Text -> QueryExecution)
-> Lens QueryExecution QueryExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryExecution' {Maybe Text
queryExecutionId :: Maybe Text
$sel:queryExecutionId:QueryExecution' :: QueryExecution -> Maybe Text
queryExecutionId} -> Maybe Text
queryExecutionId) (\s :: QueryExecution
s@QueryExecution' {} Maybe Text
a -> QueryExecution
s {$sel:queryExecutionId:QueryExecution' :: Maybe Text
queryExecutionId = Maybe Text
a} :: QueryExecution)
queryExecution_workGroup :: Lens.Lens' QueryExecution (Prelude.Maybe Prelude.Text)
queryExecution_workGroup :: (Maybe Text -> f (Maybe Text))
-> QueryExecution -> f QueryExecution
queryExecution_workGroup = (QueryExecution -> Maybe Text)
-> (QueryExecution -> Maybe Text -> QueryExecution)
-> Lens QueryExecution QueryExecution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryExecution' {Maybe Text
workGroup :: Maybe Text
$sel:workGroup:QueryExecution' :: QueryExecution -> Maybe Text
workGroup} -> Maybe Text
workGroup) (\s :: QueryExecution
s@QueryExecution' {} Maybe Text
a -> QueryExecution
s {$sel:workGroup:QueryExecution' :: Maybe Text
workGroup = Maybe Text
a} :: QueryExecution)
instance Core.FromJSON QueryExecution where
parseJSON :: Value -> Parser QueryExecution
parseJSON =
String
-> (Object -> Parser QueryExecution)
-> Value
-> Parser QueryExecution
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"QueryExecution"
( \Object
x ->
Maybe EngineVersion
-> Maybe QueryExecutionStatus
-> Maybe QueryExecutionContext
-> Maybe ResultConfiguration
-> Maybe Text
-> Maybe StatementType
-> Maybe QueryExecutionStatistics
-> Maybe Text
-> Maybe Text
-> QueryExecution
QueryExecution'
(Maybe EngineVersion
-> Maybe QueryExecutionStatus
-> Maybe QueryExecutionContext
-> Maybe ResultConfiguration
-> Maybe Text
-> Maybe StatementType
-> Maybe QueryExecutionStatistics
-> Maybe Text
-> Maybe Text
-> QueryExecution)
-> Parser (Maybe EngineVersion)
-> Parser
(Maybe QueryExecutionStatus
-> Maybe QueryExecutionContext
-> Maybe ResultConfiguration
-> Maybe Text
-> Maybe StatementType
-> Maybe QueryExecutionStatistics
-> Maybe Text
-> Maybe Text
-> QueryExecution)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe EngineVersion)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EngineVersion")
Parser
(Maybe QueryExecutionStatus
-> Maybe QueryExecutionContext
-> Maybe ResultConfiguration
-> Maybe Text
-> Maybe StatementType
-> Maybe QueryExecutionStatistics
-> Maybe Text
-> Maybe Text
-> QueryExecution)
-> Parser (Maybe QueryExecutionStatus)
-> Parser
(Maybe QueryExecutionContext
-> Maybe ResultConfiguration
-> Maybe Text
-> Maybe StatementType
-> Maybe QueryExecutionStatistics
-> Maybe Text
-> Maybe Text
-> QueryExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe QueryExecutionStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe QueryExecutionContext
-> Maybe ResultConfiguration
-> Maybe Text
-> Maybe StatementType
-> Maybe QueryExecutionStatistics
-> Maybe Text
-> Maybe Text
-> QueryExecution)
-> Parser (Maybe QueryExecutionContext)
-> Parser
(Maybe ResultConfiguration
-> Maybe Text
-> Maybe StatementType
-> Maybe QueryExecutionStatistics
-> Maybe Text
-> Maybe Text
-> QueryExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe QueryExecutionContext)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QueryExecutionContext")
Parser
(Maybe ResultConfiguration
-> Maybe Text
-> Maybe StatementType
-> Maybe QueryExecutionStatistics
-> Maybe Text
-> Maybe Text
-> QueryExecution)
-> Parser (Maybe ResultConfiguration)
-> Parser
(Maybe Text
-> Maybe StatementType
-> Maybe QueryExecutionStatistics
-> Maybe Text
-> Maybe Text
-> QueryExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResultConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResultConfiguration")
Parser
(Maybe Text
-> Maybe StatementType
-> Maybe QueryExecutionStatistics
-> Maybe Text
-> Maybe Text
-> QueryExecution)
-> Parser (Maybe Text)
-> Parser
(Maybe StatementType
-> Maybe QueryExecutionStatistics
-> Maybe Text
-> Maybe Text
-> QueryExecution)
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
"Query")
Parser
(Maybe StatementType
-> Maybe QueryExecutionStatistics
-> Maybe Text
-> Maybe Text
-> QueryExecution)
-> Parser (Maybe StatementType)
-> Parser
(Maybe QueryExecutionStatistics
-> Maybe Text -> Maybe Text -> QueryExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe StatementType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatementType")
Parser
(Maybe QueryExecutionStatistics
-> Maybe Text -> Maybe Text -> QueryExecution)
-> Parser (Maybe QueryExecutionStatistics)
-> Parser (Maybe Text -> Maybe Text -> QueryExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe QueryExecutionStatistics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Statistics")
Parser (Maybe Text -> Maybe Text -> QueryExecution)
-> Parser (Maybe Text) -> Parser (Maybe Text -> QueryExecution)
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
"QueryExecutionId")
Parser (Maybe Text -> QueryExecution)
-> Parser (Maybe Text) -> Parser QueryExecution
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
"WorkGroup")
)
instance Prelude.Hashable QueryExecution
instance Prelude.NFData QueryExecution