{-# 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.LineChartMarkerStyleSettings
-- 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.LineChartMarkerStyleSettings 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.LineChartMarkerShape
import Amazonka.QuickSight.Types.Visibility

-- | Marker styles options for a line series in @LineChartVisual@.
--
-- /See:/ 'newLineChartMarkerStyleSettings' smart constructor.
data LineChartMarkerStyleSettings = LineChartMarkerStyleSettings'
  { -- | Color of marker in the series.
    LineChartMarkerStyleSettings -> Maybe Text
markerColor :: Prelude.Maybe Prelude.Text,
    -- | Shape option for markers in the series.
    --
    -- -   @CIRCLE@: Show marker as a circle.
    --
    -- -   @TRIANGLE@: Show marker as a triangle.
    --
    -- -   @SQUARE@: Show marker as a square.
    --
    -- -   @DIAMOND@: Show marker as a diamond.
    --
    -- -   @ROUNDED_SQUARE@: Show marker as a rounded square.
    LineChartMarkerStyleSettings -> Maybe LineChartMarkerShape
markerShape :: Prelude.Maybe LineChartMarkerShape,
    -- | Size of marker in the series.
    LineChartMarkerStyleSettings -> Maybe Text
markerSize :: Prelude.Maybe Prelude.Text,
    -- | Configuration option that determines whether to show the markers in the
    -- series.
    LineChartMarkerStyleSettings -> Maybe Visibility
markerVisibility :: Prelude.Maybe Visibility
  }
  deriving (LineChartMarkerStyleSettings
-> LineChartMarkerStyleSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LineChartMarkerStyleSettings
-> LineChartMarkerStyleSettings -> Bool
$c/= :: LineChartMarkerStyleSettings
-> LineChartMarkerStyleSettings -> Bool
== :: LineChartMarkerStyleSettings
-> LineChartMarkerStyleSettings -> Bool
$c== :: LineChartMarkerStyleSettings
-> LineChartMarkerStyleSettings -> Bool
Prelude.Eq, ReadPrec [LineChartMarkerStyleSettings]
ReadPrec LineChartMarkerStyleSettings
Int -> ReadS LineChartMarkerStyleSettings
ReadS [LineChartMarkerStyleSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LineChartMarkerStyleSettings]
$creadListPrec :: ReadPrec [LineChartMarkerStyleSettings]
readPrec :: ReadPrec LineChartMarkerStyleSettings
$creadPrec :: ReadPrec LineChartMarkerStyleSettings
readList :: ReadS [LineChartMarkerStyleSettings]
$creadList :: ReadS [LineChartMarkerStyleSettings]
readsPrec :: Int -> ReadS LineChartMarkerStyleSettings
$creadsPrec :: Int -> ReadS LineChartMarkerStyleSettings
Prelude.Read, Int -> LineChartMarkerStyleSettings -> ShowS
[LineChartMarkerStyleSettings] -> ShowS
LineChartMarkerStyleSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LineChartMarkerStyleSettings] -> ShowS
$cshowList :: [LineChartMarkerStyleSettings] -> ShowS
show :: LineChartMarkerStyleSettings -> String
$cshow :: LineChartMarkerStyleSettings -> String
showsPrec :: Int -> LineChartMarkerStyleSettings -> ShowS
$cshowsPrec :: Int -> LineChartMarkerStyleSettings -> ShowS
Prelude.Show, forall x.
Rep LineChartMarkerStyleSettings x -> LineChartMarkerStyleSettings
forall x.
LineChartMarkerStyleSettings -> Rep LineChartMarkerStyleSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LineChartMarkerStyleSettings x -> LineChartMarkerStyleSettings
$cfrom :: forall x.
LineChartMarkerStyleSettings -> Rep LineChartMarkerStyleSettings x
Prelude.Generic)

-- |
-- Create a value of 'LineChartMarkerStyleSettings' 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:
--
-- 'markerColor', 'lineChartMarkerStyleSettings_markerColor' - Color of marker in the series.
--
-- 'markerShape', 'lineChartMarkerStyleSettings_markerShape' - Shape option for markers in the series.
--
-- -   @CIRCLE@: Show marker as a circle.
--
-- -   @TRIANGLE@: Show marker as a triangle.
--
-- -   @SQUARE@: Show marker as a square.
--
-- -   @DIAMOND@: Show marker as a diamond.
--
-- -   @ROUNDED_SQUARE@: Show marker as a rounded square.
--
-- 'markerSize', 'lineChartMarkerStyleSettings_markerSize' - Size of marker in the series.
--
-- 'markerVisibility', 'lineChartMarkerStyleSettings_markerVisibility' - Configuration option that determines whether to show the markers in the
-- series.
newLineChartMarkerStyleSettings ::
  LineChartMarkerStyleSettings
newLineChartMarkerStyleSettings :: LineChartMarkerStyleSettings
newLineChartMarkerStyleSettings =
  LineChartMarkerStyleSettings'
    { $sel:markerColor:LineChartMarkerStyleSettings' :: Maybe Text
markerColor =
        forall a. Maybe a
Prelude.Nothing,
      $sel:markerShape:LineChartMarkerStyleSettings' :: Maybe LineChartMarkerShape
markerShape = forall a. Maybe a
Prelude.Nothing,
      $sel:markerSize:LineChartMarkerStyleSettings' :: Maybe Text
markerSize = forall a. Maybe a
Prelude.Nothing,
      $sel:markerVisibility:LineChartMarkerStyleSettings' :: Maybe Visibility
markerVisibility = forall a. Maybe a
Prelude.Nothing
    }

-- | Color of marker in the series.
lineChartMarkerStyleSettings_markerColor :: Lens.Lens' LineChartMarkerStyleSettings (Prelude.Maybe Prelude.Text)
lineChartMarkerStyleSettings_markerColor :: Lens' LineChartMarkerStyleSettings (Maybe Text)
lineChartMarkerStyleSettings_markerColor = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LineChartMarkerStyleSettings' {Maybe Text
markerColor :: Maybe Text
$sel:markerColor:LineChartMarkerStyleSettings' :: LineChartMarkerStyleSettings -> Maybe Text
markerColor} -> Maybe Text
markerColor) (\s :: LineChartMarkerStyleSettings
s@LineChartMarkerStyleSettings' {} Maybe Text
a -> LineChartMarkerStyleSettings
s {$sel:markerColor:LineChartMarkerStyleSettings' :: Maybe Text
markerColor = Maybe Text
a} :: LineChartMarkerStyleSettings)

-- | Shape option for markers in the series.
--
-- -   @CIRCLE@: Show marker as a circle.
--
-- -   @TRIANGLE@: Show marker as a triangle.
--
-- -   @SQUARE@: Show marker as a square.
--
-- -   @DIAMOND@: Show marker as a diamond.
--
-- -   @ROUNDED_SQUARE@: Show marker as a rounded square.
lineChartMarkerStyleSettings_markerShape :: Lens.Lens' LineChartMarkerStyleSettings (Prelude.Maybe LineChartMarkerShape)
lineChartMarkerStyleSettings_markerShape :: Lens' LineChartMarkerStyleSettings (Maybe LineChartMarkerShape)
lineChartMarkerStyleSettings_markerShape = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LineChartMarkerStyleSettings' {Maybe LineChartMarkerShape
markerShape :: Maybe LineChartMarkerShape
$sel:markerShape:LineChartMarkerStyleSettings' :: LineChartMarkerStyleSettings -> Maybe LineChartMarkerShape
markerShape} -> Maybe LineChartMarkerShape
markerShape) (\s :: LineChartMarkerStyleSettings
s@LineChartMarkerStyleSettings' {} Maybe LineChartMarkerShape
a -> LineChartMarkerStyleSettings
s {$sel:markerShape:LineChartMarkerStyleSettings' :: Maybe LineChartMarkerShape
markerShape = Maybe LineChartMarkerShape
a} :: LineChartMarkerStyleSettings)

-- | Size of marker in the series.
lineChartMarkerStyleSettings_markerSize :: Lens.Lens' LineChartMarkerStyleSettings (Prelude.Maybe Prelude.Text)
lineChartMarkerStyleSettings_markerSize :: Lens' LineChartMarkerStyleSettings (Maybe Text)
lineChartMarkerStyleSettings_markerSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LineChartMarkerStyleSettings' {Maybe Text
markerSize :: Maybe Text
$sel:markerSize:LineChartMarkerStyleSettings' :: LineChartMarkerStyleSettings -> Maybe Text
markerSize} -> Maybe Text
markerSize) (\s :: LineChartMarkerStyleSettings
s@LineChartMarkerStyleSettings' {} Maybe Text
a -> LineChartMarkerStyleSettings
s {$sel:markerSize:LineChartMarkerStyleSettings' :: Maybe Text
markerSize = Maybe Text
a} :: LineChartMarkerStyleSettings)

-- | Configuration option that determines whether to show the markers in the
-- series.
lineChartMarkerStyleSettings_markerVisibility :: Lens.Lens' LineChartMarkerStyleSettings (Prelude.Maybe Visibility)
lineChartMarkerStyleSettings_markerVisibility :: Lens' LineChartMarkerStyleSettings (Maybe Visibility)
lineChartMarkerStyleSettings_markerVisibility = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LineChartMarkerStyleSettings' {Maybe Visibility
markerVisibility :: Maybe Visibility
$sel:markerVisibility:LineChartMarkerStyleSettings' :: LineChartMarkerStyleSettings -> Maybe Visibility
markerVisibility} -> Maybe Visibility
markerVisibility) (\s :: LineChartMarkerStyleSettings
s@LineChartMarkerStyleSettings' {} Maybe Visibility
a -> LineChartMarkerStyleSettings
s {$sel:markerVisibility:LineChartMarkerStyleSettings' :: Maybe Visibility
markerVisibility = Maybe Visibility
a} :: LineChartMarkerStyleSettings)

instance Data.FromJSON LineChartMarkerStyleSettings where
  parseJSON :: Value -> Parser LineChartMarkerStyleSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LineChartMarkerStyleSettings"
      ( \Object
x ->
          Maybe Text
-> Maybe LineChartMarkerShape
-> Maybe Text
-> Maybe Visibility
-> LineChartMarkerStyleSettings
LineChartMarkerStyleSettings'
            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
"MarkerColor")
            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
"MarkerShape")
            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
"MarkerSize")
            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
"MarkerVisibility")
      )

instance
  Prelude.Hashable
    LineChartMarkerStyleSettings
  where
  hashWithSalt :: Int -> LineChartMarkerStyleSettings -> Int
hashWithSalt Int
_salt LineChartMarkerStyleSettings' {Maybe Text
Maybe LineChartMarkerShape
Maybe Visibility
markerVisibility :: Maybe Visibility
markerSize :: Maybe Text
markerShape :: Maybe LineChartMarkerShape
markerColor :: Maybe Text
$sel:markerVisibility:LineChartMarkerStyleSettings' :: LineChartMarkerStyleSettings -> Maybe Visibility
$sel:markerSize:LineChartMarkerStyleSettings' :: LineChartMarkerStyleSettings -> Maybe Text
$sel:markerShape:LineChartMarkerStyleSettings' :: LineChartMarkerStyleSettings -> Maybe LineChartMarkerShape
$sel:markerColor:LineChartMarkerStyleSettings' :: LineChartMarkerStyleSettings -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
markerColor
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LineChartMarkerShape
markerShape
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
markerSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Visibility
markerVisibility

instance Prelude.NFData LineChartMarkerStyleSettings where
  rnf :: LineChartMarkerStyleSettings -> ()
rnf LineChartMarkerStyleSettings' {Maybe Text
Maybe LineChartMarkerShape
Maybe Visibility
markerVisibility :: Maybe Visibility
markerSize :: Maybe Text
markerShape :: Maybe LineChartMarkerShape
markerColor :: Maybe Text
$sel:markerVisibility:LineChartMarkerStyleSettings' :: LineChartMarkerStyleSettings -> Maybe Visibility
$sel:markerSize:LineChartMarkerStyleSettings' :: LineChartMarkerStyleSettings -> Maybe Text
$sel:markerShape:LineChartMarkerStyleSettings' :: LineChartMarkerStyleSettings -> Maybe LineChartMarkerShape
$sel:markerColor:LineChartMarkerStyleSettings' :: LineChartMarkerStyleSettings -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
markerColor
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LineChartMarkerShape
markerShape
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
markerSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Visibility
markerVisibility

instance Data.ToJSON LineChartMarkerStyleSettings where
  toJSON :: LineChartMarkerStyleSettings -> Value
toJSON LineChartMarkerStyleSettings' {Maybe Text
Maybe LineChartMarkerShape
Maybe Visibility
markerVisibility :: Maybe Visibility
markerSize :: Maybe Text
markerShape :: Maybe LineChartMarkerShape
markerColor :: Maybe Text
$sel:markerVisibility:LineChartMarkerStyleSettings' :: LineChartMarkerStyleSettings -> Maybe Visibility
$sel:markerSize:LineChartMarkerStyleSettings' :: LineChartMarkerStyleSettings -> Maybe Text
$sel:markerShape:LineChartMarkerStyleSettings' :: LineChartMarkerStyleSettings -> Maybe LineChartMarkerShape
$sel:markerColor:LineChartMarkerStyleSettings' :: LineChartMarkerStyleSettings -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MarkerColor" 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
markerColor,
            (Key
"MarkerShape" 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 LineChartMarkerShape
markerShape,
            (Key
"MarkerSize" 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
markerSize,
            (Key
"MarkerVisibility" 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 Visibility
markerVisibility
          ]
      )