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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes a query execution that failed to process.
--
-- /See:/ 'newUnprocessedQueryExecutionId' smart constructor.
data UnprocessedQueryExecutionId = UnprocessedQueryExecutionId'
  { -- | The error code returned when the query execution failed to process, if
    -- applicable.
    UnprocessedQueryExecutionId -> Maybe Text
errorCode :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the query execution.
    UnprocessedQueryExecutionId -> Maybe Text
queryExecutionId :: Prelude.Maybe Prelude.Text,
    -- | The error message returned when the query execution failed to process,
    -- if applicable.
    UnprocessedQueryExecutionId -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (UnprocessedQueryExecutionId -> UnprocessedQueryExecutionId -> Bool
(UnprocessedQueryExecutionId
 -> UnprocessedQueryExecutionId -> Bool)
-> (UnprocessedQueryExecutionId
    -> UnprocessedQueryExecutionId -> Bool)
-> Eq UnprocessedQueryExecutionId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnprocessedQueryExecutionId -> UnprocessedQueryExecutionId -> Bool
$c/= :: UnprocessedQueryExecutionId -> UnprocessedQueryExecutionId -> Bool
== :: UnprocessedQueryExecutionId -> UnprocessedQueryExecutionId -> Bool
$c== :: UnprocessedQueryExecutionId -> UnprocessedQueryExecutionId -> Bool
Prelude.Eq, ReadPrec [UnprocessedQueryExecutionId]
ReadPrec UnprocessedQueryExecutionId
Int -> ReadS UnprocessedQueryExecutionId
ReadS [UnprocessedQueryExecutionId]
(Int -> ReadS UnprocessedQueryExecutionId)
-> ReadS [UnprocessedQueryExecutionId]
-> ReadPrec UnprocessedQueryExecutionId
-> ReadPrec [UnprocessedQueryExecutionId]
-> Read UnprocessedQueryExecutionId
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UnprocessedQueryExecutionId]
$creadListPrec :: ReadPrec [UnprocessedQueryExecutionId]
readPrec :: ReadPrec UnprocessedQueryExecutionId
$creadPrec :: ReadPrec UnprocessedQueryExecutionId
readList :: ReadS [UnprocessedQueryExecutionId]
$creadList :: ReadS [UnprocessedQueryExecutionId]
readsPrec :: Int -> ReadS UnprocessedQueryExecutionId
$creadsPrec :: Int -> ReadS UnprocessedQueryExecutionId
Prelude.Read, Int -> UnprocessedQueryExecutionId -> ShowS
[UnprocessedQueryExecutionId] -> ShowS
UnprocessedQueryExecutionId -> String
(Int -> UnprocessedQueryExecutionId -> ShowS)
-> (UnprocessedQueryExecutionId -> String)
-> ([UnprocessedQueryExecutionId] -> ShowS)
-> Show UnprocessedQueryExecutionId
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnprocessedQueryExecutionId] -> ShowS
$cshowList :: [UnprocessedQueryExecutionId] -> ShowS
show :: UnprocessedQueryExecutionId -> String
$cshow :: UnprocessedQueryExecutionId -> String
showsPrec :: Int -> UnprocessedQueryExecutionId -> ShowS
$cshowsPrec :: Int -> UnprocessedQueryExecutionId -> ShowS
Prelude.Show, (forall x.
 UnprocessedQueryExecutionId -> Rep UnprocessedQueryExecutionId x)
-> (forall x.
    Rep UnprocessedQueryExecutionId x -> UnprocessedQueryExecutionId)
-> Generic UnprocessedQueryExecutionId
forall x.
Rep UnprocessedQueryExecutionId x -> UnprocessedQueryExecutionId
forall x.
UnprocessedQueryExecutionId -> Rep UnprocessedQueryExecutionId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UnprocessedQueryExecutionId x -> UnprocessedQueryExecutionId
$cfrom :: forall x.
UnprocessedQueryExecutionId -> Rep UnprocessedQueryExecutionId x
Prelude.Generic)

-- |
-- Create a value of 'UnprocessedQueryExecutionId' 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:
--
-- 'errorCode', 'unprocessedQueryExecutionId_errorCode' - The error code returned when the query execution failed to process, if
-- applicable.
--
-- 'queryExecutionId', 'unprocessedQueryExecutionId_queryExecutionId' - The unique identifier of the query execution.
--
-- 'errorMessage', 'unprocessedQueryExecutionId_errorMessage' - The error message returned when the query execution failed to process,
-- if applicable.
newUnprocessedQueryExecutionId ::
  UnprocessedQueryExecutionId
newUnprocessedQueryExecutionId :: UnprocessedQueryExecutionId
newUnprocessedQueryExecutionId =
  UnprocessedQueryExecutionId' :: Maybe Text
-> Maybe Text -> Maybe Text -> UnprocessedQueryExecutionId
UnprocessedQueryExecutionId'
    { $sel:errorCode:UnprocessedQueryExecutionId' :: Maybe Text
errorCode =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:queryExecutionId:UnprocessedQueryExecutionId' :: Maybe Text
queryExecutionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:UnprocessedQueryExecutionId' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The error code returned when the query execution failed to process, if
-- applicable.
unprocessedQueryExecutionId_errorCode :: Lens.Lens' UnprocessedQueryExecutionId (Prelude.Maybe Prelude.Text)
unprocessedQueryExecutionId_errorCode :: (Maybe Text -> f (Maybe Text))
-> UnprocessedQueryExecutionId -> f UnprocessedQueryExecutionId
unprocessedQueryExecutionId_errorCode = (UnprocessedQueryExecutionId -> Maybe Text)
-> (UnprocessedQueryExecutionId
    -> Maybe Text -> UnprocessedQueryExecutionId)
-> Lens
     UnprocessedQueryExecutionId
     UnprocessedQueryExecutionId
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnprocessedQueryExecutionId' {Maybe Text
errorCode :: Maybe Text
$sel:errorCode:UnprocessedQueryExecutionId' :: UnprocessedQueryExecutionId -> Maybe Text
errorCode} -> Maybe Text
errorCode) (\s :: UnprocessedQueryExecutionId
s@UnprocessedQueryExecutionId' {} Maybe Text
a -> UnprocessedQueryExecutionId
s {$sel:errorCode:UnprocessedQueryExecutionId' :: Maybe Text
errorCode = Maybe Text
a} :: UnprocessedQueryExecutionId)

-- | The unique identifier of the query execution.
unprocessedQueryExecutionId_queryExecutionId :: Lens.Lens' UnprocessedQueryExecutionId (Prelude.Maybe Prelude.Text)
unprocessedQueryExecutionId_queryExecutionId :: (Maybe Text -> f (Maybe Text))
-> UnprocessedQueryExecutionId -> f UnprocessedQueryExecutionId
unprocessedQueryExecutionId_queryExecutionId = (UnprocessedQueryExecutionId -> Maybe Text)
-> (UnprocessedQueryExecutionId
    -> Maybe Text -> UnprocessedQueryExecutionId)
-> Lens
     UnprocessedQueryExecutionId
     UnprocessedQueryExecutionId
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnprocessedQueryExecutionId' {Maybe Text
queryExecutionId :: Maybe Text
$sel:queryExecutionId:UnprocessedQueryExecutionId' :: UnprocessedQueryExecutionId -> Maybe Text
queryExecutionId} -> Maybe Text
queryExecutionId) (\s :: UnprocessedQueryExecutionId
s@UnprocessedQueryExecutionId' {} Maybe Text
a -> UnprocessedQueryExecutionId
s {$sel:queryExecutionId:UnprocessedQueryExecutionId' :: Maybe Text
queryExecutionId = Maybe Text
a} :: UnprocessedQueryExecutionId)

-- | The error message returned when the query execution failed to process,
-- if applicable.
unprocessedQueryExecutionId_errorMessage :: Lens.Lens' UnprocessedQueryExecutionId (Prelude.Maybe Prelude.Text)
unprocessedQueryExecutionId_errorMessage :: (Maybe Text -> f (Maybe Text))
-> UnprocessedQueryExecutionId -> f UnprocessedQueryExecutionId
unprocessedQueryExecutionId_errorMessage = (UnprocessedQueryExecutionId -> Maybe Text)
-> (UnprocessedQueryExecutionId
    -> Maybe Text -> UnprocessedQueryExecutionId)
-> Lens
     UnprocessedQueryExecutionId
     UnprocessedQueryExecutionId
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnprocessedQueryExecutionId' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:UnprocessedQueryExecutionId' :: UnprocessedQueryExecutionId -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: UnprocessedQueryExecutionId
s@UnprocessedQueryExecutionId' {} Maybe Text
a -> UnprocessedQueryExecutionId
s {$sel:errorMessage:UnprocessedQueryExecutionId' :: Maybe Text
errorMessage = Maybe Text
a} :: UnprocessedQueryExecutionId)

instance Core.FromJSON UnprocessedQueryExecutionId where
  parseJSON :: Value -> Parser UnprocessedQueryExecutionId
parseJSON =
    String
-> (Object -> Parser UnprocessedQueryExecutionId)
-> Value
-> Parser UnprocessedQueryExecutionId
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"UnprocessedQueryExecutionId"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> UnprocessedQueryExecutionId
UnprocessedQueryExecutionId'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> UnprocessedQueryExecutionId)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> UnprocessedQueryExecutionId)
forall (f :: * -> *) a b. Functor 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
"ErrorCode")
            Parser (Maybe Text -> Maybe Text -> UnprocessedQueryExecutionId)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> UnprocessedQueryExecutionId)
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 -> UnprocessedQueryExecutionId)
-> Parser (Maybe Text) -> Parser UnprocessedQueryExecutionId
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
"ErrorMessage")
      )

instance Prelude.Hashable UnprocessedQueryExecutionId

instance Prelude.NFData UnprocessedQueryExecutionId