module Stratosphere.QuickSight.Analysis.VisualPaletteProperty (
        module Exports, VisualPaletteProperty(..), mkVisualPaletteProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.QuickSight.Analysis.DataPathColorProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data VisualPaletteProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-analysis-visualpalette.html>
    VisualPaletteProperty {VisualPaletteProperty -> ()
haddock_workaround_ :: (),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-analysis-visualpalette.html#cfn-quicksight-analysis-visualpalette-chartcolor>
                           VisualPaletteProperty -> Maybe (Value Text)
chartColor :: (Prelude.Maybe (Value Prelude.Text)),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-analysis-visualpalette.html#cfn-quicksight-analysis-visualpalette-colormap>
                           VisualPaletteProperty -> Maybe [DataPathColorProperty]
colorMap :: (Prelude.Maybe [DataPathColorProperty])}
  deriving stock (VisualPaletteProperty -> VisualPaletteProperty -> Bool
(VisualPaletteProperty -> VisualPaletteProperty -> Bool)
-> (VisualPaletteProperty -> VisualPaletteProperty -> Bool)
-> Eq VisualPaletteProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: VisualPaletteProperty -> VisualPaletteProperty -> Bool
== :: VisualPaletteProperty -> VisualPaletteProperty -> Bool
$c/= :: VisualPaletteProperty -> VisualPaletteProperty -> Bool
/= :: VisualPaletteProperty -> VisualPaletteProperty -> Bool
Prelude.Eq, Int -> VisualPaletteProperty -> ShowS
[VisualPaletteProperty] -> ShowS
VisualPaletteProperty -> String
(Int -> VisualPaletteProperty -> ShowS)
-> (VisualPaletteProperty -> String)
-> ([VisualPaletteProperty] -> ShowS)
-> Show VisualPaletteProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> VisualPaletteProperty -> ShowS
showsPrec :: Int -> VisualPaletteProperty -> ShowS
$cshow :: VisualPaletteProperty -> String
show :: VisualPaletteProperty -> String
$cshowList :: [VisualPaletteProperty] -> ShowS
showList :: [VisualPaletteProperty] -> ShowS
Prelude.Show)
mkVisualPaletteProperty :: VisualPaletteProperty
mkVisualPaletteProperty :: VisualPaletteProperty
mkVisualPaletteProperty
  = VisualPaletteProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), chartColor :: Maybe (Value Text)
chartColor = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       colorMap :: Maybe [DataPathColorProperty]
colorMap = Maybe [DataPathColorProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties VisualPaletteProperty where
  toResourceProperties :: VisualPaletteProperty -> ResourceProperties
toResourceProperties VisualPaletteProperty {Maybe [DataPathColorProperty]
Maybe (Value Text)
()
haddock_workaround_ :: VisualPaletteProperty -> ()
chartColor :: VisualPaletteProperty -> Maybe (Value Text)
colorMap :: VisualPaletteProperty -> Maybe [DataPathColorProperty]
haddock_workaround_ :: ()
chartColor :: Maybe (Value Text)
colorMap :: Maybe [DataPathColorProperty]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::QuickSight::Analysis.VisualPalette",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                           [Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"ChartColor" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
chartColor,
                            Key -> [DataPathColorProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"ColorMap" ([DataPathColorProperty] -> (Key, Value))
-> Maybe [DataPathColorProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DataPathColorProperty]
colorMap])}
instance JSON.ToJSON VisualPaletteProperty where
  toJSON :: VisualPaletteProperty -> Value
toJSON VisualPaletteProperty {Maybe [DataPathColorProperty]
Maybe (Value Text)
()
haddock_workaround_ :: VisualPaletteProperty -> ()
chartColor :: VisualPaletteProperty -> Maybe (Value Text)
colorMap :: VisualPaletteProperty -> Maybe [DataPathColorProperty]
haddock_workaround_ :: ()
chartColor :: Maybe (Value Text)
colorMap :: Maybe [DataPathColorProperty]
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
              [Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"ChartColor" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
chartColor,
               Key -> [DataPathColorProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"ColorMap" ([DataPathColorProperty] -> (Key, Value))
-> Maybe [DataPathColorProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DataPathColorProperty]
colorMap]))
instance Property "ChartColor" VisualPaletteProperty where
  type PropertyType "ChartColor" VisualPaletteProperty = Value Prelude.Text
  set :: PropertyType "ChartColor" VisualPaletteProperty
-> VisualPaletteProperty -> VisualPaletteProperty
set PropertyType "ChartColor" VisualPaletteProperty
newValue VisualPaletteProperty {Maybe [DataPathColorProperty]
Maybe (Value Text)
()
haddock_workaround_ :: VisualPaletteProperty -> ()
chartColor :: VisualPaletteProperty -> Maybe (Value Text)
colorMap :: VisualPaletteProperty -> Maybe [DataPathColorProperty]
haddock_workaround_ :: ()
chartColor :: Maybe (Value Text)
colorMap :: Maybe [DataPathColorProperty]
..}
    = VisualPaletteProperty {chartColor :: Maybe (Value Text)
chartColor = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ChartColor" VisualPaletteProperty
Value Text
newValue, Maybe [DataPathColorProperty]
()
haddock_workaround_ :: ()
colorMap :: Maybe [DataPathColorProperty]
haddock_workaround_ :: ()
colorMap :: Maybe [DataPathColorProperty]
..}
instance Property "ColorMap" VisualPaletteProperty where
  type PropertyType "ColorMap" VisualPaletteProperty = [DataPathColorProperty]
  set :: PropertyType "ColorMap" VisualPaletteProperty
-> VisualPaletteProperty -> VisualPaletteProperty
set PropertyType "ColorMap" VisualPaletteProperty
newValue VisualPaletteProperty {Maybe [DataPathColorProperty]
Maybe (Value Text)
()
haddock_workaround_ :: VisualPaletteProperty -> ()
chartColor :: VisualPaletteProperty -> Maybe (Value Text)
colorMap :: VisualPaletteProperty -> Maybe [DataPathColorProperty]
haddock_workaround_ :: ()
chartColor :: Maybe (Value Text)
colorMap :: Maybe [DataPathColorProperty]
..}
    = VisualPaletteProperty {colorMap :: Maybe [DataPathColorProperty]
colorMap = [DataPathColorProperty] -> Maybe [DataPathColorProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [DataPathColorProperty]
PropertyType "ColorMap" VisualPaletteProperty
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
chartColor :: Maybe (Value Text)
haddock_workaround_ :: ()
chartColor :: Maybe (Value Text)
..}