{-# 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.QuickSight.Types.Sheet where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Sheet = Sheet'
{
Sheet -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Sheet -> Maybe Text
sheetId :: Prelude.Maybe Prelude.Text
}
deriving (Sheet -> Sheet -> Bool
(Sheet -> Sheet -> Bool) -> (Sheet -> Sheet -> Bool) -> Eq Sheet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Sheet -> Sheet -> Bool
$c/= :: Sheet -> Sheet -> Bool
== :: Sheet -> Sheet -> Bool
$c== :: Sheet -> Sheet -> Bool
Prelude.Eq, ReadPrec [Sheet]
ReadPrec Sheet
Int -> ReadS Sheet
ReadS [Sheet]
(Int -> ReadS Sheet)
-> ReadS [Sheet]
-> ReadPrec Sheet
-> ReadPrec [Sheet]
-> Read Sheet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Sheet]
$creadListPrec :: ReadPrec [Sheet]
readPrec :: ReadPrec Sheet
$creadPrec :: ReadPrec Sheet
readList :: ReadS [Sheet]
$creadList :: ReadS [Sheet]
readsPrec :: Int -> ReadS Sheet
$creadsPrec :: Int -> ReadS Sheet
Prelude.Read, Int -> Sheet -> ShowS
[Sheet] -> ShowS
Sheet -> String
(Int -> Sheet -> ShowS)
-> (Sheet -> String) -> ([Sheet] -> ShowS) -> Show Sheet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Sheet] -> ShowS
$cshowList :: [Sheet] -> ShowS
show :: Sheet -> String
$cshow :: Sheet -> String
showsPrec :: Int -> Sheet -> ShowS
$cshowsPrec :: Int -> Sheet -> ShowS
Prelude.Show, (forall x. Sheet -> Rep Sheet x)
-> (forall x. Rep Sheet x -> Sheet) -> Generic Sheet
forall x. Rep Sheet x -> Sheet
forall x. Sheet -> Rep Sheet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Sheet x -> Sheet
$cfrom :: forall x. Sheet -> Rep Sheet x
Prelude.Generic)
newSheet ::
Sheet
newSheet :: Sheet
newSheet =
Sheet' :: Maybe Text -> Maybe Text -> Sheet
Sheet'
{ $sel:name:Sheet' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sheetId:Sheet' :: Maybe Text
sheetId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
sheet_name :: Lens.Lens' Sheet (Prelude.Maybe Prelude.Text)
sheet_name :: (Maybe Text -> f (Maybe Text)) -> Sheet -> f Sheet
sheet_name = (Sheet -> Maybe Text)
-> (Sheet -> Maybe Text -> Sheet)
-> Lens Sheet Sheet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Sheet' {Maybe Text
name :: Maybe Text
$sel:name:Sheet' :: Sheet -> Maybe Text
name} -> Maybe Text
name) (\s :: Sheet
s@Sheet' {} Maybe Text
a -> Sheet
s {$sel:name:Sheet' :: Maybe Text
name = Maybe Text
a} :: Sheet)
sheet_sheetId :: Lens.Lens' Sheet (Prelude.Maybe Prelude.Text)
sheet_sheetId :: (Maybe Text -> f (Maybe Text)) -> Sheet -> f Sheet
sheet_sheetId = (Sheet -> Maybe Text)
-> (Sheet -> Maybe Text -> Sheet)
-> Lens Sheet Sheet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Sheet' {Maybe Text
sheetId :: Maybe Text
$sel:sheetId:Sheet' :: Sheet -> Maybe Text
sheetId} -> Maybe Text
sheetId) (\s :: Sheet
s@Sheet' {} Maybe Text
a -> Sheet
s {$sel:sheetId:Sheet' :: Maybe Text
sheetId = Maybe Text
a} :: Sheet)
instance Core.FromJSON Sheet where
parseJSON :: Value -> Parser Sheet
parseJSON =
String -> (Object -> Parser Sheet) -> Value -> Parser Sheet
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Sheet"
( \Object
x ->
Maybe Text -> Maybe Text -> Sheet
Sheet'
(Maybe Text -> Maybe Text -> Sheet)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Sheet)
forall (f :: * -> *) a b. Functor 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
"Name")
Parser (Maybe Text -> Sheet) -> Parser (Maybe Text) -> Parser Sheet
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
"SheetId")
)
instance Prelude.Hashable Sheet
instance Prelude.NFData Sheet