{-# 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.GeospatialPointStyleOptions
-- 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.GeospatialPointStyleOptions 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.ClusterMarkerConfiguration
import Amazonka.QuickSight.Types.GeospatialSelectedPointStyle

-- | The point style of the geospatial map.
--
-- /See:/ 'newGeospatialPointStyleOptions' smart constructor.
data GeospatialPointStyleOptions = GeospatialPointStyleOptions'
  { -- | The cluster marker configuration of the geospatial point style.
    GeospatialPointStyleOptions -> Maybe ClusterMarkerConfiguration
clusterMarkerConfiguration :: Prelude.Maybe ClusterMarkerConfiguration,
    -- | The selected point styles (point, cluster) of the geospatial map.
    GeospatialPointStyleOptions -> Maybe GeospatialSelectedPointStyle
selectedPointStyle :: Prelude.Maybe GeospatialSelectedPointStyle
  }
  deriving (GeospatialPointStyleOptions -> GeospatialPointStyleOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GeospatialPointStyleOptions -> GeospatialPointStyleOptions -> Bool
$c/= :: GeospatialPointStyleOptions -> GeospatialPointStyleOptions -> Bool
== :: GeospatialPointStyleOptions -> GeospatialPointStyleOptions -> Bool
$c== :: GeospatialPointStyleOptions -> GeospatialPointStyleOptions -> Bool
Prelude.Eq, ReadPrec [GeospatialPointStyleOptions]
ReadPrec GeospatialPointStyleOptions
Int -> ReadS GeospatialPointStyleOptions
ReadS [GeospatialPointStyleOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GeospatialPointStyleOptions]
$creadListPrec :: ReadPrec [GeospatialPointStyleOptions]
readPrec :: ReadPrec GeospatialPointStyleOptions
$creadPrec :: ReadPrec GeospatialPointStyleOptions
readList :: ReadS [GeospatialPointStyleOptions]
$creadList :: ReadS [GeospatialPointStyleOptions]
readsPrec :: Int -> ReadS GeospatialPointStyleOptions
$creadsPrec :: Int -> ReadS GeospatialPointStyleOptions
Prelude.Read, Int -> GeospatialPointStyleOptions -> ShowS
[GeospatialPointStyleOptions] -> ShowS
GeospatialPointStyleOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GeospatialPointStyleOptions] -> ShowS
$cshowList :: [GeospatialPointStyleOptions] -> ShowS
show :: GeospatialPointStyleOptions -> String
$cshow :: GeospatialPointStyleOptions -> String
showsPrec :: Int -> GeospatialPointStyleOptions -> ShowS
$cshowsPrec :: Int -> GeospatialPointStyleOptions -> ShowS
Prelude.Show, forall x.
Rep GeospatialPointStyleOptions x -> GeospatialPointStyleOptions
forall x.
GeospatialPointStyleOptions -> Rep GeospatialPointStyleOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GeospatialPointStyleOptions x -> GeospatialPointStyleOptions
$cfrom :: forall x.
GeospatialPointStyleOptions -> Rep GeospatialPointStyleOptions x
Prelude.Generic)

-- |
-- Create a value of 'GeospatialPointStyleOptions' 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:
--
-- 'clusterMarkerConfiguration', 'geospatialPointStyleOptions_clusterMarkerConfiguration' - The cluster marker configuration of the geospatial point style.
--
-- 'selectedPointStyle', 'geospatialPointStyleOptions_selectedPointStyle' - The selected point styles (point, cluster) of the geospatial map.
newGeospatialPointStyleOptions ::
  GeospatialPointStyleOptions
newGeospatialPointStyleOptions :: GeospatialPointStyleOptions
newGeospatialPointStyleOptions =
  GeospatialPointStyleOptions'
    { $sel:clusterMarkerConfiguration:GeospatialPointStyleOptions' :: Maybe ClusterMarkerConfiguration
clusterMarkerConfiguration =
        forall a. Maybe a
Prelude.Nothing,
      $sel:selectedPointStyle:GeospatialPointStyleOptions' :: Maybe GeospatialSelectedPointStyle
selectedPointStyle = forall a. Maybe a
Prelude.Nothing
    }

-- | The cluster marker configuration of the geospatial point style.
geospatialPointStyleOptions_clusterMarkerConfiguration :: Lens.Lens' GeospatialPointStyleOptions (Prelude.Maybe ClusterMarkerConfiguration)
geospatialPointStyleOptions_clusterMarkerConfiguration :: Lens'
  GeospatialPointStyleOptions (Maybe ClusterMarkerConfiguration)
geospatialPointStyleOptions_clusterMarkerConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GeospatialPointStyleOptions' {Maybe ClusterMarkerConfiguration
clusterMarkerConfiguration :: Maybe ClusterMarkerConfiguration
$sel:clusterMarkerConfiguration:GeospatialPointStyleOptions' :: GeospatialPointStyleOptions -> Maybe ClusterMarkerConfiguration
clusterMarkerConfiguration} -> Maybe ClusterMarkerConfiguration
clusterMarkerConfiguration) (\s :: GeospatialPointStyleOptions
s@GeospatialPointStyleOptions' {} Maybe ClusterMarkerConfiguration
a -> GeospatialPointStyleOptions
s {$sel:clusterMarkerConfiguration:GeospatialPointStyleOptions' :: Maybe ClusterMarkerConfiguration
clusterMarkerConfiguration = Maybe ClusterMarkerConfiguration
a} :: GeospatialPointStyleOptions)

-- | The selected point styles (point, cluster) of the geospatial map.
geospatialPointStyleOptions_selectedPointStyle :: Lens.Lens' GeospatialPointStyleOptions (Prelude.Maybe GeospatialSelectedPointStyle)
geospatialPointStyleOptions_selectedPointStyle :: Lens'
  GeospatialPointStyleOptions (Maybe GeospatialSelectedPointStyle)
geospatialPointStyleOptions_selectedPointStyle = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GeospatialPointStyleOptions' {Maybe GeospatialSelectedPointStyle
selectedPointStyle :: Maybe GeospatialSelectedPointStyle
$sel:selectedPointStyle:GeospatialPointStyleOptions' :: GeospatialPointStyleOptions -> Maybe GeospatialSelectedPointStyle
selectedPointStyle} -> Maybe GeospatialSelectedPointStyle
selectedPointStyle) (\s :: GeospatialPointStyleOptions
s@GeospatialPointStyleOptions' {} Maybe GeospatialSelectedPointStyle
a -> GeospatialPointStyleOptions
s {$sel:selectedPointStyle:GeospatialPointStyleOptions' :: Maybe GeospatialSelectedPointStyle
selectedPointStyle = Maybe GeospatialSelectedPointStyle
a} :: GeospatialPointStyleOptions)

instance Data.FromJSON GeospatialPointStyleOptions where
  parseJSON :: Value -> Parser GeospatialPointStyleOptions
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"GeospatialPointStyleOptions"
      ( \Object
x ->
          Maybe ClusterMarkerConfiguration
-> Maybe GeospatialSelectedPointStyle
-> GeospatialPointStyleOptions
GeospatialPointStyleOptions'
            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
"ClusterMarkerConfiguration")
            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
"SelectedPointStyle")
      )

instance Prelude.Hashable GeospatialPointStyleOptions where
  hashWithSalt :: Int -> GeospatialPointStyleOptions -> Int
hashWithSalt Int
_salt GeospatialPointStyleOptions' {Maybe GeospatialSelectedPointStyle
Maybe ClusterMarkerConfiguration
selectedPointStyle :: Maybe GeospatialSelectedPointStyle
clusterMarkerConfiguration :: Maybe ClusterMarkerConfiguration
$sel:selectedPointStyle:GeospatialPointStyleOptions' :: GeospatialPointStyleOptions -> Maybe GeospatialSelectedPointStyle
$sel:clusterMarkerConfiguration:GeospatialPointStyleOptions' :: GeospatialPointStyleOptions -> Maybe ClusterMarkerConfiguration
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ClusterMarkerConfiguration
clusterMarkerConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GeospatialSelectedPointStyle
selectedPointStyle

instance Prelude.NFData GeospatialPointStyleOptions where
  rnf :: GeospatialPointStyleOptions -> ()
rnf GeospatialPointStyleOptions' {Maybe GeospatialSelectedPointStyle
Maybe ClusterMarkerConfiguration
selectedPointStyle :: Maybe GeospatialSelectedPointStyle
clusterMarkerConfiguration :: Maybe ClusterMarkerConfiguration
$sel:selectedPointStyle:GeospatialPointStyleOptions' :: GeospatialPointStyleOptions -> Maybe GeospatialSelectedPointStyle
$sel:clusterMarkerConfiguration:GeospatialPointStyleOptions' :: GeospatialPointStyleOptions -> Maybe ClusterMarkerConfiguration
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ClusterMarkerConfiguration
clusterMarkerConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe GeospatialSelectedPointStyle
selectedPointStyle

instance Data.ToJSON GeospatialPointStyleOptions where
  toJSON :: GeospatialPointStyleOptions -> Value
toJSON GeospatialPointStyleOptions' {Maybe GeospatialSelectedPointStyle
Maybe ClusterMarkerConfiguration
selectedPointStyle :: Maybe GeospatialSelectedPointStyle
clusterMarkerConfiguration :: Maybe ClusterMarkerConfiguration
$sel:selectedPointStyle:GeospatialPointStyleOptions' :: GeospatialPointStyleOptions -> Maybe GeospatialSelectedPointStyle
$sel:clusterMarkerConfiguration:GeospatialPointStyleOptions' :: GeospatialPointStyleOptions -> Maybe ClusterMarkerConfiguration
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ClusterMarkerConfiguration" 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 ClusterMarkerConfiguration
clusterMarkerConfiguration,
            (Key
"SelectedPointStyle" 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 GeospatialSelectedPointStyle
selectedPointStyle
          ]
      )