{-# 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.CustomContentVisual 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.CustomContentConfiguration
import Amazonka.QuickSight.Types.VisualCustomAction
import Amazonka.QuickSight.Types.VisualSubtitleLabelOptions
import Amazonka.QuickSight.Types.VisualTitleLabelOptions
data CustomContentVisual = CustomContentVisual'
{
CustomContentVisual -> Maybe [VisualCustomAction]
actions :: Prelude.Maybe [VisualCustomAction],
CustomContentVisual -> Maybe CustomContentConfiguration
chartConfiguration :: Prelude.Maybe CustomContentConfiguration,
CustomContentVisual -> Maybe VisualSubtitleLabelOptions
subtitle :: Prelude.Maybe VisualSubtitleLabelOptions,
CustomContentVisual -> Maybe VisualTitleLabelOptions
title :: Prelude.Maybe VisualTitleLabelOptions,
CustomContentVisual -> Text
visualId :: Prelude.Text,
CustomContentVisual -> Text
dataSetIdentifier :: Prelude.Text
}
deriving (CustomContentVisual -> CustomContentVisual -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomContentVisual -> CustomContentVisual -> Bool
$c/= :: CustomContentVisual -> CustomContentVisual -> Bool
== :: CustomContentVisual -> CustomContentVisual -> Bool
$c== :: CustomContentVisual -> CustomContentVisual -> Bool
Prelude.Eq, Int -> CustomContentVisual -> ShowS
[CustomContentVisual] -> ShowS
CustomContentVisual -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomContentVisual] -> ShowS
$cshowList :: [CustomContentVisual] -> ShowS
show :: CustomContentVisual -> String
$cshow :: CustomContentVisual -> String
showsPrec :: Int -> CustomContentVisual -> ShowS
$cshowsPrec :: Int -> CustomContentVisual -> ShowS
Prelude.Show, forall x. Rep CustomContentVisual x -> CustomContentVisual
forall x. CustomContentVisual -> Rep CustomContentVisual x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CustomContentVisual x -> CustomContentVisual
$cfrom :: forall x. CustomContentVisual -> Rep CustomContentVisual x
Prelude.Generic)
newCustomContentVisual ::
Prelude.Text ->
Prelude.Text ->
CustomContentVisual
newCustomContentVisual :: Text -> Text -> CustomContentVisual
newCustomContentVisual Text
pVisualId_ Text
pDataSetIdentifier_ =
CustomContentVisual'
{ $sel:actions:CustomContentVisual' :: Maybe [VisualCustomAction]
actions = forall a. Maybe a
Prelude.Nothing,
$sel:chartConfiguration:CustomContentVisual' :: Maybe CustomContentConfiguration
chartConfiguration = forall a. Maybe a
Prelude.Nothing,
$sel:subtitle:CustomContentVisual' :: Maybe VisualSubtitleLabelOptions
subtitle = forall a. Maybe a
Prelude.Nothing,
$sel:title:CustomContentVisual' :: Maybe VisualTitleLabelOptions
title = forall a. Maybe a
Prelude.Nothing,
$sel:visualId:CustomContentVisual' :: Text
visualId = Text
pVisualId_,
$sel:dataSetIdentifier:CustomContentVisual' :: Text
dataSetIdentifier = Text
pDataSetIdentifier_
}
customContentVisual_actions :: Lens.Lens' CustomContentVisual (Prelude.Maybe [VisualCustomAction])
customContentVisual_actions :: Lens' CustomContentVisual (Maybe [VisualCustomAction])
customContentVisual_actions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomContentVisual' {Maybe [VisualCustomAction]
actions :: Maybe [VisualCustomAction]
$sel:actions:CustomContentVisual' :: CustomContentVisual -> Maybe [VisualCustomAction]
actions} -> Maybe [VisualCustomAction]
actions) (\s :: CustomContentVisual
s@CustomContentVisual' {} Maybe [VisualCustomAction]
a -> CustomContentVisual
s {$sel:actions:CustomContentVisual' :: Maybe [VisualCustomAction]
actions = Maybe [VisualCustomAction]
a} :: CustomContentVisual) 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
customContentVisual_chartConfiguration :: Lens.Lens' CustomContentVisual (Prelude.Maybe CustomContentConfiguration)
customContentVisual_chartConfiguration :: Lens' CustomContentVisual (Maybe CustomContentConfiguration)
customContentVisual_chartConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomContentVisual' {Maybe CustomContentConfiguration
chartConfiguration :: Maybe CustomContentConfiguration
$sel:chartConfiguration:CustomContentVisual' :: CustomContentVisual -> Maybe CustomContentConfiguration
chartConfiguration} -> Maybe CustomContentConfiguration
chartConfiguration) (\s :: CustomContentVisual
s@CustomContentVisual' {} Maybe CustomContentConfiguration
a -> CustomContentVisual
s {$sel:chartConfiguration:CustomContentVisual' :: Maybe CustomContentConfiguration
chartConfiguration = Maybe CustomContentConfiguration
a} :: CustomContentVisual)
customContentVisual_subtitle :: Lens.Lens' CustomContentVisual (Prelude.Maybe VisualSubtitleLabelOptions)
customContentVisual_subtitle :: Lens' CustomContentVisual (Maybe VisualSubtitleLabelOptions)
customContentVisual_subtitle = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomContentVisual' {Maybe VisualSubtitleLabelOptions
subtitle :: Maybe VisualSubtitleLabelOptions
$sel:subtitle:CustomContentVisual' :: CustomContentVisual -> Maybe VisualSubtitleLabelOptions
subtitle} -> Maybe VisualSubtitleLabelOptions
subtitle) (\s :: CustomContentVisual
s@CustomContentVisual' {} Maybe VisualSubtitleLabelOptions
a -> CustomContentVisual
s {$sel:subtitle:CustomContentVisual' :: Maybe VisualSubtitleLabelOptions
subtitle = Maybe VisualSubtitleLabelOptions
a} :: CustomContentVisual)
customContentVisual_title :: Lens.Lens' CustomContentVisual (Prelude.Maybe VisualTitleLabelOptions)
customContentVisual_title :: Lens' CustomContentVisual (Maybe VisualTitleLabelOptions)
customContentVisual_title = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomContentVisual' {Maybe VisualTitleLabelOptions
title :: Maybe VisualTitleLabelOptions
$sel:title:CustomContentVisual' :: CustomContentVisual -> Maybe VisualTitleLabelOptions
title} -> Maybe VisualTitleLabelOptions
title) (\s :: CustomContentVisual
s@CustomContentVisual' {} Maybe VisualTitleLabelOptions
a -> CustomContentVisual
s {$sel:title:CustomContentVisual' :: Maybe VisualTitleLabelOptions
title = Maybe VisualTitleLabelOptions
a} :: CustomContentVisual)
customContentVisual_visualId :: Lens.Lens' CustomContentVisual Prelude.Text
customContentVisual_visualId :: Lens' CustomContentVisual Text
customContentVisual_visualId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomContentVisual' {Text
visualId :: Text
$sel:visualId:CustomContentVisual' :: CustomContentVisual -> Text
visualId} -> Text
visualId) (\s :: CustomContentVisual
s@CustomContentVisual' {} Text
a -> CustomContentVisual
s {$sel:visualId:CustomContentVisual' :: Text
visualId = Text
a} :: CustomContentVisual)
customContentVisual_dataSetIdentifier :: Lens.Lens' CustomContentVisual Prelude.Text
customContentVisual_dataSetIdentifier :: Lens' CustomContentVisual Text
customContentVisual_dataSetIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomContentVisual' {Text
dataSetIdentifier :: Text
$sel:dataSetIdentifier:CustomContentVisual' :: CustomContentVisual -> Text
dataSetIdentifier} -> Text
dataSetIdentifier) (\s :: CustomContentVisual
s@CustomContentVisual' {} Text
a -> CustomContentVisual
s {$sel:dataSetIdentifier:CustomContentVisual' :: Text
dataSetIdentifier = Text
a} :: CustomContentVisual)
instance Data.FromJSON CustomContentVisual where
parseJSON :: Value -> Parser CustomContentVisual
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CustomContentVisual"
( \Object
x ->
Maybe [VisualCustomAction]
-> Maybe CustomContentConfiguration
-> Maybe VisualSubtitleLabelOptions
-> Maybe VisualTitleLabelOptions
-> Text
-> Text
-> CustomContentVisual
CustomContentVisual'
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 (Maybe a)
Data..:? Key
"ChartConfiguration")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Subtitle")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Title")
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 CustomContentVisual where
hashWithSalt :: Int -> CustomContentVisual -> Int
hashWithSalt Int
_salt CustomContentVisual' {Maybe [VisualCustomAction]
Maybe CustomContentConfiguration
Maybe VisualSubtitleLabelOptions
Maybe VisualTitleLabelOptions
Text
dataSetIdentifier :: Text
visualId :: Text
title :: Maybe VisualTitleLabelOptions
subtitle :: Maybe VisualSubtitleLabelOptions
chartConfiguration :: Maybe CustomContentConfiguration
actions :: Maybe [VisualCustomAction]
$sel:dataSetIdentifier:CustomContentVisual' :: CustomContentVisual -> Text
$sel:visualId:CustomContentVisual' :: CustomContentVisual -> Text
$sel:title:CustomContentVisual' :: CustomContentVisual -> Maybe VisualTitleLabelOptions
$sel:subtitle:CustomContentVisual' :: CustomContentVisual -> Maybe VisualSubtitleLabelOptions
$sel:chartConfiguration:CustomContentVisual' :: CustomContentVisual -> Maybe CustomContentConfiguration
$sel:actions:CustomContentVisual' :: CustomContentVisual -> 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` Maybe CustomContentConfiguration
chartConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VisualSubtitleLabelOptions
subtitle
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VisualTitleLabelOptions
title
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 CustomContentVisual where
rnf :: CustomContentVisual -> ()
rnf CustomContentVisual' {Maybe [VisualCustomAction]
Maybe CustomContentConfiguration
Maybe VisualSubtitleLabelOptions
Maybe VisualTitleLabelOptions
Text
dataSetIdentifier :: Text
visualId :: Text
title :: Maybe VisualTitleLabelOptions
subtitle :: Maybe VisualSubtitleLabelOptions
chartConfiguration :: Maybe CustomContentConfiguration
actions :: Maybe [VisualCustomAction]
$sel:dataSetIdentifier:CustomContentVisual' :: CustomContentVisual -> Text
$sel:visualId:CustomContentVisual' :: CustomContentVisual -> Text
$sel:title:CustomContentVisual' :: CustomContentVisual -> Maybe VisualTitleLabelOptions
$sel:subtitle:CustomContentVisual' :: CustomContentVisual -> Maybe VisualSubtitleLabelOptions
$sel:chartConfiguration:CustomContentVisual' :: CustomContentVisual -> Maybe CustomContentConfiguration
$sel:actions:CustomContentVisual' :: CustomContentVisual -> 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 Maybe CustomContentConfiguration
chartConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VisualSubtitleLabelOptions
subtitle
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VisualTitleLabelOptions
title
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 CustomContentVisual where
toJSON :: CustomContentVisual -> Value
toJSON CustomContentVisual' {Maybe [VisualCustomAction]
Maybe CustomContentConfiguration
Maybe VisualSubtitleLabelOptions
Maybe VisualTitleLabelOptions
Text
dataSetIdentifier :: Text
visualId :: Text
title :: Maybe VisualTitleLabelOptions
subtitle :: Maybe VisualSubtitleLabelOptions
chartConfiguration :: Maybe CustomContentConfiguration
actions :: Maybe [VisualCustomAction]
$sel:dataSetIdentifier:CustomContentVisual' :: CustomContentVisual -> Text
$sel:visualId:CustomContentVisual' :: CustomContentVisual -> Text
$sel:title:CustomContentVisual' :: CustomContentVisual -> Maybe VisualTitleLabelOptions
$sel:subtitle:CustomContentVisual' :: CustomContentVisual -> Maybe VisualSubtitleLabelOptions
$sel:chartConfiguration:CustomContentVisual' :: CustomContentVisual -> Maybe CustomContentConfiguration
$sel:actions:CustomContentVisual' :: CustomContentVisual -> 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,
(Key
"ChartConfiguration" 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 CustomContentConfiguration
chartConfiguration,
(Key
"Subtitle" 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 VisualSubtitleLabelOptions
subtitle,
(Key
"Title" 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 VisualTitleLabelOptions
title,
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)
]
)