{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Athena.Types.QueryExecution
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Information about a single instance of a query execution.
--
-- /See:/ 'newQueryExecution' smart constructor.
data QueryExecution = QueryExecution'
  { -- | The engine version that executed the query.
    QueryExecution -> Maybe EngineVersion
engineVersion :: Prelude.Maybe EngineVersion,
    -- | The completion date, current state, submission time, and state change
    -- reason (if applicable) for the query execution.
    QueryExecution -> Maybe QueryExecutionStatus
status :: Prelude.Maybe QueryExecutionStatus,
    -- | The database in which the query execution occurred.
    QueryExecution -> Maybe QueryExecutionContext
queryExecutionContext :: Prelude.Maybe QueryExecutionContext,
    -- | The location in Amazon S3 where query results were stored and the
    -- encryption option, if any, used for query results. These are known as
    -- \"client-side settings\". If workgroup settings override client-side
    -- settings, then the query uses the location for the query results and the
    -- encryption configuration that are specified for the workgroup.
    QueryExecution -> Maybe ResultConfiguration
resultConfiguration :: Prelude.Maybe ResultConfiguration,
    -- | The SQL query statements which the query execution ran.
    QueryExecution -> Maybe Text
query :: Prelude.Maybe Prelude.Text,
    -- | The type of query statement that was run. @DDL@ indicates DDL query
    -- statements. @DML@ indicates DML (Data Manipulation Language) query
    -- statements, such as @CREATE TABLE AS SELECT@. @UTILITY@ indicates query
    -- statements other than DDL and DML, such as @SHOW CREATE TABLE@, or
    -- @DESCRIBE TABLE@.
    QueryExecution -> Maybe StatementType
statementType :: Prelude.Maybe StatementType,
    -- | Query execution statistics, such as the amount of data scanned, the
    -- amount of time that the query took to process, and the type of statement
    -- that was run.
    QueryExecution -> Maybe QueryExecutionStatistics
statistics :: Prelude.Maybe QueryExecutionStatistics,
    -- | The unique identifier for each query execution.
    QueryExecution -> Maybe Text
queryExecutionId :: Prelude.Maybe Prelude.Text,
    -- | The name of the workgroup in which the query ran.
    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)

-- |
-- Create a value of 'QueryExecution' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'engineVersion', 'queryExecution_engineVersion' - The engine version that executed the query.
--
-- 'status', 'queryExecution_status' - The completion date, current state, submission time, and state change
-- reason (if applicable) for the query execution.
--
-- 'queryExecutionContext', 'queryExecution_queryExecutionContext' - The database in which the query execution occurred.
--
-- 'resultConfiguration', 'queryExecution_resultConfiguration' - The location in Amazon S3 where query results were stored and the
-- encryption option, if any, used for query results. These are known as
-- \"client-side settings\". If workgroup settings override client-side
-- settings, then the query uses the location for the query results and the
-- encryption configuration that are specified for the workgroup.
--
-- 'query', 'queryExecution_query' - The SQL query statements which the query execution ran.
--
-- 'statementType', 'queryExecution_statementType' - The type of query statement that was run. @DDL@ indicates DDL query
-- statements. @DML@ indicates DML (Data Manipulation Language) query
-- statements, such as @CREATE TABLE AS SELECT@. @UTILITY@ indicates query
-- statements other than DDL and DML, such as @SHOW CREATE TABLE@, or
-- @DESCRIBE TABLE@.
--
-- 'statistics', 'queryExecution_statistics' - Query execution statistics, such as the amount of data scanned, the
-- amount of time that the query took to process, and the type of statement
-- that was run.
--
-- 'queryExecutionId', 'queryExecution_queryExecutionId' - The unique identifier for each query execution.
--
-- 'workGroup', 'queryExecution_workGroup' - The name of the workgroup in which the query ran.
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
    }

-- | The engine version that executed the query.
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)

-- | The completion date, current state, submission time, and state change
-- reason (if applicable) for the query execution.
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)

-- | The database in which the query execution occurred.
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)

-- | The location in Amazon S3 where query results were stored and the
-- encryption option, if any, used for query results. These are known as
-- \"client-side settings\". If workgroup settings override client-side
-- settings, then the query uses the location for the query results and the
-- encryption configuration that are specified for the workgroup.
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)

-- | The SQL query statements which the query execution ran.
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)

-- | The type of query statement that was run. @DDL@ indicates DDL query
-- statements. @DML@ indicates DML (Data Manipulation Language) query
-- statements, such as @CREATE TABLE AS SELECT@. @UTILITY@ indicates query
-- statements other than DDL and DML, such as @SHOW CREATE TABLE@, or
-- @DESCRIBE TABLE@.
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)

-- | Query execution statistics, such as the amount of data scanned, the
-- amount of time that the query took to process, and the type of statement
-- that was run.
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)

-- | The unique identifier for each query execution.
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)

-- | The name of the workgroup in which the query ran.
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