{-# 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.QuickSight.Types.QueueInfo
-- 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.QuickSight.Types.QueueInfo where

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

-- | Information about a queued dataset SPICE ingestion.
--
-- /See:/ 'newQueueInfo' smart constructor.
data QueueInfo = QueueInfo'
  { -- | The ID of the queued ingestion.
    QueueInfo -> Text
waitingOnIngestion :: Prelude.Text,
    -- | The ID of the ongoing ingestion. The queued ingestion is waiting for the
    -- ongoing ingestion to complete.
    QueueInfo -> Text
queuedIngestion :: Prelude.Text
  }
  deriving (QueueInfo -> QueueInfo -> Bool
(QueueInfo -> QueueInfo -> Bool)
-> (QueueInfo -> QueueInfo -> Bool) -> Eq QueueInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QueueInfo -> QueueInfo -> Bool
$c/= :: QueueInfo -> QueueInfo -> Bool
== :: QueueInfo -> QueueInfo -> Bool
$c== :: QueueInfo -> QueueInfo -> Bool
Prelude.Eq, ReadPrec [QueueInfo]
ReadPrec QueueInfo
Int -> ReadS QueueInfo
ReadS [QueueInfo]
(Int -> ReadS QueueInfo)
-> ReadS [QueueInfo]
-> ReadPrec QueueInfo
-> ReadPrec [QueueInfo]
-> Read QueueInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [QueueInfo]
$creadListPrec :: ReadPrec [QueueInfo]
readPrec :: ReadPrec QueueInfo
$creadPrec :: ReadPrec QueueInfo
readList :: ReadS [QueueInfo]
$creadList :: ReadS [QueueInfo]
readsPrec :: Int -> ReadS QueueInfo
$creadsPrec :: Int -> ReadS QueueInfo
Prelude.Read, Int -> QueueInfo -> ShowS
[QueueInfo] -> ShowS
QueueInfo -> String
(Int -> QueueInfo -> ShowS)
-> (QueueInfo -> String)
-> ([QueueInfo] -> ShowS)
-> Show QueueInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QueueInfo] -> ShowS
$cshowList :: [QueueInfo] -> ShowS
show :: QueueInfo -> String
$cshow :: QueueInfo -> String
showsPrec :: Int -> QueueInfo -> ShowS
$cshowsPrec :: Int -> QueueInfo -> ShowS
Prelude.Show, (forall x. QueueInfo -> Rep QueueInfo x)
-> (forall x. Rep QueueInfo x -> QueueInfo) -> Generic QueueInfo
forall x. Rep QueueInfo x -> QueueInfo
forall x. QueueInfo -> Rep QueueInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep QueueInfo x -> QueueInfo
$cfrom :: forall x. QueueInfo -> Rep QueueInfo x
Prelude.Generic)

-- |
-- Create a value of 'QueueInfo' 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:
--
-- 'waitingOnIngestion', 'queueInfo_waitingOnIngestion' - The ID of the queued ingestion.
--
-- 'queuedIngestion', 'queueInfo_queuedIngestion' - The ID of the ongoing ingestion. The queued ingestion is waiting for the
-- ongoing ingestion to complete.
newQueueInfo ::
  -- | 'waitingOnIngestion'
  Prelude.Text ->
  -- | 'queuedIngestion'
  Prelude.Text ->
  QueueInfo
newQueueInfo :: Text -> Text -> QueueInfo
newQueueInfo Text
pWaitingOnIngestion_ Text
pQueuedIngestion_ =
  QueueInfo' :: Text -> Text -> QueueInfo
QueueInfo'
    { $sel:waitingOnIngestion:QueueInfo' :: Text
waitingOnIngestion =
        Text
pWaitingOnIngestion_,
      $sel:queuedIngestion:QueueInfo' :: Text
queuedIngestion = Text
pQueuedIngestion_
    }

-- | The ID of the queued ingestion.
queueInfo_waitingOnIngestion :: Lens.Lens' QueueInfo Prelude.Text
queueInfo_waitingOnIngestion :: (Text -> f Text) -> QueueInfo -> f QueueInfo
queueInfo_waitingOnIngestion = (QueueInfo -> Text)
-> (QueueInfo -> Text -> QueueInfo)
-> Lens QueueInfo QueueInfo Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueueInfo' {Text
waitingOnIngestion :: Text
$sel:waitingOnIngestion:QueueInfo' :: QueueInfo -> Text
waitingOnIngestion} -> Text
waitingOnIngestion) (\s :: QueueInfo
s@QueueInfo' {} Text
a -> QueueInfo
s {$sel:waitingOnIngestion:QueueInfo' :: Text
waitingOnIngestion = Text
a} :: QueueInfo)

-- | The ID of the ongoing ingestion. The queued ingestion is waiting for the
-- ongoing ingestion to complete.
queueInfo_queuedIngestion :: Lens.Lens' QueueInfo Prelude.Text
queueInfo_queuedIngestion :: (Text -> f Text) -> QueueInfo -> f QueueInfo
queueInfo_queuedIngestion = (QueueInfo -> Text)
-> (QueueInfo -> Text -> QueueInfo)
-> Lens QueueInfo QueueInfo Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueueInfo' {Text
queuedIngestion :: Text
$sel:queuedIngestion:QueueInfo' :: QueueInfo -> Text
queuedIngestion} -> Text
queuedIngestion) (\s :: QueueInfo
s@QueueInfo' {} Text
a -> QueueInfo
s {$sel:queuedIngestion:QueueInfo' :: Text
queuedIngestion = Text
a} :: QueueInfo)

instance Core.FromJSON QueueInfo where
  parseJSON :: Value -> Parser QueueInfo
parseJSON =
    String -> (Object -> Parser QueueInfo) -> Value -> Parser QueueInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"QueueInfo"
      ( \Object
x ->
          Text -> Text -> QueueInfo
QueueInfo'
            (Text -> Text -> QueueInfo)
-> Parser Text -> Parser (Text -> QueueInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"WaitingOnIngestion")
            Parser (Text -> QueueInfo) -> Parser Text -> Parser QueueInfo
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
"QueuedIngestion")
      )

instance Prelude.Hashable QueueInfo

instance Prelude.NFData QueueInfo