{-# 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.StatementData
-- 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.StatementData where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RedshiftData.Types.SqlParameter
import Amazonka.RedshiftData.Types.StatusString

-- | The SQL statement to run.
--
-- /See:/ 'newStatementData' smart constructor.
data StatementData = StatementData'
  { -- | The status of the SQL statement. An example is the that the SQL
    -- statement finished.
    StatementData -> Maybe StatusString
status :: Prelude.Maybe StatusString,
    -- | The date and time (UTC) the statement was created.
    StatementData -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The parameters used in a SQL statement.
    StatementData -> Maybe (NonEmpty SqlParameter)
queryParameters :: Prelude.Maybe (Prelude.NonEmpty SqlParameter),
    -- | One or more SQL statements. Each query string in the array corresponds
    -- to one of the queries in a batch query request.
    StatementData -> Maybe [Text]
queryStrings :: Prelude.Maybe [Prelude.Text],
    -- | The SQL statement.
    StatementData -> Maybe Text
queryString :: Prelude.Maybe Prelude.Text,
    -- | The name of the SQL statement.
    StatementData -> Maybe Text
statementName :: Prelude.Maybe Prelude.Text,
    -- | The date and time (UTC) that the statement metadata was last updated.
    StatementData -> Maybe POSIX
updatedAt :: Prelude.Maybe Core.POSIX,
    -- | The name or Amazon Resource Name (ARN) of the secret that enables access
    -- to the database.
    StatementData -> Maybe Text
secretArn :: Prelude.Maybe Prelude.Text,
    -- | A value that indicates whether the statement is a batch query request.
    StatementData -> Maybe Bool
isBatchStatement :: Prelude.Maybe Prelude.Bool,
    -- | The SQL statement identifier. This value is a universally unique
    -- identifier (UUID) generated by Amazon Redshift Data API.
    StatementData -> Text
id :: Prelude.Text
  }
  deriving (StatementData -> StatementData -> Bool
(StatementData -> StatementData -> Bool)
-> (StatementData -> StatementData -> Bool) -> Eq StatementData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StatementData -> StatementData -> Bool
$c/= :: StatementData -> StatementData -> Bool
== :: StatementData -> StatementData -> Bool
$c== :: StatementData -> StatementData -> Bool
Prelude.Eq, ReadPrec [StatementData]
ReadPrec StatementData
Int -> ReadS StatementData
ReadS [StatementData]
(Int -> ReadS StatementData)
-> ReadS [StatementData]
-> ReadPrec StatementData
-> ReadPrec [StatementData]
-> Read StatementData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StatementData]
$creadListPrec :: ReadPrec [StatementData]
readPrec :: ReadPrec StatementData
$creadPrec :: ReadPrec StatementData
readList :: ReadS [StatementData]
$creadList :: ReadS [StatementData]
readsPrec :: Int -> ReadS StatementData
$creadsPrec :: Int -> ReadS StatementData
Prelude.Read, Int -> StatementData -> ShowS
[StatementData] -> ShowS
StatementData -> String
(Int -> StatementData -> ShowS)
-> (StatementData -> String)
-> ([StatementData] -> ShowS)
-> Show StatementData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StatementData] -> ShowS
$cshowList :: [StatementData] -> ShowS
show :: StatementData -> String
$cshow :: StatementData -> String
showsPrec :: Int -> StatementData -> ShowS
$cshowsPrec :: Int -> StatementData -> ShowS
Prelude.Show, (forall x. StatementData -> Rep StatementData x)
-> (forall x. Rep StatementData x -> StatementData)
-> Generic StatementData
forall x. Rep StatementData x -> StatementData
forall x. StatementData -> Rep StatementData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StatementData x -> StatementData
$cfrom :: forall x. StatementData -> Rep StatementData x
Prelude.Generic)

-- |
-- Create a value of 'StatementData' 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', 'statementData_status' - The status of the SQL statement. An example is the that the SQL
-- statement finished.
--
-- 'createdAt', 'statementData_createdAt' - The date and time (UTC) the statement was created.
--
-- 'queryParameters', 'statementData_queryParameters' - The parameters used in a SQL statement.
--
-- 'queryStrings', 'statementData_queryStrings' - One or more SQL statements. Each query string in the array corresponds
-- to one of the queries in a batch query request.
--
-- 'queryString', 'statementData_queryString' - The SQL statement.
--
-- 'statementName', 'statementData_statementName' - The name of the SQL statement.
--
-- 'updatedAt', 'statementData_updatedAt' - The date and time (UTC) that the statement metadata was last updated.
--
-- 'secretArn', 'statementData_secretArn' - The name or Amazon Resource Name (ARN) of the secret that enables access
-- to the database.
--
-- 'isBatchStatement', 'statementData_isBatchStatement' - A value that indicates whether the statement is a batch query request.
--
-- 'id', 'statementData_id' - The SQL statement identifier. This value is a universally unique
-- identifier (UUID) generated by Amazon Redshift Data API.
newStatementData ::
  -- | 'id'
  Prelude.Text ->
  StatementData
newStatementData :: Text -> StatementData
newStatementData Text
pId_ =
  StatementData' :: Maybe StatusString
-> Maybe POSIX
-> Maybe (NonEmpty SqlParameter)
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Bool
-> Text
-> StatementData
StatementData'
    { $sel:status:StatementData' :: Maybe StatusString
status = Maybe StatusString
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:StatementData' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:queryParameters:StatementData' :: Maybe (NonEmpty SqlParameter)
queryParameters = Maybe (NonEmpty SqlParameter)
forall a. Maybe a
Prelude.Nothing,
      $sel:queryStrings:StatementData' :: Maybe [Text]
queryStrings = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:queryString:StatementData' :: Maybe Text
queryString = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statementName:StatementData' :: Maybe Text
statementName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:updatedAt:StatementData' :: Maybe POSIX
updatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:secretArn:StatementData' :: Maybe Text
secretArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isBatchStatement:StatementData' :: Maybe Bool
isBatchStatement = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:id:StatementData' :: Text
id = Text
pId_
    }

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

-- | The date and time (UTC) the statement was created.
statementData_createdAt :: Lens.Lens' StatementData (Prelude.Maybe Prelude.UTCTime)
statementData_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StatementData -> f StatementData
statementData_createdAt = (StatementData -> Maybe POSIX)
-> (StatementData -> Maybe POSIX -> StatementData)
-> Lens StatementData StatementData (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatementData' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:StatementData' :: StatementData -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: StatementData
s@StatementData' {} Maybe POSIX
a -> StatementData
s {$sel:createdAt:StatementData' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: StatementData) ((Maybe POSIX -> f (Maybe POSIX))
 -> StatementData -> f StatementData)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StatementData
-> f StatementData
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 parameters used in a SQL statement.
statementData_queryParameters :: Lens.Lens' StatementData (Prelude.Maybe (Prelude.NonEmpty SqlParameter))
statementData_queryParameters :: (Maybe (NonEmpty SqlParameter)
 -> f (Maybe (NonEmpty SqlParameter)))
-> StatementData -> f StatementData
statementData_queryParameters = (StatementData -> Maybe (NonEmpty SqlParameter))
-> (StatementData
    -> Maybe (NonEmpty SqlParameter) -> StatementData)
-> Lens
     StatementData
     StatementData
     (Maybe (NonEmpty SqlParameter))
     (Maybe (NonEmpty SqlParameter))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatementData' {Maybe (NonEmpty SqlParameter)
queryParameters :: Maybe (NonEmpty SqlParameter)
$sel:queryParameters:StatementData' :: StatementData -> Maybe (NonEmpty SqlParameter)
queryParameters} -> Maybe (NonEmpty SqlParameter)
queryParameters) (\s :: StatementData
s@StatementData' {} Maybe (NonEmpty SqlParameter)
a -> StatementData
s {$sel:queryParameters:StatementData' :: Maybe (NonEmpty SqlParameter)
queryParameters = Maybe (NonEmpty SqlParameter)
a} :: StatementData) ((Maybe (NonEmpty SqlParameter)
  -> f (Maybe (NonEmpty SqlParameter)))
 -> StatementData -> f StatementData)
-> ((Maybe (NonEmpty SqlParameter)
     -> f (Maybe (NonEmpty SqlParameter)))
    -> Maybe (NonEmpty SqlParameter)
    -> f (Maybe (NonEmpty SqlParameter)))
-> (Maybe (NonEmpty SqlParameter)
    -> f (Maybe (NonEmpty SqlParameter)))
-> StatementData
-> f StatementData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty SqlParameter)
  (NonEmpty SqlParameter)
  (NonEmpty SqlParameter)
  (NonEmpty SqlParameter)
-> Iso
     (Maybe (NonEmpty SqlParameter))
     (Maybe (NonEmpty SqlParameter))
     (Maybe (NonEmpty SqlParameter))
     (Maybe (NonEmpty SqlParameter))
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
  (NonEmpty SqlParameter)
  (NonEmpty SqlParameter)
  (NonEmpty SqlParameter)
  (NonEmpty SqlParameter)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | One or more SQL statements. Each query string in the array corresponds
-- to one of the queries in a batch query request.
statementData_queryStrings :: Lens.Lens' StatementData (Prelude.Maybe [Prelude.Text])
statementData_queryStrings :: (Maybe [Text] -> f (Maybe [Text]))
-> StatementData -> f StatementData
statementData_queryStrings = (StatementData -> Maybe [Text])
-> (StatementData -> Maybe [Text] -> StatementData)
-> Lens StatementData StatementData (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatementData' {Maybe [Text]
queryStrings :: Maybe [Text]
$sel:queryStrings:StatementData' :: StatementData -> Maybe [Text]
queryStrings} -> Maybe [Text]
queryStrings) (\s :: StatementData
s@StatementData' {} Maybe [Text]
a -> StatementData
s {$sel:queryStrings:StatementData' :: Maybe [Text]
queryStrings = Maybe [Text]
a} :: StatementData) ((Maybe [Text] -> f (Maybe [Text]))
 -> StatementData -> f StatementData)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> StatementData
-> f StatementData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The name of the SQL statement.
statementData_statementName :: Lens.Lens' StatementData (Prelude.Maybe Prelude.Text)
statementData_statementName :: (Maybe Text -> f (Maybe Text)) -> StatementData -> f StatementData
statementData_statementName = (StatementData -> Maybe Text)
-> (StatementData -> Maybe Text -> StatementData)
-> Lens StatementData StatementData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatementData' {Maybe Text
statementName :: Maybe Text
$sel:statementName:StatementData' :: StatementData -> Maybe Text
statementName} -> Maybe Text
statementName) (\s :: StatementData
s@StatementData' {} Maybe Text
a -> StatementData
s {$sel:statementName:StatementData' :: Maybe Text
statementName = Maybe Text
a} :: StatementData)

-- | The date and time (UTC) that the statement metadata was last updated.
statementData_updatedAt :: Lens.Lens' StatementData (Prelude.Maybe Prelude.UTCTime)
statementData_updatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StatementData -> f StatementData
statementData_updatedAt = (StatementData -> Maybe POSIX)
-> (StatementData -> Maybe POSIX -> StatementData)
-> Lens StatementData StatementData (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatementData' {Maybe POSIX
updatedAt :: Maybe POSIX
$sel:updatedAt:StatementData' :: StatementData -> Maybe POSIX
updatedAt} -> Maybe POSIX
updatedAt) (\s :: StatementData
s@StatementData' {} Maybe POSIX
a -> StatementData
s {$sel:updatedAt:StatementData' :: Maybe POSIX
updatedAt = Maybe POSIX
a} :: StatementData) ((Maybe POSIX -> f (Maybe POSIX))
 -> StatementData -> f StatementData)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StatementData
-> f StatementData
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 name or Amazon Resource Name (ARN) of the secret that enables access
-- to the database.
statementData_secretArn :: Lens.Lens' StatementData (Prelude.Maybe Prelude.Text)
statementData_secretArn :: (Maybe Text -> f (Maybe Text)) -> StatementData -> f StatementData
statementData_secretArn = (StatementData -> Maybe Text)
-> (StatementData -> Maybe Text -> StatementData)
-> Lens StatementData StatementData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatementData' {Maybe Text
secretArn :: Maybe Text
$sel:secretArn:StatementData' :: StatementData -> Maybe Text
secretArn} -> Maybe Text
secretArn) (\s :: StatementData
s@StatementData' {} Maybe Text
a -> StatementData
s {$sel:secretArn:StatementData' :: Maybe Text
secretArn = Maybe Text
a} :: StatementData)

-- | A value that indicates whether the statement is a batch query request.
statementData_isBatchStatement :: Lens.Lens' StatementData (Prelude.Maybe Prelude.Bool)
statementData_isBatchStatement :: (Maybe Bool -> f (Maybe Bool)) -> StatementData -> f StatementData
statementData_isBatchStatement = (StatementData -> Maybe Bool)
-> (StatementData -> Maybe Bool -> StatementData)
-> Lens StatementData StatementData (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatementData' {Maybe Bool
isBatchStatement :: Maybe Bool
$sel:isBatchStatement:StatementData' :: StatementData -> Maybe Bool
isBatchStatement} -> Maybe Bool
isBatchStatement) (\s :: StatementData
s@StatementData' {} Maybe Bool
a -> StatementData
s {$sel:isBatchStatement:StatementData' :: Maybe Bool
isBatchStatement = Maybe Bool
a} :: StatementData)

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

instance Core.FromJSON StatementData where
  parseJSON :: Value -> Parser StatementData
parseJSON =
    String
-> (Object -> Parser StatementData)
-> Value
-> Parser StatementData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"StatementData"
      ( \Object
x ->
          Maybe StatusString
-> Maybe POSIX
-> Maybe (NonEmpty SqlParameter)
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Bool
-> Text
-> StatementData
StatementData'
            (Maybe StatusString
 -> Maybe POSIX
 -> Maybe (NonEmpty SqlParameter)
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Bool
 -> Text
 -> StatementData)
-> Parser (Maybe StatusString)
-> Parser
     (Maybe POSIX
      -> Maybe (NonEmpty SqlParameter)
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Bool
      -> Text
      -> StatementData)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe StatusString)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe POSIX
   -> Maybe (NonEmpty SqlParameter)
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Bool
   -> Text
   -> StatementData)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe (NonEmpty SqlParameter)
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Bool
      -> Text
      -> StatementData)
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 (NonEmpty SqlParameter)
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Bool
   -> Text
   -> StatementData)
-> Parser (Maybe (NonEmpty SqlParameter))
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Bool
      -> Text
      -> StatementData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty SqlParameter))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QueryParameters")
            Parser
  (Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Bool
   -> Text
   -> StatementData)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Bool
      -> Text
      -> StatementData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QueryStrings" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Bool
   -> Text
   -> StatementData)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Bool
      -> Text
      -> StatementData)
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 Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Bool
   -> Text
   -> StatementData)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX -> Maybe Text -> Maybe Bool -> Text -> StatementData)
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 POSIX -> Maybe Text -> Maybe Bool -> Text -> StatementData)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Bool -> Text -> StatementData)
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 Text -> Maybe Bool -> Text -> StatementData)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> Text -> StatementData)
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
"SecretArn")
            Parser (Maybe Bool -> Text -> StatementData)
-> Parser (Maybe Bool) -> Parser (Text -> StatementData)
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
"IsBatchStatement")
            Parser (Text -> StatementData)
-> Parser Text -> Parser StatementData
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 StatementData

instance Prelude.NFData StatementData