{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.QuickSight.Types.FilledMapConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.QuickSight.Types.FilledMapConfiguration 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.FilledMapFieldWells
import Amazonka.QuickSight.Types.FilledMapSortConfiguration
import Amazonka.QuickSight.Types.GeospatialMapStyleOptions
import Amazonka.QuickSight.Types.GeospatialWindowOptions
import Amazonka.QuickSight.Types.LegendOptions
import Amazonka.QuickSight.Types.TooltipOptions

-- | The configuration for a @FilledMapVisual@.
--
-- /See:/ 'newFilledMapConfiguration' smart constructor.
data FilledMapConfiguration = FilledMapConfiguration'
  { -- | The field wells of the visual.
    FilledMapConfiguration -> Maybe FilledMapFieldWells
fieldWells :: Prelude.Maybe FilledMapFieldWells,
    -- | The legend display setup of the visual.
    FilledMapConfiguration -> Maybe LegendOptions
legend :: Prelude.Maybe LegendOptions,
    -- | The map style options of the filled map visual.
    FilledMapConfiguration -> Maybe GeospatialMapStyleOptions
mapStyleOptions :: Prelude.Maybe GeospatialMapStyleOptions,
    -- | The sort configuration of a @FilledMapVisual@.
    FilledMapConfiguration -> Maybe FilledMapSortConfiguration
sortConfiguration :: Prelude.Maybe FilledMapSortConfiguration,
    -- | The tooltip display setup of the visual.
    FilledMapConfiguration -> Maybe TooltipOptions
tooltip :: Prelude.Maybe TooltipOptions,
    -- | The window options of the filled map visual.
    FilledMapConfiguration -> Maybe GeospatialWindowOptions
windowOptions :: Prelude.Maybe GeospatialWindowOptions
  }
  deriving (FilledMapConfiguration -> FilledMapConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FilledMapConfiguration -> FilledMapConfiguration -> Bool
$c/= :: FilledMapConfiguration -> FilledMapConfiguration -> Bool
== :: FilledMapConfiguration -> FilledMapConfiguration -> Bool
$c== :: FilledMapConfiguration -> FilledMapConfiguration -> Bool
Prelude.Eq, Int -> FilledMapConfiguration -> ShowS
[FilledMapConfiguration] -> ShowS
FilledMapConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FilledMapConfiguration] -> ShowS
$cshowList :: [FilledMapConfiguration] -> ShowS
show :: FilledMapConfiguration -> String
$cshow :: FilledMapConfiguration -> String
showsPrec :: Int -> FilledMapConfiguration -> ShowS
$cshowsPrec :: Int -> FilledMapConfiguration -> ShowS
Prelude.Show, forall x. Rep FilledMapConfiguration x -> FilledMapConfiguration
forall x. FilledMapConfiguration -> Rep FilledMapConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FilledMapConfiguration x -> FilledMapConfiguration
$cfrom :: forall x. FilledMapConfiguration -> Rep FilledMapConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'FilledMapConfiguration' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'fieldWells', 'filledMapConfiguration_fieldWells' - The field wells of the visual.
--
-- 'legend', 'filledMapConfiguration_legend' - The legend display setup of the visual.
--
-- 'mapStyleOptions', 'filledMapConfiguration_mapStyleOptions' - The map style options of the filled map visual.
--
-- 'sortConfiguration', 'filledMapConfiguration_sortConfiguration' - The sort configuration of a @FilledMapVisual@.
--
-- 'tooltip', 'filledMapConfiguration_tooltip' - The tooltip display setup of the visual.
--
-- 'windowOptions', 'filledMapConfiguration_windowOptions' - The window options of the filled map visual.
newFilledMapConfiguration ::
  FilledMapConfiguration
newFilledMapConfiguration :: FilledMapConfiguration
newFilledMapConfiguration =
  FilledMapConfiguration'
    { $sel:fieldWells:FilledMapConfiguration' :: Maybe FilledMapFieldWells
fieldWells =
        forall a. Maybe a
Prelude.Nothing,
      $sel:legend:FilledMapConfiguration' :: Maybe LegendOptions
legend = forall a. Maybe a
Prelude.Nothing,
      $sel:mapStyleOptions:FilledMapConfiguration' :: Maybe GeospatialMapStyleOptions
mapStyleOptions = forall a. Maybe a
Prelude.Nothing,
      $sel:sortConfiguration:FilledMapConfiguration' :: Maybe FilledMapSortConfiguration
sortConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:tooltip:FilledMapConfiguration' :: Maybe TooltipOptions
tooltip = forall a. Maybe a
Prelude.Nothing,
      $sel:windowOptions:FilledMapConfiguration' :: Maybe GeospatialWindowOptions
windowOptions = forall a. Maybe a
Prelude.Nothing
    }

-- | The field wells of the visual.
filledMapConfiguration_fieldWells :: Lens.Lens' FilledMapConfiguration (Prelude.Maybe FilledMapFieldWells)
filledMapConfiguration_fieldWells :: Lens' FilledMapConfiguration (Maybe FilledMapFieldWells)
filledMapConfiguration_fieldWells = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilledMapConfiguration' {Maybe FilledMapFieldWells
fieldWells :: Maybe FilledMapFieldWells
$sel:fieldWells:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe FilledMapFieldWells
fieldWells} -> Maybe FilledMapFieldWells
fieldWells) (\s :: FilledMapConfiguration
s@FilledMapConfiguration' {} Maybe FilledMapFieldWells
a -> FilledMapConfiguration
s {$sel:fieldWells:FilledMapConfiguration' :: Maybe FilledMapFieldWells
fieldWells = Maybe FilledMapFieldWells
a} :: FilledMapConfiguration)

-- | The legend display setup of the visual.
filledMapConfiguration_legend :: Lens.Lens' FilledMapConfiguration (Prelude.Maybe LegendOptions)
filledMapConfiguration_legend :: Lens' FilledMapConfiguration (Maybe LegendOptions)
filledMapConfiguration_legend = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilledMapConfiguration' {Maybe LegendOptions
legend :: Maybe LegendOptions
$sel:legend:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe LegendOptions
legend} -> Maybe LegendOptions
legend) (\s :: FilledMapConfiguration
s@FilledMapConfiguration' {} Maybe LegendOptions
a -> FilledMapConfiguration
s {$sel:legend:FilledMapConfiguration' :: Maybe LegendOptions
legend = Maybe LegendOptions
a} :: FilledMapConfiguration)

-- | The map style options of the filled map visual.
filledMapConfiguration_mapStyleOptions :: Lens.Lens' FilledMapConfiguration (Prelude.Maybe GeospatialMapStyleOptions)
filledMapConfiguration_mapStyleOptions :: Lens' FilledMapConfiguration (Maybe GeospatialMapStyleOptions)
filledMapConfiguration_mapStyleOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilledMapConfiguration' {Maybe GeospatialMapStyleOptions
mapStyleOptions :: Maybe GeospatialMapStyleOptions
$sel:mapStyleOptions:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe GeospatialMapStyleOptions
mapStyleOptions} -> Maybe GeospatialMapStyleOptions
mapStyleOptions) (\s :: FilledMapConfiguration
s@FilledMapConfiguration' {} Maybe GeospatialMapStyleOptions
a -> FilledMapConfiguration
s {$sel:mapStyleOptions:FilledMapConfiguration' :: Maybe GeospatialMapStyleOptions
mapStyleOptions = Maybe GeospatialMapStyleOptions
a} :: FilledMapConfiguration)

-- | The sort configuration of a @FilledMapVisual@.
filledMapConfiguration_sortConfiguration :: Lens.Lens' FilledMapConfiguration (Prelude.Maybe FilledMapSortConfiguration)
filledMapConfiguration_sortConfiguration :: Lens' FilledMapConfiguration (Maybe FilledMapSortConfiguration)
filledMapConfiguration_sortConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilledMapConfiguration' {Maybe FilledMapSortConfiguration
sortConfiguration :: Maybe FilledMapSortConfiguration
$sel:sortConfiguration:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe FilledMapSortConfiguration
sortConfiguration} -> Maybe FilledMapSortConfiguration
sortConfiguration) (\s :: FilledMapConfiguration
s@FilledMapConfiguration' {} Maybe FilledMapSortConfiguration
a -> FilledMapConfiguration
s {$sel:sortConfiguration:FilledMapConfiguration' :: Maybe FilledMapSortConfiguration
sortConfiguration = Maybe FilledMapSortConfiguration
a} :: FilledMapConfiguration)

-- | The tooltip display setup of the visual.
filledMapConfiguration_tooltip :: Lens.Lens' FilledMapConfiguration (Prelude.Maybe TooltipOptions)
filledMapConfiguration_tooltip :: Lens' FilledMapConfiguration (Maybe TooltipOptions)
filledMapConfiguration_tooltip = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilledMapConfiguration' {Maybe TooltipOptions
tooltip :: Maybe TooltipOptions
$sel:tooltip:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe TooltipOptions
tooltip} -> Maybe TooltipOptions
tooltip) (\s :: FilledMapConfiguration
s@FilledMapConfiguration' {} Maybe TooltipOptions
a -> FilledMapConfiguration
s {$sel:tooltip:FilledMapConfiguration' :: Maybe TooltipOptions
tooltip = Maybe TooltipOptions
a} :: FilledMapConfiguration)

-- | The window options of the filled map visual.
filledMapConfiguration_windowOptions :: Lens.Lens' FilledMapConfiguration (Prelude.Maybe GeospatialWindowOptions)
filledMapConfiguration_windowOptions :: Lens' FilledMapConfiguration (Maybe GeospatialWindowOptions)
filledMapConfiguration_windowOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilledMapConfiguration' {Maybe GeospatialWindowOptions
windowOptions :: Maybe GeospatialWindowOptions
$sel:windowOptions:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe GeospatialWindowOptions
windowOptions} -> Maybe GeospatialWindowOptions
windowOptions) (\s :: FilledMapConfiguration
s@FilledMapConfiguration' {} Maybe GeospatialWindowOptions
a -> FilledMapConfiguration
s {$sel:windowOptions:FilledMapConfiguration' :: Maybe GeospatialWindowOptions
windowOptions = Maybe GeospatialWindowOptions
a} :: FilledMapConfiguration)

instance Data.FromJSON FilledMapConfiguration where
  parseJSON :: Value -> Parser FilledMapConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"FilledMapConfiguration"
      ( \Object
x ->
          Maybe FilledMapFieldWells
-> Maybe LegendOptions
-> Maybe GeospatialMapStyleOptions
-> Maybe FilledMapSortConfiguration
-> Maybe TooltipOptions
-> Maybe GeospatialWindowOptions
-> FilledMapConfiguration
FilledMapConfiguration'
            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
"FieldWells")
            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
"Legend")
            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
"MapStyleOptions")
            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
"SortConfiguration")
            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
"Tooltip")
            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
"WindowOptions")
      )

instance Prelude.Hashable FilledMapConfiguration where
  hashWithSalt :: Int -> FilledMapConfiguration -> Int
hashWithSalt Int
_salt FilledMapConfiguration' {Maybe GeospatialMapStyleOptions
Maybe GeospatialWindowOptions
Maybe FilledMapSortConfiguration
Maybe FilledMapFieldWells
Maybe LegendOptions
Maybe TooltipOptions
windowOptions :: Maybe GeospatialWindowOptions
tooltip :: Maybe TooltipOptions
sortConfiguration :: Maybe FilledMapSortConfiguration
mapStyleOptions :: Maybe GeospatialMapStyleOptions
legend :: Maybe LegendOptions
fieldWells :: Maybe FilledMapFieldWells
$sel:windowOptions:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe GeospatialWindowOptions
$sel:tooltip:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe TooltipOptions
$sel:sortConfiguration:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe FilledMapSortConfiguration
$sel:mapStyleOptions:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe GeospatialMapStyleOptions
$sel:legend:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe LegendOptions
$sel:fieldWells:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe FilledMapFieldWells
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FilledMapFieldWells
fieldWells
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LegendOptions
legend
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GeospatialMapStyleOptions
mapStyleOptions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FilledMapSortConfiguration
sortConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TooltipOptions
tooltip
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GeospatialWindowOptions
windowOptions

instance Prelude.NFData FilledMapConfiguration where
  rnf :: FilledMapConfiguration -> ()
rnf FilledMapConfiguration' {Maybe GeospatialMapStyleOptions
Maybe GeospatialWindowOptions
Maybe FilledMapSortConfiguration
Maybe FilledMapFieldWells
Maybe LegendOptions
Maybe TooltipOptions
windowOptions :: Maybe GeospatialWindowOptions
tooltip :: Maybe TooltipOptions
sortConfiguration :: Maybe FilledMapSortConfiguration
mapStyleOptions :: Maybe GeospatialMapStyleOptions
legend :: Maybe LegendOptions
fieldWells :: Maybe FilledMapFieldWells
$sel:windowOptions:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe GeospatialWindowOptions
$sel:tooltip:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe TooltipOptions
$sel:sortConfiguration:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe FilledMapSortConfiguration
$sel:mapStyleOptions:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe GeospatialMapStyleOptions
$sel:legend:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe LegendOptions
$sel:fieldWells:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe FilledMapFieldWells
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe FilledMapFieldWells
fieldWells
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LegendOptions
legend
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe GeospatialMapStyleOptions
mapStyleOptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FilledMapSortConfiguration
sortConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TooltipOptions
tooltip
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe GeospatialWindowOptions
windowOptions

instance Data.ToJSON FilledMapConfiguration where
  toJSON :: FilledMapConfiguration -> Value
toJSON FilledMapConfiguration' {Maybe GeospatialMapStyleOptions
Maybe GeospatialWindowOptions
Maybe FilledMapSortConfiguration
Maybe FilledMapFieldWells
Maybe LegendOptions
Maybe TooltipOptions
windowOptions :: Maybe GeospatialWindowOptions
tooltip :: Maybe TooltipOptions
sortConfiguration :: Maybe FilledMapSortConfiguration
mapStyleOptions :: Maybe GeospatialMapStyleOptions
legend :: Maybe LegendOptions
fieldWells :: Maybe FilledMapFieldWells
$sel:windowOptions:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe GeospatialWindowOptions
$sel:tooltip:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe TooltipOptions
$sel:sortConfiguration:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe FilledMapSortConfiguration
$sel:mapStyleOptions:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe GeospatialMapStyleOptions
$sel:legend:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe LegendOptions
$sel:fieldWells:FilledMapConfiguration' :: FilledMapConfiguration -> Maybe FilledMapFieldWells
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"FieldWells" 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 FilledMapFieldWells
fieldWells,
            (Key
"Legend" 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 LegendOptions
legend,
            (Key
"MapStyleOptions" 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 GeospatialMapStyleOptions
mapStyleOptions,
            (Key
"SortConfiguration" 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 FilledMapSortConfiguration
sortConfiguration,
            (Key
"Tooltip" 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 TooltipOptions
tooltip,
            (Key
"WindowOptions" 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 GeospatialWindowOptions
windowOptions
          ]
      )