{-# 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.HoneyCode.Types.ResultRow where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.HoneyCode.Types.DataItem
import qualified Amazonka.Prelude as Prelude
data ResultRow = ResultRow'
{
ResultRow -> Maybe Text
rowId :: Prelude.Maybe Prelude.Text,
ResultRow -> [Sensitive DataItem]
dataItems :: [Data.Sensitive DataItem]
}
deriving (ResultRow -> ResultRow -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResultRow -> ResultRow -> Bool
$c/= :: ResultRow -> ResultRow -> Bool
== :: ResultRow -> ResultRow -> Bool
$c== :: ResultRow -> ResultRow -> Bool
Prelude.Eq, Int -> ResultRow -> ShowS
[ResultRow] -> ShowS
ResultRow -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResultRow] -> ShowS
$cshowList :: [ResultRow] -> ShowS
show :: ResultRow -> String
$cshow :: ResultRow -> String
showsPrec :: Int -> ResultRow -> ShowS
$cshowsPrec :: Int -> ResultRow -> ShowS
Prelude.Show, forall x. Rep ResultRow x -> ResultRow
forall x. ResultRow -> Rep ResultRow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResultRow x -> ResultRow
$cfrom :: forall x. ResultRow -> Rep ResultRow x
Prelude.Generic)
newResultRow ::
ResultRow
newResultRow :: ResultRow
newResultRow =
ResultRow'
{ $sel:rowId:ResultRow' :: Maybe Text
rowId = forall a. Maybe a
Prelude.Nothing,
$sel:dataItems:ResultRow' :: [Sensitive DataItem]
dataItems = forall a. Monoid a => a
Prelude.mempty
}
resultRow_rowId :: Lens.Lens' ResultRow (Prelude.Maybe Prelude.Text)
resultRow_rowId :: Lens' ResultRow (Maybe Text)
resultRow_rowId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResultRow' {Maybe Text
rowId :: Maybe Text
$sel:rowId:ResultRow' :: ResultRow -> Maybe Text
rowId} -> Maybe Text
rowId) (\s :: ResultRow
s@ResultRow' {} Maybe Text
a -> ResultRow
s {$sel:rowId:ResultRow' :: Maybe Text
rowId = Maybe Text
a} :: ResultRow)
resultRow_dataItems :: Lens.Lens' ResultRow [DataItem]
resultRow_dataItems :: Lens' ResultRow [DataItem]
resultRow_dataItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResultRow' {[Sensitive DataItem]
dataItems :: [Sensitive DataItem]
$sel:dataItems:ResultRow' :: ResultRow -> [Sensitive DataItem]
dataItems} -> [Sensitive DataItem]
dataItems) (\s :: ResultRow
s@ResultRow' {} [Sensitive DataItem]
a -> ResultRow
s {$sel:dataItems:ResultRow' :: [Sensitive DataItem]
dataItems = [Sensitive DataItem]
a} :: ResultRow) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON ResultRow where
parseJSON :: Value -> Parser ResultRow
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ResultRow"
( \Object
x ->
Maybe Text -> [Sensitive DataItem] -> ResultRow
ResultRow'
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
"rowId")
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
"dataItems" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ResultRow where
hashWithSalt :: Int -> ResultRow -> Int
hashWithSalt Int
_salt ResultRow' {[Sensitive DataItem]
Maybe Text
dataItems :: [Sensitive DataItem]
rowId :: Maybe Text
$sel:dataItems:ResultRow' :: ResultRow -> [Sensitive DataItem]
$sel:rowId:ResultRow' :: ResultRow -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
rowId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Sensitive DataItem]
dataItems
instance Prelude.NFData ResultRow where
rnf :: ResultRow -> ()
rnf ResultRow' {[Sensitive DataItem]
Maybe Text
dataItems :: [Sensitive DataItem]
rowId :: Maybe Text
$sel:dataItems:ResultRow' :: ResultRow -> [Sensitive DataItem]
$sel:rowId:ResultRow' :: ResultRow -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
rowId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Sensitive DataItem]
dataItems