{-# 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.Lens as Lens
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
(ResultRow -> ResultRow -> Bool)
-> (ResultRow -> ResultRow -> Bool) -> Eq ResultRow
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]
(Int -> ReadS ResultRow)
-> ReadS [ResultRow]
-> ReadPrec ResultRow
-> ReadPrec [ResultRow]
-> Read 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
(Int -> ResultRow -> ShowS)
-> (ResultRow -> String)
-> ([ResultRow] -> ShowS)
-> Show ResultRow
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. ResultRow -> Rep ResultRow x)
-> (forall x. Rep ResultRow x -> ResultRow) -> Generic ResultRow
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' :: [ResultRowValue] -> [ResultRowValue] -> ResultRow
ResultRow'
{ $sel:groupedBys:ResultRow' :: [ResultRowValue]
groupedBys = [ResultRowValue]
forall a. Monoid a => a
Prelude.mempty,
$sel:values:ResultRow' :: [ResultRowValue]
values = [ResultRowValue]
forall a. Monoid a => a
Prelude.mempty
}
resultRow_groupedBys :: Lens.Lens' ResultRow [ResultRowValue]
resultRow_groupedBys :: ([ResultRowValue] -> f [ResultRowValue])
-> ResultRow -> f ResultRow
resultRow_groupedBys = (ResultRow -> [ResultRowValue])
-> (ResultRow -> [ResultRowValue] -> ResultRow)
-> Lens ResultRow ResultRow [ResultRowValue] [ResultRowValue]
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) (([ResultRowValue] -> f [ResultRowValue])
-> ResultRow -> f ResultRow)
-> (([ResultRowValue] -> f [ResultRowValue])
-> [ResultRowValue] -> f [ResultRowValue])
-> ([ResultRowValue] -> f [ResultRowValue])
-> ResultRow
-> f ResultRow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ResultRowValue] -> f [ResultRowValue])
-> [ResultRowValue] -> f [ResultRowValue]
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 :: ([ResultRowValue] -> f [ResultRowValue])
-> ResultRow -> f ResultRow
resultRow_values = (ResultRow -> [ResultRowValue])
-> (ResultRow -> [ResultRowValue] -> ResultRow)
-> Lens ResultRow ResultRow [ResultRowValue] [ResultRowValue]
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) (([ResultRowValue] -> f [ResultRowValue])
-> ResultRow -> f ResultRow)
-> (([ResultRowValue] -> f [ResultRowValue])
-> [ResultRowValue] -> f [ResultRowValue])
-> ([ResultRowValue] -> f [ResultRowValue])
-> ResultRow
-> f ResultRow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ResultRowValue] -> f [ResultRowValue])
-> [ResultRowValue] -> f [ResultRowValue]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON ResultRow where
parseJSON :: Value -> Parser ResultRow
parseJSON =
String -> (Object -> Parser ResultRow) -> Value -> Parser ResultRow
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ResultRow"
( \Object
x ->
[ResultRowValue] -> [ResultRowValue] -> ResultRow
ResultRow'
([ResultRowValue] -> [ResultRowValue] -> ResultRow)
-> Parser [ResultRowValue]
-> Parser ([ResultRowValue] -> ResultRow)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe [ResultRowValue])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GroupedBys" Parser (Maybe [ResultRowValue])
-> [ResultRowValue] -> Parser [ResultRowValue]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [ResultRowValue]
forall a. Monoid a => a
Prelude.mempty)
Parser ([ResultRowValue] -> ResultRow)
-> Parser [ResultRowValue] -> Parser ResultRow
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [ResultRowValue])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Values" Parser (Maybe [ResultRowValue])
-> [ResultRowValue] -> Parser [ResultRowValue]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [ResultRowValue]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ResultRow
instance Prelude.NFData ResultRow