{-# 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.RedshiftData.Types.SubStatementData
-- 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.RedshiftData.Types.SubStatementData where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RedshiftData.Types.StatementStatusString

-- | Information about an SQL statement.
--
-- /See:/ 'newSubStatementData' smart constructor.
data SubStatementData = SubStatementData'
  { -- | The status of the SQL statement. An example is the that the SQL
    -- statement finished.
    SubStatementData -> Maybe StatementStatusString
status :: Prelude.Maybe StatementStatusString,
    -- | The SQL statement identifier. This value is a universally unique
    -- identifier (UUID) generated by Amazon Redshift Data API.
    SubStatementData -> Maybe Integer
redshiftQueryId :: Prelude.Maybe Prelude.Integer,
    -- | The size in bytes of the returned results. A @-1@ indicates the value is
    -- null.
    SubStatementData -> Maybe Integer
resultSize :: Prelude.Maybe Prelude.Integer,
    -- | The date and time (UTC) the statement was created.
    SubStatementData -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The error message from the cluster if the SQL statement encountered an
    -- error while running.
    SubStatementData -> Maybe Text
error :: Prelude.Maybe Prelude.Text,
    -- | Either the number of rows returned from the SQL statement or the number
    -- of rows affected. If result size is greater than zero, the result rows
    -- can be the number of rows affected by SQL statements such as INSERT,
    -- UPDATE, DELETE, COPY, and others. A @-1@ indicates the value is null.
    SubStatementData -> Maybe Integer
resultRows :: Prelude.Maybe Prelude.Integer,
    -- | A value that indicates whether the statement has a result set. The
    -- result set can be empty.
    SubStatementData -> Maybe Bool
hasResultSet :: Prelude.Maybe Prelude.Bool,
    -- | The SQL statement text.
    SubStatementData -> Maybe Text
queryString :: Prelude.Maybe Prelude.Text,
    -- | The date and time (UTC) that the statement metadata was last updated.
    SubStatementData -> Maybe POSIX
updatedAt :: Prelude.Maybe Core.POSIX,
    -- | The amount of time in nanoseconds that the statement ran.
    SubStatementData -> Maybe Integer
duration :: Prelude.Maybe Prelude.Integer,
    -- | The identifier of the SQL statement. This value is a universally unique
    -- identifier (UUID) generated by Amazon Redshift Data API. A suffix
    -- indicates the number of the SQL statement. For example,
    -- @d9b6c0c9-0747-4bf4-b142-e8883122f766:2@ has a suffix of @:2@ that
    -- indicates the second SQL statement of a batch query.
    SubStatementData -> Text
id :: Prelude.Text
  }
  deriving (SubStatementData -> SubStatementData -> Bool
(SubStatementData -> SubStatementData -> Bool)
-> (SubStatementData -> SubStatementData -> Bool)
-> Eq SubStatementData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SubStatementData -> SubStatementData -> Bool
$c/= :: SubStatementData -> SubStatementData -> Bool
== :: SubStatementData -> SubStatementData -> Bool
$c== :: SubStatementData -> SubStatementData -> Bool
Prelude.Eq, ReadPrec [SubStatementData]
ReadPrec SubStatementData
Int -> ReadS SubStatementData
ReadS [SubStatementData]
(Int -> ReadS SubStatementData)
-> ReadS [SubStatementData]
-> ReadPrec SubStatementData
-> ReadPrec [SubStatementData]
-> Read SubStatementData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SubStatementData]
$creadListPrec :: ReadPrec [SubStatementData]
readPrec :: ReadPrec SubStatementData
$creadPrec :: ReadPrec SubStatementData
readList :: ReadS [SubStatementData]
$creadList :: ReadS [SubStatementData]
readsPrec :: Int -> ReadS SubStatementData
$creadsPrec :: Int -> ReadS SubStatementData
Prelude.Read, Int -> SubStatementData -> ShowS
[SubStatementData] -> ShowS
SubStatementData -> String
(Int -> SubStatementData -> ShowS)
-> (SubStatementData -> String)
-> ([SubStatementData] -> ShowS)
-> Show SubStatementData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SubStatementData] -> ShowS
$cshowList :: [SubStatementData] -> ShowS
show :: SubStatementData -> String
$cshow :: SubStatementData -> String
showsPrec :: Int -> SubStatementData -> ShowS
$cshowsPrec :: Int -> SubStatementData -> ShowS
Prelude.Show, (forall x. SubStatementData -> Rep SubStatementData x)
-> (forall x. Rep SubStatementData x -> SubStatementData)
-> Generic SubStatementData
forall x. Rep SubStatementData x -> SubStatementData
forall x. SubStatementData -> Rep SubStatementData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SubStatementData x -> SubStatementData
$cfrom :: forall x. SubStatementData -> Rep SubStatementData x
Prelude.Generic)

-- |
-- Create a value of 'SubStatementData' 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:
--
-- 'status', 'subStatementData_status' - The status of the SQL statement. An example is the that the SQL
-- statement finished.
--
-- 'redshiftQueryId', 'subStatementData_redshiftQueryId' - The SQL statement identifier. This value is a universally unique
-- identifier (UUID) generated by Amazon Redshift Data API.
--
-- 'resultSize', 'subStatementData_resultSize' - The size in bytes of the returned results. A @-1@ indicates the value is
-- null.
--
-- 'createdAt', 'subStatementData_createdAt' - The date and time (UTC) the statement was created.
--
-- 'error', 'subStatementData_error' - The error message from the cluster if the SQL statement encountered an
-- error while running.
--
-- 'resultRows', 'subStatementData_resultRows' - Either the number of rows returned from the SQL statement or the number
-- of rows affected. If result size is greater than zero, the result rows
-- can be the number of rows affected by SQL statements such as INSERT,
-- UPDATE, DELETE, COPY, and others. A @-1@ indicates the value is null.
--
-- 'hasResultSet', 'subStatementData_hasResultSet' - A value that indicates whether the statement has a result set. The
-- result set can be empty.
--
-- 'queryString', 'subStatementData_queryString' - The SQL statement text.
--
-- 'updatedAt', 'subStatementData_updatedAt' - The date and time (UTC) that the statement metadata was last updated.
--
-- 'duration', 'subStatementData_duration' - The amount of time in nanoseconds that the statement ran.
--
-- 'id', 'subStatementData_id' - The identifier of the SQL statement. This value is a universally unique
-- identifier (UUID) generated by Amazon Redshift Data API. A suffix
-- indicates the number of the SQL statement. For example,
-- @d9b6c0c9-0747-4bf4-b142-e8883122f766:2@ has a suffix of @:2@ that
-- indicates the second SQL statement of a batch query.
newSubStatementData ::
  -- | 'id'
  Prelude.Text ->
  SubStatementData
newSubStatementData :: Text -> SubStatementData
newSubStatementData Text
pId_ =
  SubStatementData' :: Maybe StatementStatusString
-> Maybe Integer
-> Maybe Integer
-> Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> Maybe Bool
-> Maybe Text
-> Maybe POSIX
-> Maybe Integer
-> Text
-> SubStatementData
SubStatementData'
    { $sel:status:SubStatementData' :: Maybe StatementStatusString
status = Maybe StatementStatusString
forall a. Maybe a
Prelude.Nothing,
      $sel:redshiftQueryId:SubStatementData' :: Maybe Integer
redshiftQueryId = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:resultSize:SubStatementData' :: Maybe Integer
resultSize = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:SubStatementData' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:error:SubStatementData' :: Maybe Text
error = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resultRows:SubStatementData' :: Maybe Integer
resultRows = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:hasResultSet:SubStatementData' :: Maybe Bool
hasResultSet = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:queryString:SubStatementData' :: Maybe Text
queryString = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:updatedAt:SubStatementData' :: Maybe POSIX
updatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:duration:SubStatementData' :: Maybe Integer
duration = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:id:SubStatementData' :: Text
id = Text
pId_
    }

-- | The status of the SQL statement. An example is the that the SQL
-- statement finished.
subStatementData_status :: Lens.Lens' SubStatementData (Prelude.Maybe StatementStatusString)
subStatementData_status :: (Maybe StatementStatusString -> f (Maybe StatementStatusString))
-> SubStatementData -> f SubStatementData
subStatementData_status = (SubStatementData -> Maybe StatementStatusString)
-> (SubStatementData
    -> Maybe StatementStatusString -> SubStatementData)
-> Lens
     SubStatementData
     SubStatementData
     (Maybe StatementStatusString)
     (Maybe StatementStatusString)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubStatementData' {Maybe StatementStatusString
status :: Maybe StatementStatusString
$sel:status:SubStatementData' :: SubStatementData -> Maybe StatementStatusString
status} -> Maybe StatementStatusString
status) (\s :: SubStatementData
s@SubStatementData' {} Maybe StatementStatusString
a -> SubStatementData
s {$sel:status:SubStatementData' :: Maybe StatementStatusString
status = Maybe StatementStatusString
a} :: SubStatementData)

-- | The SQL statement identifier. This value is a universally unique
-- identifier (UUID) generated by Amazon Redshift Data API.
subStatementData_redshiftQueryId :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.Integer)
subStatementData_redshiftQueryId :: (Maybe Integer -> f (Maybe Integer))
-> SubStatementData -> f SubStatementData
subStatementData_redshiftQueryId = (SubStatementData -> Maybe Integer)
-> (SubStatementData -> Maybe Integer -> SubStatementData)
-> Lens
     SubStatementData SubStatementData (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubStatementData' {Maybe Integer
redshiftQueryId :: Maybe Integer
$sel:redshiftQueryId:SubStatementData' :: SubStatementData -> Maybe Integer
redshiftQueryId} -> Maybe Integer
redshiftQueryId) (\s :: SubStatementData
s@SubStatementData' {} Maybe Integer
a -> SubStatementData
s {$sel:redshiftQueryId:SubStatementData' :: Maybe Integer
redshiftQueryId = Maybe Integer
a} :: SubStatementData)

-- | The size in bytes of the returned results. A @-1@ indicates the value is
-- null.
subStatementData_resultSize :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.Integer)
subStatementData_resultSize :: (Maybe Integer -> f (Maybe Integer))
-> SubStatementData -> f SubStatementData
subStatementData_resultSize = (SubStatementData -> Maybe Integer)
-> (SubStatementData -> Maybe Integer -> SubStatementData)
-> Lens
     SubStatementData SubStatementData (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubStatementData' {Maybe Integer
resultSize :: Maybe Integer
$sel:resultSize:SubStatementData' :: SubStatementData -> Maybe Integer
resultSize} -> Maybe Integer
resultSize) (\s :: SubStatementData
s@SubStatementData' {} Maybe Integer
a -> SubStatementData
s {$sel:resultSize:SubStatementData' :: Maybe Integer
resultSize = Maybe Integer
a} :: SubStatementData)

-- | The date and time (UTC) the statement was created.
subStatementData_createdAt :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.UTCTime)
subStatementData_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SubStatementData -> f SubStatementData
subStatementData_createdAt = (SubStatementData -> Maybe POSIX)
-> (SubStatementData -> Maybe POSIX -> SubStatementData)
-> Lens
     SubStatementData SubStatementData (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubStatementData' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:SubStatementData' :: SubStatementData -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: SubStatementData
s@SubStatementData' {} Maybe POSIX
a -> SubStatementData
s {$sel:createdAt:SubStatementData' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: SubStatementData) ((Maybe POSIX -> f (Maybe POSIX))
 -> SubStatementData -> f SubStatementData)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SubStatementData
-> f SubStatementData
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

-- | The error message from the cluster if the SQL statement encountered an
-- error while running.
subStatementData_error :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.Text)
subStatementData_error :: (Maybe Text -> f (Maybe Text))
-> SubStatementData -> f SubStatementData
subStatementData_error = (SubStatementData -> Maybe Text)
-> (SubStatementData -> Maybe Text -> SubStatementData)
-> Lens SubStatementData SubStatementData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubStatementData' {Maybe Text
error :: Maybe Text
$sel:error:SubStatementData' :: SubStatementData -> Maybe Text
error} -> Maybe Text
error) (\s :: SubStatementData
s@SubStatementData' {} Maybe Text
a -> SubStatementData
s {$sel:error:SubStatementData' :: Maybe Text
error = Maybe Text
a} :: SubStatementData)

-- | Either the number of rows returned from the SQL statement or the number
-- of rows affected. If result size is greater than zero, the result rows
-- can be the number of rows affected by SQL statements such as INSERT,
-- UPDATE, DELETE, COPY, and others. A @-1@ indicates the value is null.
subStatementData_resultRows :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.Integer)
subStatementData_resultRows :: (Maybe Integer -> f (Maybe Integer))
-> SubStatementData -> f SubStatementData
subStatementData_resultRows = (SubStatementData -> Maybe Integer)
-> (SubStatementData -> Maybe Integer -> SubStatementData)
-> Lens
     SubStatementData SubStatementData (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubStatementData' {Maybe Integer
resultRows :: Maybe Integer
$sel:resultRows:SubStatementData' :: SubStatementData -> Maybe Integer
resultRows} -> Maybe Integer
resultRows) (\s :: SubStatementData
s@SubStatementData' {} Maybe Integer
a -> SubStatementData
s {$sel:resultRows:SubStatementData' :: Maybe Integer
resultRows = Maybe Integer
a} :: SubStatementData)

-- | A value that indicates whether the statement has a result set. The
-- result set can be empty.
subStatementData_hasResultSet :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.Bool)
subStatementData_hasResultSet :: (Maybe Bool -> f (Maybe Bool))
-> SubStatementData -> f SubStatementData
subStatementData_hasResultSet = (SubStatementData -> Maybe Bool)
-> (SubStatementData -> Maybe Bool -> SubStatementData)
-> Lens SubStatementData SubStatementData (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubStatementData' {Maybe Bool
hasResultSet :: Maybe Bool
$sel:hasResultSet:SubStatementData' :: SubStatementData -> Maybe Bool
hasResultSet} -> Maybe Bool
hasResultSet) (\s :: SubStatementData
s@SubStatementData' {} Maybe Bool
a -> SubStatementData
s {$sel:hasResultSet:SubStatementData' :: Maybe Bool
hasResultSet = Maybe Bool
a} :: SubStatementData)

-- | The SQL statement text.
subStatementData_queryString :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.Text)
subStatementData_queryString :: (Maybe Text -> f (Maybe Text))
-> SubStatementData -> f SubStatementData
subStatementData_queryString = (SubStatementData -> Maybe Text)
-> (SubStatementData -> Maybe Text -> SubStatementData)
-> Lens SubStatementData SubStatementData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubStatementData' {Maybe Text
queryString :: Maybe Text
$sel:queryString:SubStatementData' :: SubStatementData -> Maybe Text
queryString} -> Maybe Text
queryString) (\s :: SubStatementData
s@SubStatementData' {} Maybe Text
a -> SubStatementData
s {$sel:queryString:SubStatementData' :: Maybe Text
queryString = Maybe Text
a} :: SubStatementData)

-- | The date and time (UTC) that the statement metadata was last updated.
subStatementData_updatedAt :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.UTCTime)
subStatementData_updatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SubStatementData -> f SubStatementData
subStatementData_updatedAt = (SubStatementData -> Maybe POSIX)
-> (SubStatementData -> Maybe POSIX -> SubStatementData)
-> Lens
     SubStatementData SubStatementData (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubStatementData' {Maybe POSIX
updatedAt :: Maybe POSIX
$sel:updatedAt:SubStatementData' :: SubStatementData -> Maybe POSIX
updatedAt} -> Maybe POSIX
updatedAt) (\s :: SubStatementData
s@SubStatementData' {} Maybe POSIX
a -> SubStatementData
s {$sel:updatedAt:SubStatementData' :: Maybe POSIX
updatedAt = Maybe POSIX
a} :: SubStatementData) ((Maybe POSIX -> f (Maybe POSIX))
 -> SubStatementData -> f SubStatementData)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SubStatementData
-> f SubStatementData
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

-- | The amount of time in nanoseconds that the statement ran.
subStatementData_duration :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.Integer)
subStatementData_duration :: (Maybe Integer -> f (Maybe Integer))
-> SubStatementData -> f SubStatementData
subStatementData_duration = (SubStatementData -> Maybe Integer)
-> (SubStatementData -> Maybe Integer -> SubStatementData)
-> Lens
     SubStatementData SubStatementData (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubStatementData' {Maybe Integer
duration :: Maybe Integer
$sel:duration:SubStatementData' :: SubStatementData -> Maybe Integer
duration} -> Maybe Integer
duration) (\s :: SubStatementData
s@SubStatementData' {} Maybe Integer
a -> SubStatementData
s {$sel:duration:SubStatementData' :: Maybe Integer
duration = Maybe Integer
a} :: SubStatementData)

-- | The identifier of the SQL statement. This value is a universally unique
-- identifier (UUID) generated by Amazon Redshift Data API. A suffix
-- indicates the number of the SQL statement. For example,
-- @d9b6c0c9-0747-4bf4-b142-e8883122f766:2@ has a suffix of @:2@ that
-- indicates the second SQL statement of a batch query.
subStatementData_id :: Lens.Lens' SubStatementData Prelude.Text
subStatementData_id :: (Text -> f Text) -> SubStatementData -> f SubStatementData
subStatementData_id = (SubStatementData -> Text)
-> (SubStatementData -> Text -> SubStatementData)
-> Lens SubStatementData SubStatementData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubStatementData' {Text
id :: Text
$sel:id:SubStatementData' :: SubStatementData -> Text
id} -> Text
id) (\s :: SubStatementData
s@SubStatementData' {} Text
a -> SubStatementData
s {$sel:id:SubStatementData' :: Text
id = Text
a} :: SubStatementData)

instance Core.FromJSON SubStatementData where
  parseJSON :: Value -> Parser SubStatementData
parseJSON =
    String
-> (Object -> Parser SubStatementData)
-> Value
-> Parser SubStatementData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SubStatementData"
      ( \Object
x ->
          Maybe StatementStatusString
-> Maybe Integer
-> Maybe Integer
-> Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> Maybe Bool
-> Maybe Text
-> Maybe POSIX
-> Maybe Integer
-> Text
-> SubStatementData
SubStatementData'
            (Maybe StatementStatusString
 -> Maybe Integer
 -> Maybe Integer
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Integer
 -> Maybe Bool
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Integer
 -> Text
 -> SubStatementData)
-> Parser (Maybe StatementStatusString)
-> Parser
     (Maybe Integer
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Bool
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Integer
      -> Text
      -> SubStatementData)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe StatementStatusString)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Integer
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Bool
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Integer
   -> Text
   -> SubStatementData)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Bool
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Integer
      -> Text
      -> SubStatementData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RedshiftQueryId")
            Parser
  (Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Bool
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Integer
   -> Text
   -> SubStatementData)
-> Parser (Maybe Integer)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Bool
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Integer
      -> Text
      -> SubStatementData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResultSize")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Bool
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Integer
   -> Text
   -> SubStatementData)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Integer
      -> Maybe Bool
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Integer
      -> Text
      -> SubStatementData)
forall (f :: * -> *) a b. Applicative f => 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
"CreatedAt")
            Parser
  (Maybe Text
   -> Maybe Integer
   -> Maybe Bool
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Integer
   -> Text
   -> SubStatementData)
-> Parser (Maybe Text)
-> Parser
     (Maybe Integer
      -> Maybe Bool
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Integer
      -> Text
      -> SubStatementData)
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
"Error")
            Parser
  (Maybe Integer
   -> Maybe Bool
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Integer
   -> Text
   -> SubStatementData)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Integer
      -> Text
      -> SubStatementData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResultRows")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Integer
   -> Text
   -> SubStatementData)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe POSIX -> Maybe Integer -> Text -> SubStatementData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HasResultSet")
            Parser
  (Maybe Text
   -> Maybe POSIX -> Maybe Integer -> Text -> SubStatementData)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX -> Maybe Integer -> Text -> SubStatementData)
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
"QueryString")
            Parser (Maybe POSIX -> Maybe Integer -> Text -> SubStatementData)
-> Parser (Maybe POSIX)
-> Parser (Maybe Integer -> Text -> SubStatementData)
forall (f :: * -> *) a b. Applicative f => 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
"UpdatedAt")
            Parser (Maybe Integer -> Text -> SubStatementData)
-> Parser (Maybe Integer) -> Parser (Text -> SubStatementData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Duration")
            Parser (Text -> SubStatementData)
-> Parser Text -> Parser SubStatementData
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Id")
      )

instance Prelude.Hashable SubStatementData

instance Prelude.NFData SubStatementData