{-# 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.TableRow where
import qualified Amazonka.Core as Core
import Amazonka.HoneyCode.Types.Cell
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TableRow = TableRow'
{
TableRow -> Text
rowId :: Prelude.Text,
TableRow -> [Sensitive Cell]
cells :: [Core.Sensitive Cell]
}
deriving (TableRow -> TableRow -> Bool
(TableRow -> TableRow -> Bool)
-> (TableRow -> TableRow -> Bool) -> Eq TableRow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TableRow -> TableRow -> Bool
$c/= :: TableRow -> TableRow -> Bool
== :: TableRow -> TableRow -> Bool
$c== :: TableRow -> TableRow -> Bool
Prelude.Eq, Int -> TableRow -> ShowS
[TableRow] -> ShowS
TableRow -> String
(Int -> TableRow -> ShowS)
-> (TableRow -> String) -> ([TableRow] -> ShowS) -> Show TableRow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TableRow] -> ShowS
$cshowList :: [TableRow] -> ShowS
show :: TableRow -> String
$cshow :: TableRow -> String
showsPrec :: Int -> TableRow -> ShowS
$cshowsPrec :: Int -> TableRow -> ShowS
Prelude.Show, (forall x. TableRow -> Rep TableRow x)
-> (forall x. Rep TableRow x -> TableRow) -> Generic TableRow
forall x. Rep TableRow x -> TableRow
forall x. TableRow -> Rep TableRow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TableRow x -> TableRow
$cfrom :: forall x. TableRow -> Rep TableRow x
Prelude.Generic)
newTableRow ::
Prelude.Text ->
TableRow
newTableRow :: Text -> TableRow
newTableRow Text
pRowId_ =
TableRow' :: Text -> [Sensitive Cell] -> TableRow
TableRow' {$sel:rowId:TableRow' :: Text
rowId = Text
pRowId_, $sel:cells:TableRow' :: [Sensitive Cell]
cells = [Sensitive Cell]
forall a. Monoid a => a
Prelude.mempty}
tableRow_rowId :: Lens.Lens' TableRow Prelude.Text
tableRow_rowId :: (Text -> f Text) -> TableRow -> f TableRow
tableRow_rowId = (TableRow -> Text)
-> (TableRow -> Text -> TableRow)
-> Lens TableRow TableRow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableRow' {Text
rowId :: Text
$sel:rowId:TableRow' :: TableRow -> Text
rowId} -> Text
rowId) (\s :: TableRow
s@TableRow' {} Text
a -> TableRow
s {$sel:rowId:TableRow' :: Text
rowId = Text
a} :: TableRow)
tableRow_cells :: Lens.Lens' TableRow [Cell]
tableRow_cells :: ([Cell] -> f [Cell]) -> TableRow -> f TableRow
tableRow_cells = (TableRow -> [Sensitive Cell])
-> (TableRow -> [Sensitive Cell] -> TableRow)
-> Lens TableRow TableRow [Sensitive Cell] [Sensitive Cell]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableRow' {[Sensitive Cell]
cells :: [Sensitive Cell]
$sel:cells:TableRow' :: TableRow -> [Sensitive Cell]
cells} -> [Sensitive Cell]
cells) (\s :: TableRow
s@TableRow' {} [Sensitive Cell]
a -> TableRow
s {$sel:cells:TableRow' :: [Sensitive Cell]
cells = [Sensitive Cell]
a} :: TableRow) (([Sensitive Cell] -> f [Sensitive Cell])
-> TableRow -> f TableRow)
-> (([Cell] -> f [Cell]) -> [Sensitive Cell] -> f [Sensitive Cell])
-> ([Cell] -> f [Cell])
-> TableRow
-> f TableRow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Cell] -> f [Cell]) -> [Sensitive Cell] -> f [Sensitive Cell]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON TableRow where
parseJSON :: Value -> Parser TableRow
parseJSON =
String -> (Object -> Parser TableRow) -> Value -> Parser TableRow
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TableRow"
( \Object
x ->
Text -> [Sensitive Cell] -> TableRow
TableRow'
(Text -> [Sensitive Cell] -> TableRow)
-> Parser Text -> Parser ([Sensitive Cell] -> TableRow)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"rowId")
Parser ([Sensitive Cell] -> TableRow)
-> Parser [Sensitive Cell] -> Parser TableRow
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [Sensitive Cell])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cells" Parser (Maybe [Sensitive Cell])
-> [Sensitive Cell] -> Parser [Sensitive Cell]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Sensitive Cell]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable TableRow
instance Prelude.NFData TableRow