{-# 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.Pinpoint.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.Pinpoint.Types.ResultRowValue
import qualified Amazonka.Prelude as Prelude
data ResultRow = ResultRow'
{
ResultRow -> [ResultRowValue]
groupedBys :: [ResultRowValue],
ResultRow -> [ResultRowValue]
values :: [ResultRowValue]
}
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, ReadPrec [ResultRow]
ReadPrec ResultRow
Int -> ReadS ResultRow
ReadS [ResultRow]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResultRow]
$creadListPrec :: ReadPrec [ResultRow]
readPrec :: ReadPrec ResultRow
$creadPrec :: ReadPrec ResultRow
readList :: ReadS [ResultRow]
$creadList :: ReadS [ResultRow]
readsPrec :: Int -> ReadS ResultRow
$creadsPrec :: Int -> ReadS ResultRow
Prelude.Read, 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:groupedBys:ResultRow' :: [ResultRowValue]
groupedBys = forall a. Monoid a => a
Prelude.mempty,
$sel:values:ResultRow' :: [ResultRowValue]
values = forall a. Monoid a => a
Prelude.mempty
}
resultRow_groupedBys :: Lens.Lens' ResultRow [ResultRowValue]
resultRow_groupedBys :: Lens' ResultRow [ResultRowValue]
resultRow_groupedBys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResultRow' {[ResultRowValue]
groupedBys :: [ResultRowValue]
$sel:groupedBys:ResultRow' :: ResultRow -> [ResultRowValue]
groupedBys} -> [ResultRowValue]
groupedBys) (\s :: ResultRow
s@ResultRow' {} [ResultRowValue]
a -> ResultRow
s {$sel:groupedBys:ResultRow' :: [ResultRowValue]
groupedBys = [ResultRowValue]
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
resultRow_values :: Lens.Lens' ResultRow [ResultRowValue]
resultRow_values :: Lens' ResultRow [ResultRowValue]
resultRow_values = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResultRow' {[ResultRowValue]
values :: [ResultRowValue]
$sel:values:ResultRow' :: ResultRow -> [ResultRowValue]
values} -> [ResultRowValue]
values) (\s :: ResultRow
s@ResultRow' {} [ResultRowValue]
a -> ResultRow
s {$sel:values:ResultRow' :: [ResultRowValue]
values = [ResultRowValue]
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 ->
[ResultRowValue] -> [ResultRowValue] -> 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
"GroupedBys" 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
"Values" 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' {[ResultRowValue]
values :: [ResultRowValue]
groupedBys :: [ResultRowValue]
$sel:values:ResultRow' :: ResultRow -> [ResultRowValue]
$sel:groupedBys:ResultRow' :: ResultRow -> [ResultRowValue]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [ResultRowValue]
groupedBys
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [ResultRowValue]
values
instance Prelude.NFData ResultRow where
rnf :: ResultRow -> ()
rnf ResultRow' {[ResultRowValue]
values :: [ResultRowValue]
groupedBys :: [ResultRowValue]
$sel:values:ResultRow' :: ResultRow -> [ResultRowValue]
$sel:groupedBys:ResultRow' :: ResultRow -> [ResultRowValue]
..} =
forall a. NFData a => a -> ()
Prelude.rnf [ResultRowValue]
groupedBys
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [ResultRowValue]
values