{-# 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.DataColorPalette 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
data DataColorPalette = DataColorPalette'
{
DataColorPalette -> Maybe [Text]
colors :: Prelude.Maybe [Prelude.Text],
DataColorPalette -> Maybe Text
emptyFillColor :: Prelude.Maybe Prelude.Text,
DataColorPalette -> Maybe [Text]
minMaxGradient :: Prelude.Maybe [Prelude.Text]
}
deriving (DataColorPalette -> DataColorPalette -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataColorPalette -> DataColorPalette -> Bool
$c/= :: DataColorPalette -> DataColorPalette -> Bool
== :: DataColorPalette -> DataColorPalette -> Bool
$c== :: DataColorPalette -> DataColorPalette -> Bool
Prelude.Eq, ReadPrec [DataColorPalette]
ReadPrec DataColorPalette
Int -> ReadS DataColorPalette
ReadS [DataColorPalette]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataColorPalette]
$creadListPrec :: ReadPrec [DataColorPalette]
readPrec :: ReadPrec DataColorPalette
$creadPrec :: ReadPrec DataColorPalette
readList :: ReadS [DataColorPalette]
$creadList :: ReadS [DataColorPalette]
readsPrec :: Int -> ReadS DataColorPalette
$creadsPrec :: Int -> ReadS DataColorPalette
Prelude.Read, Int -> DataColorPalette -> ShowS
[DataColorPalette] -> ShowS
DataColorPalette -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataColorPalette] -> ShowS
$cshowList :: [DataColorPalette] -> ShowS
show :: DataColorPalette -> String
$cshow :: DataColorPalette -> String
showsPrec :: Int -> DataColorPalette -> ShowS
$cshowsPrec :: Int -> DataColorPalette -> ShowS
Prelude.Show, forall x. Rep DataColorPalette x -> DataColorPalette
forall x. DataColorPalette -> Rep DataColorPalette x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DataColorPalette x -> DataColorPalette
$cfrom :: forall x. DataColorPalette -> Rep DataColorPalette x
Prelude.Generic)
newDataColorPalette ::
DataColorPalette
newDataColorPalette :: DataColorPalette
newDataColorPalette =
DataColorPalette'
{ $sel:colors:DataColorPalette' :: Maybe [Text]
colors = forall a. Maybe a
Prelude.Nothing,
$sel:emptyFillColor:DataColorPalette' :: Maybe Text
emptyFillColor = forall a. Maybe a
Prelude.Nothing,
$sel:minMaxGradient:DataColorPalette' :: Maybe [Text]
minMaxGradient = forall a. Maybe a
Prelude.Nothing
}
dataColorPalette_colors :: Lens.Lens' DataColorPalette (Prelude.Maybe [Prelude.Text])
dataColorPalette_colors :: Lens' DataColorPalette (Maybe [Text])
dataColorPalette_colors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataColorPalette' {Maybe [Text]
colors :: Maybe [Text]
$sel:colors:DataColorPalette' :: DataColorPalette -> Maybe [Text]
colors} -> Maybe [Text]
colors) (\s :: DataColorPalette
s@DataColorPalette' {} Maybe [Text]
a -> DataColorPalette
s {$sel:colors:DataColorPalette' :: Maybe [Text]
colors = Maybe [Text]
a} :: DataColorPalette) 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
dataColorPalette_emptyFillColor :: Lens.Lens' DataColorPalette (Prelude.Maybe Prelude.Text)
dataColorPalette_emptyFillColor :: Lens' DataColorPalette (Maybe Text)
dataColorPalette_emptyFillColor = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataColorPalette' {Maybe Text
emptyFillColor :: Maybe Text
$sel:emptyFillColor:DataColorPalette' :: DataColorPalette -> Maybe Text
emptyFillColor} -> Maybe Text
emptyFillColor) (\s :: DataColorPalette
s@DataColorPalette' {} Maybe Text
a -> DataColorPalette
s {$sel:emptyFillColor:DataColorPalette' :: Maybe Text
emptyFillColor = Maybe Text
a} :: DataColorPalette)
dataColorPalette_minMaxGradient :: Lens.Lens' DataColorPalette (Prelude.Maybe [Prelude.Text])
dataColorPalette_minMaxGradient :: Lens' DataColorPalette (Maybe [Text])
dataColorPalette_minMaxGradient = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataColorPalette' {Maybe [Text]
minMaxGradient :: Maybe [Text]
$sel:minMaxGradient:DataColorPalette' :: DataColorPalette -> Maybe [Text]
minMaxGradient} -> Maybe [Text]
minMaxGradient) (\s :: DataColorPalette
s@DataColorPalette' {} Maybe [Text]
a -> DataColorPalette
s {$sel:minMaxGradient:DataColorPalette' :: Maybe [Text]
minMaxGradient = Maybe [Text]
a} :: DataColorPalette) 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
instance Data.FromJSON DataColorPalette where
parseJSON :: Value -> Parser DataColorPalette
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DataColorPalette"
( \Object
x ->
Maybe [Text] -> Maybe Text -> Maybe [Text] -> DataColorPalette
DataColorPalette'
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
"Colors" 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
"EmptyFillColor")
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
"MinMaxGradient"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable DataColorPalette where
hashWithSalt :: Int -> DataColorPalette -> Int
hashWithSalt Int
_salt DataColorPalette' {Maybe [Text]
Maybe Text
minMaxGradient :: Maybe [Text]
emptyFillColor :: Maybe Text
colors :: Maybe [Text]
$sel:minMaxGradient:DataColorPalette' :: DataColorPalette -> Maybe [Text]
$sel:emptyFillColor:DataColorPalette' :: DataColorPalette -> Maybe Text
$sel:colors:DataColorPalette' :: DataColorPalette -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
colors
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
emptyFillColor
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
minMaxGradient
instance Prelude.NFData DataColorPalette where
rnf :: DataColorPalette -> ()
rnf DataColorPalette' {Maybe [Text]
Maybe Text
minMaxGradient :: Maybe [Text]
emptyFillColor :: Maybe Text
colors :: Maybe [Text]
$sel:minMaxGradient:DataColorPalette' :: DataColorPalette -> Maybe [Text]
$sel:emptyFillColor:DataColorPalette' :: DataColorPalette -> Maybe Text
$sel:colors:DataColorPalette' :: DataColorPalette -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
colors
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
emptyFillColor
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
minMaxGradient
instance Data.ToJSON DataColorPalette where
toJSON :: DataColorPalette -> Value
toJSON DataColorPalette' {Maybe [Text]
Maybe Text
minMaxGradient :: Maybe [Text]
emptyFillColor :: Maybe Text
colors :: Maybe [Text]
$sel:minMaxGradient:DataColorPalette' :: DataColorPalette -> Maybe [Text]
$sel:emptyFillColor:DataColorPalette' :: DataColorPalette -> Maybe Text
$sel:colors:DataColorPalette' :: DataColorPalette -> Maybe [Text]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Colors" 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 [Text]
colors,
(Key
"EmptyFillColor" 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 Text
emptyFillColor,
(Key
"MinMaxGradient" 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 [Text]
minMaxGradient
]
)