{-# 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 #-}
module Amazonka.Kendra.Types.TableExcerpt where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Kendra.Types.TableRow
import qualified Amazonka.Prelude as Prelude
data TableExcerpt = TableExcerpt'
{
TableExcerpt -> Maybe [TableRow]
rows :: Prelude.Maybe [TableRow],
TableExcerpt -> Maybe Int
totalNumberOfRows :: Prelude.Maybe Prelude.Int
}
deriving (TableExcerpt -> TableExcerpt -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TableExcerpt -> TableExcerpt -> Bool
$c/= :: TableExcerpt -> TableExcerpt -> Bool
== :: TableExcerpt -> TableExcerpt -> Bool
$c== :: TableExcerpt -> TableExcerpt -> Bool
Prelude.Eq, ReadPrec [TableExcerpt]
ReadPrec TableExcerpt
Int -> ReadS TableExcerpt
ReadS [TableExcerpt]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TableExcerpt]
$creadListPrec :: ReadPrec [TableExcerpt]
readPrec :: ReadPrec TableExcerpt
$creadPrec :: ReadPrec TableExcerpt
readList :: ReadS [TableExcerpt]
$creadList :: ReadS [TableExcerpt]
readsPrec :: Int -> ReadS TableExcerpt
$creadsPrec :: Int -> ReadS TableExcerpt
Prelude.Read, Int -> TableExcerpt -> ShowS
[TableExcerpt] -> ShowS
TableExcerpt -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TableExcerpt] -> ShowS
$cshowList :: [TableExcerpt] -> ShowS
show :: TableExcerpt -> String
$cshow :: TableExcerpt -> String
showsPrec :: Int -> TableExcerpt -> ShowS
$cshowsPrec :: Int -> TableExcerpt -> ShowS
Prelude.Show, forall x. Rep TableExcerpt x -> TableExcerpt
forall x. TableExcerpt -> Rep TableExcerpt x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TableExcerpt x -> TableExcerpt
$cfrom :: forall x. TableExcerpt -> Rep TableExcerpt x
Prelude.Generic)
newTableExcerpt ::
TableExcerpt
newTableExcerpt :: TableExcerpt
newTableExcerpt =
TableExcerpt'
{ $sel:rows:TableExcerpt' :: Maybe [TableRow]
rows = forall a. Maybe a
Prelude.Nothing,
$sel:totalNumberOfRows:TableExcerpt' :: Maybe Int
totalNumberOfRows = forall a. Maybe a
Prelude.Nothing
}
tableExcerpt_rows :: Lens.Lens' TableExcerpt (Prelude.Maybe [TableRow])
tableExcerpt_rows :: Lens' TableExcerpt (Maybe [TableRow])
tableExcerpt_rows = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableExcerpt' {Maybe [TableRow]
rows :: Maybe [TableRow]
$sel:rows:TableExcerpt' :: TableExcerpt -> Maybe [TableRow]
rows} -> Maybe [TableRow]
rows) (\s :: TableExcerpt
s@TableExcerpt' {} Maybe [TableRow]
a -> TableExcerpt
s {$sel:rows:TableExcerpt' :: Maybe [TableRow]
rows = Maybe [TableRow]
a} :: TableExcerpt) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
tableExcerpt_totalNumberOfRows :: Lens.Lens' TableExcerpt (Prelude.Maybe Prelude.Int)
tableExcerpt_totalNumberOfRows :: Lens' TableExcerpt (Maybe Int)
tableExcerpt_totalNumberOfRows = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableExcerpt' {Maybe Int
totalNumberOfRows :: Maybe Int
$sel:totalNumberOfRows:TableExcerpt' :: TableExcerpt -> Maybe Int
totalNumberOfRows} -> Maybe Int
totalNumberOfRows) (\s :: TableExcerpt
s@TableExcerpt' {} Maybe Int
a -> TableExcerpt
s {$sel:totalNumberOfRows:TableExcerpt' :: Maybe Int
totalNumberOfRows = Maybe Int
a} :: TableExcerpt)
instance Data.FromJSON TableExcerpt where
parseJSON :: Value -> Parser TableExcerpt
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"TableExcerpt"
( \Object
x ->
Maybe [TableRow] -> Maybe Int -> TableExcerpt
TableExcerpt'
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
"Rows" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"TotalNumberOfRows")
)
instance Prelude.Hashable TableExcerpt where
hashWithSalt :: Int -> TableExcerpt -> Int
hashWithSalt Int
_salt TableExcerpt' {Maybe Int
Maybe [TableRow]
totalNumberOfRows :: Maybe Int
rows :: Maybe [TableRow]
$sel:totalNumberOfRows:TableExcerpt' :: TableExcerpt -> Maybe Int
$sel:rows:TableExcerpt' :: TableExcerpt -> Maybe [TableRow]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [TableRow]
rows
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
totalNumberOfRows
instance Prelude.NFData TableExcerpt where
rnf :: TableExcerpt -> ()
rnf TableExcerpt' {Maybe Int
Maybe [TableRow]
totalNumberOfRows :: Maybe Int
rows :: Maybe [TableRow]
$sel:totalNumberOfRows:TableExcerpt' :: TableExcerpt -> Maybe Int
$sel:rows:TableExcerpt' :: TableExcerpt -> Maybe [TableRow]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [TableRow]
rows
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
totalNumberOfRows