{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.QuickSight.Types.QueueInfo where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
    { $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 :: Lens' QueueInfo Text
queueInfo_waitingOnIngestion = 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 :: Lens' QueueInfo Text
queueInfo_queuedIngestion = 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 Data.FromJSON QueueInfo where
  parseJSON :: Value -> Parser QueueInfo
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"QueueInfo"
      ( \Object
x ->
          Text -> Text -> QueueInfo
QueueInfo'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"WaitingOnIngestion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"QueuedIngestion")
      )

instance Prelude.Hashable QueueInfo where
  hashWithSalt :: Int -> QueueInfo -> Int
hashWithSalt Int
_salt QueueInfo' {Text
queuedIngestion :: Text
waitingOnIngestion :: Text
$sel:queuedIngestion:QueueInfo' :: QueueInfo -> Text
$sel:waitingOnIngestion:QueueInfo' :: QueueInfo -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
waitingOnIngestion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
queuedIngestion

instance Prelude.NFData QueueInfo where
  rnf :: QueueInfo -> ()
rnf QueueInfo' {Text
queuedIngestion :: Text
waitingOnIngestion :: Text
$sel:queuedIngestion:QueueInfo' :: QueueInfo -> Text
$sel:waitingOnIngestion:QueueInfo' :: QueueInfo -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
waitingOnIngestion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
queuedIngestion