{-# 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.EmptyVisual where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types.VisualCustomAction
data EmptyVisual = EmptyVisual'
{
EmptyVisual -> Maybe [VisualCustomAction]
actions :: Prelude.Maybe [VisualCustomAction],
EmptyVisual -> Text
visualId :: Prelude.Text,
EmptyVisual -> Text
dataSetIdentifier :: Prelude.Text
}
deriving (EmptyVisual -> EmptyVisual -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EmptyVisual -> EmptyVisual -> Bool
$c/= :: EmptyVisual -> EmptyVisual -> Bool
== :: EmptyVisual -> EmptyVisual -> Bool
$c== :: EmptyVisual -> EmptyVisual -> Bool
Prelude.Eq, Int -> EmptyVisual -> ShowS
[EmptyVisual] -> ShowS
EmptyVisual -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EmptyVisual] -> ShowS
$cshowList :: [EmptyVisual] -> ShowS
show :: EmptyVisual -> String
$cshow :: EmptyVisual -> String
showsPrec :: Int -> EmptyVisual -> ShowS
$cshowsPrec :: Int -> EmptyVisual -> ShowS
Prelude.Show, forall x. Rep EmptyVisual x -> EmptyVisual
forall x. EmptyVisual -> Rep EmptyVisual x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EmptyVisual x -> EmptyVisual
$cfrom :: forall x. EmptyVisual -> Rep EmptyVisual x
Prelude.Generic)
newEmptyVisual ::
Prelude.Text ->
Prelude.Text ->
EmptyVisual
newEmptyVisual :: Text -> Text -> EmptyVisual
newEmptyVisual Text
pVisualId_ Text
pDataSetIdentifier_ =
EmptyVisual'
{ $sel:actions:EmptyVisual' :: Maybe [VisualCustomAction]
actions = forall a. Maybe a
Prelude.Nothing,
$sel:visualId:EmptyVisual' :: Text
visualId = Text
pVisualId_,
$sel:dataSetIdentifier:EmptyVisual' :: Text
dataSetIdentifier = Text
pDataSetIdentifier_
}
emptyVisual_actions :: Lens.Lens' EmptyVisual (Prelude.Maybe [VisualCustomAction])
emptyVisual_actions :: Lens' EmptyVisual (Maybe [VisualCustomAction])
emptyVisual_actions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmptyVisual' {Maybe [VisualCustomAction]
actions :: Maybe [VisualCustomAction]
$sel:actions:EmptyVisual' :: EmptyVisual -> Maybe [VisualCustomAction]
actions} -> Maybe [VisualCustomAction]
actions) (\s :: EmptyVisual
s@EmptyVisual' {} Maybe [VisualCustomAction]
a -> EmptyVisual
s {$sel:actions:EmptyVisual' :: Maybe [VisualCustomAction]
actions = Maybe [VisualCustomAction]
a} :: EmptyVisual) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
emptyVisual_visualId :: Lens.Lens' EmptyVisual Prelude.Text
emptyVisual_visualId :: Lens' EmptyVisual Text
emptyVisual_visualId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmptyVisual' {Text
visualId :: Text
$sel:visualId:EmptyVisual' :: EmptyVisual -> Text
visualId} -> Text
visualId) (\s :: EmptyVisual
s@EmptyVisual' {} Text
a -> EmptyVisual
s {$sel:visualId:EmptyVisual' :: Text
visualId = Text
a} :: EmptyVisual)
emptyVisual_dataSetIdentifier :: Lens.Lens' EmptyVisual Prelude.Text
emptyVisual_dataSetIdentifier :: Lens' EmptyVisual Text
emptyVisual_dataSetIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmptyVisual' {Text
dataSetIdentifier :: Text
$sel:dataSetIdentifier:EmptyVisual' :: EmptyVisual -> Text
dataSetIdentifier} -> Text
dataSetIdentifier) (\s :: EmptyVisual
s@EmptyVisual' {} Text
a -> EmptyVisual
s {$sel:dataSetIdentifier:EmptyVisual' :: Text
dataSetIdentifier = Text
a} :: EmptyVisual)
instance Data.FromJSON EmptyVisual where
parseJSON :: Value -> Parser EmptyVisual
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EmptyVisual"
( \Object
x ->
Maybe [VisualCustomAction] -> Text -> Text -> EmptyVisual
EmptyVisual'
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
"Actions" 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 a
Data..: Key
"VisualId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"DataSetIdentifier")
)
instance Prelude.Hashable EmptyVisual where
hashWithSalt :: Int -> EmptyVisual -> Int
hashWithSalt Int
_salt EmptyVisual' {Maybe [VisualCustomAction]
Text
dataSetIdentifier :: Text
visualId :: Text
actions :: Maybe [VisualCustomAction]
$sel:dataSetIdentifier:EmptyVisual' :: EmptyVisual -> Text
$sel:visualId:EmptyVisual' :: EmptyVisual -> Text
$sel:actions:EmptyVisual' :: EmptyVisual -> Maybe [VisualCustomAction]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [VisualCustomAction]
actions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
visualId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
dataSetIdentifier
instance Prelude.NFData EmptyVisual where
rnf :: EmptyVisual -> ()
rnf EmptyVisual' {Maybe [VisualCustomAction]
Text
dataSetIdentifier :: Text
visualId :: Text
actions :: Maybe [VisualCustomAction]
$sel:dataSetIdentifier:EmptyVisual' :: EmptyVisual -> Text
$sel:visualId:EmptyVisual' :: EmptyVisual -> Text
$sel:actions:EmptyVisual' :: EmptyVisual -> Maybe [VisualCustomAction]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [VisualCustomAction]
actions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
visualId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
dataSetIdentifier
instance Data.ToJSON EmptyVisual where
toJSON :: EmptyVisual -> Value
toJSON EmptyVisual' {Maybe [VisualCustomAction]
Text
dataSetIdentifier :: Text
visualId :: Text
actions :: Maybe [VisualCustomAction]
$sel:dataSetIdentifier:EmptyVisual' :: EmptyVisual -> Text
$sel:visualId:EmptyVisual' :: EmptyVisual -> Text
$sel:actions:EmptyVisual' :: EmptyVisual -> Maybe [VisualCustomAction]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Actions" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [VisualCustomAction]
actions,
forall a. a -> Maybe a
Prelude.Just (Key
"VisualId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
visualId),
forall a. a -> Maybe a
Prelude.Just
(Key
"DataSetIdentifier" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
dataSetIdentifier)
]
)