{-# 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.SecurityHub.Types.Cell where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Cell = Cell'
{
Cell -> Maybe Integer
row :: Prelude.Maybe Prelude.Integer,
Cell -> Maybe Text
cellReference :: Prelude.Maybe Prelude.Text,
Cell -> Maybe Integer
column :: Prelude.Maybe Prelude.Integer,
Cell -> Maybe Text
columnName :: Prelude.Maybe Prelude.Text
}
deriving (Cell -> Cell -> Bool
(Cell -> Cell -> Bool) -> (Cell -> Cell -> Bool) -> Eq Cell
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Cell -> Cell -> Bool
$c/= :: Cell -> Cell -> Bool
== :: Cell -> Cell -> Bool
$c== :: Cell -> Cell -> Bool
Prelude.Eq, ReadPrec [Cell]
ReadPrec Cell
Int -> ReadS Cell
ReadS [Cell]
(Int -> ReadS Cell)
-> ReadS [Cell] -> ReadPrec Cell -> ReadPrec [Cell] -> Read Cell
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Cell]
$creadListPrec :: ReadPrec [Cell]
readPrec :: ReadPrec Cell
$creadPrec :: ReadPrec Cell
readList :: ReadS [Cell]
$creadList :: ReadS [Cell]
readsPrec :: Int -> ReadS Cell
$creadsPrec :: Int -> ReadS Cell
Prelude.Read, Int -> Cell -> ShowS
[Cell] -> ShowS
Cell -> String
(Int -> Cell -> ShowS)
-> (Cell -> String) -> ([Cell] -> ShowS) -> Show Cell
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Cell] -> ShowS
$cshowList :: [Cell] -> ShowS
show :: Cell -> String
$cshow :: Cell -> String
showsPrec :: Int -> Cell -> ShowS
$cshowsPrec :: Int -> Cell -> ShowS
Prelude.Show, (forall x. Cell -> Rep Cell x)
-> (forall x. Rep Cell x -> Cell) -> Generic Cell
forall x. Rep Cell x -> Cell
forall x. Cell -> Rep Cell x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Cell x -> Cell
$cfrom :: forall x. Cell -> Rep Cell x
Prelude.Generic)
newCell ::
Cell
newCell :: Cell
newCell =
Cell' :: Maybe Integer -> Maybe Text -> Maybe Integer -> Maybe Text -> Cell
Cell'
{ $sel:row:Cell' :: Maybe Integer
row = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:cellReference:Cell' :: Maybe Text
cellReference = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:column:Cell' :: Maybe Integer
column = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:columnName:Cell' :: Maybe Text
columnName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
cell_row :: Lens.Lens' Cell (Prelude.Maybe Prelude.Integer)
cell_row :: (Maybe Integer -> f (Maybe Integer)) -> Cell -> f Cell
cell_row = (Cell -> Maybe Integer)
-> (Cell -> Maybe Integer -> Cell)
-> Lens Cell Cell (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cell' {Maybe Integer
row :: Maybe Integer
$sel:row:Cell' :: Cell -> Maybe Integer
row} -> Maybe Integer
row) (\s :: Cell
s@Cell' {} Maybe Integer
a -> Cell
s {$sel:row:Cell' :: Maybe Integer
row = Maybe Integer
a} :: Cell)
cell_cellReference :: Lens.Lens' Cell (Prelude.Maybe Prelude.Text)
cell_cellReference :: (Maybe Text -> f (Maybe Text)) -> Cell -> f Cell
cell_cellReference = (Cell -> Maybe Text)
-> (Cell -> Maybe Text -> Cell)
-> Lens Cell Cell (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cell' {Maybe Text
cellReference :: Maybe Text
$sel:cellReference:Cell' :: Cell -> Maybe Text
cellReference} -> Maybe Text
cellReference) (\s :: Cell
s@Cell' {} Maybe Text
a -> Cell
s {$sel:cellReference:Cell' :: Maybe Text
cellReference = Maybe Text
a} :: Cell)
cell_column :: Lens.Lens' Cell (Prelude.Maybe Prelude.Integer)
cell_column :: (Maybe Integer -> f (Maybe Integer)) -> Cell -> f Cell
cell_column = (Cell -> Maybe Integer)
-> (Cell -> Maybe Integer -> Cell)
-> Lens Cell Cell (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cell' {Maybe Integer
column :: Maybe Integer
$sel:column:Cell' :: Cell -> Maybe Integer
column} -> Maybe Integer
column) (\s :: Cell
s@Cell' {} Maybe Integer
a -> Cell
s {$sel:column:Cell' :: Maybe Integer
column = Maybe Integer
a} :: Cell)
cell_columnName :: Lens.Lens' Cell (Prelude.Maybe Prelude.Text)
cell_columnName :: (Maybe Text -> f (Maybe Text)) -> Cell -> f Cell
cell_columnName = (Cell -> Maybe Text)
-> (Cell -> Maybe Text -> Cell)
-> Lens Cell Cell (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cell' {Maybe Text
columnName :: Maybe Text
$sel:columnName:Cell' :: Cell -> Maybe Text
columnName} -> Maybe Text
columnName) (\s :: Cell
s@Cell' {} Maybe Text
a -> Cell
s {$sel:columnName:Cell' :: Maybe Text
columnName = Maybe Text
a} :: Cell)
instance Core.FromJSON Cell where
parseJSON :: Value -> Parser Cell
parseJSON =
String -> (Object -> Parser Cell) -> Value -> Parser Cell
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Cell"
( \Object
x ->
Maybe Integer -> Maybe Text -> Maybe Integer -> Maybe Text -> Cell
Cell'
(Maybe Integer
-> Maybe Text -> Maybe Integer -> Maybe Text -> Cell)
-> Parser (Maybe Integer)
-> Parser (Maybe Text -> Maybe Integer -> Maybe Text -> Cell)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Row")
Parser (Maybe Text -> Maybe Integer -> Maybe Text -> Cell)
-> Parser (Maybe Text)
-> Parser (Maybe Integer -> Maybe Text -> Cell)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CellReference")
Parser (Maybe Integer -> Maybe Text -> Cell)
-> Parser (Maybe Integer) -> Parser (Maybe Text -> Cell)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Column")
Parser (Maybe Text -> Cell) -> Parser (Maybe Text) -> Parser Cell
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ColumnName")
)
instance Prelude.Hashable Cell
instance Prelude.NFData Cell
instance Core.ToJSON Cell where
toJSON :: Cell -> Value
toJSON Cell' {Maybe Integer
Maybe Text
columnName :: Maybe Text
column :: Maybe Integer
cellReference :: Maybe Text
row :: Maybe Integer
$sel:columnName:Cell' :: Cell -> Maybe Text
$sel:column:Cell' :: Cell -> Maybe Integer
$sel:cellReference:Cell' :: Cell -> Maybe Text
$sel:row:Cell' :: Cell -> Maybe Integer
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Row" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
row,
(Text
"CellReference" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
cellReference,
(Text
"Column" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
column,
(Text
"ColumnName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
columnName
]
)