{-# 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.RowInfo
-- 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.RowInfo 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 rows for a data set SPICE ingestion.
--
-- /See:/ 'newRowInfo' smart constructor.
data RowInfo = RowInfo'
  { -- | The number of rows that were not ingested.
    RowInfo -> Maybe Integer
rowsDropped :: Prelude.Maybe Prelude.Integer,
    -- | The number of rows that were ingested.
    RowInfo -> Maybe Integer
rowsIngested :: Prelude.Maybe Prelude.Integer,
    -- | The total number of rows in the dataset.
    RowInfo -> Maybe Integer
totalRowsInDataset :: Prelude.Maybe Prelude.Integer
  }
  deriving (RowInfo -> RowInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RowInfo -> RowInfo -> Bool
$c/= :: RowInfo -> RowInfo -> Bool
== :: RowInfo -> RowInfo -> Bool
$c== :: RowInfo -> RowInfo -> Bool
Prelude.Eq, ReadPrec [RowInfo]
ReadPrec RowInfo
Int -> ReadS RowInfo
ReadS [RowInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RowInfo]
$creadListPrec :: ReadPrec [RowInfo]
readPrec :: ReadPrec RowInfo
$creadPrec :: ReadPrec RowInfo
readList :: ReadS [RowInfo]
$creadList :: ReadS [RowInfo]
readsPrec :: Int -> ReadS RowInfo
$creadsPrec :: Int -> ReadS RowInfo
Prelude.Read, Int -> RowInfo -> ShowS
[RowInfo] -> ShowS
RowInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RowInfo] -> ShowS
$cshowList :: [RowInfo] -> ShowS
show :: RowInfo -> String
$cshow :: RowInfo -> String
showsPrec :: Int -> RowInfo -> ShowS
$cshowsPrec :: Int -> RowInfo -> ShowS
Prelude.Show, forall x. Rep RowInfo x -> RowInfo
forall x. RowInfo -> Rep RowInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RowInfo x -> RowInfo
$cfrom :: forall x. RowInfo -> Rep RowInfo x
Prelude.Generic)

-- |
-- Create a value of 'RowInfo' 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:
--
-- 'rowsDropped', 'rowInfo_rowsDropped' - The number of rows that were not ingested.
--
-- 'rowsIngested', 'rowInfo_rowsIngested' - The number of rows that were ingested.
--
-- 'totalRowsInDataset', 'rowInfo_totalRowsInDataset' - The total number of rows in the dataset.
newRowInfo ::
  RowInfo
newRowInfo :: RowInfo
newRowInfo =
  RowInfo'
    { $sel:rowsDropped:RowInfo' :: Maybe Integer
rowsDropped = forall a. Maybe a
Prelude.Nothing,
      $sel:rowsIngested:RowInfo' :: Maybe Integer
rowsIngested = forall a. Maybe a
Prelude.Nothing,
      $sel:totalRowsInDataset:RowInfo' :: Maybe Integer
totalRowsInDataset = forall a. Maybe a
Prelude.Nothing
    }

-- | The number of rows that were not ingested.
rowInfo_rowsDropped :: Lens.Lens' RowInfo (Prelude.Maybe Prelude.Integer)
rowInfo_rowsDropped :: Lens' RowInfo (Maybe Integer)
rowInfo_rowsDropped = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RowInfo' {Maybe Integer
rowsDropped :: Maybe Integer
$sel:rowsDropped:RowInfo' :: RowInfo -> Maybe Integer
rowsDropped} -> Maybe Integer
rowsDropped) (\s :: RowInfo
s@RowInfo' {} Maybe Integer
a -> RowInfo
s {$sel:rowsDropped:RowInfo' :: Maybe Integer
rowsDropped = Maybe Integer
a} :: RowInfo)

-- | The number of rows that were ingested.
rowInfo_rowsIngested :: Lens.Lens' RowInfo (Prelude.Maybe Prelude.Integer)
rowInfo_rowsIngested :: Lens' RowInfo (Maybe Integer)
rowInfo_rowsIngested = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RowInfo' {Maybe Integer
rowsIngested :: Maybe Integer
$sel:rowsIngested:RowInfo' :: RowInfo -> Maybe Integer
rowsIngested} -> Maybe Integer
rowsIngested) (\s :: RowInfo
s@RowInfo' {} Maybe Integer
a -> RowInfo
s {$sel:rowsIngested:RowInfo' :: Maybe Integer
rowsIngested = Maybe Integer
a} :: RowInfo)

-- | The total number of rows in the dataset.
rowInfo_totalRowsInDataset :: Lens.Lens' RowInfo (Prelude.Maybe Prelude.Integer)
rowInfo_totalRowsInDataset :: Lens' RowInfo (Maybe Integer)
rowInfo_totalRowsInDataset = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RowInfo' {Maybe Integer
totalRowsInDataset :: Maybe Integer
$sel:totalRowsInDataset:RowInfo' :: RowInfo -> Maybe Integer
totalRowsInDataset} -> Maybe Integer
totalRowsInDataset) (\s :: RowInfo
s@RowInfo' {} Maybe Integer
a -> RowInfo
s {$sel:totalRowsInDataset:RowInfo' :: Maybe Integer
totalRowsInDataset = Maybe Integer
a} :: RowInfo)

instance Data.FromJSON RowInfo where
  parseJSON :: Value -> Parser RowInfo
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RowInfo"
      ( \Object
x ->
          Maybe Integer -> Maybe Integer -> Maybe Integer -> RowInfo
RowInfo'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RowsDropped")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RowsIngested")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"TotalRowsInDataset")
      )

instance Prelude.Hashable RowInfo where
  hashWithSalt :: Int -> RowInfo -> Int
hashWithSalt Int
_salt RowInfo' {Maybe Integer
totalRowsInDataset :: Maybe Integer
rowsIngested :: Maybe Integer
rowsDropped :: Maybe Integer
$sel:totalRowsInDataset:RowInfo' :: RowInfo -> Maybe Integer
$sel:rowsIngested:RowInfo' :: RowInfo -> Maybe Integer
$sel:rowsDropped:RowInfo' :: RowInfo -> Maybe Integer
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
rowsDropped
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
rowsIngested
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
totalRowsInDataset

instance Prelude.NFData RowInfo where
  rnf :: RowInfo -> ()
rnf RowInfo' {Maybe Integer
totalRowsInDataset :: Maybe Integer
rowsIngested :: Maybe Integer
rowsDropped :: Maybe Integer
$sel:totalRowsInDataset:RowInfo' :: RowInfo -> Maybe Integer
$sel:rowsIngested:RowInfo' :: RowInfo -> Maybe Integer
$sel:rowsDropped:RowInfo' :: RowInfo -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
rowsDropped
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
rowsIngested
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
totalRowsInDataset