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

-- | The options that determine the presentation of a line series in the
-- visual
--
-- /See:/ 'newLineChartSeriesSettings' smart constructor.
data LineChartSeriesSettings = LineChartSeriesSettings'
  { -- | Line styles options for a line series in @LineChartVisual@.
    LineChartSeriesSettings -> Maybe LineChartLineStyleSettings
lineStyleSettings :: Prelude.Maybe LineChartLineStyleSettings,
    -- | Marker styles options for a line series in @LineChartVisual@.
    LineChartSeriesSettings -> Maybe LineChartMarkerStyleSettings
markerStyleSettings :: Prelude.Maybe LineChartMarkerStyleSettings
  }
  deriving (LineChartSeriesSettings -> LineChartSeriesSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LineChartSeriesSettings -> LineChartSeriesSettings -> Bool
$c/= :: LineChartSeriesSettings -> LineChartSeriesSettings -> Bool
== :: LineChartSeriesSettings -> LineChartSeriesSettings -> Bool
$c== :: LineChartSeriesSettings -> LineChartSeriesSettings -> Bool
Prelude.Eq, ReadPrec [LineChartSeriesSettings]
ReadPrec LineChartSeriesSettings
Int -> ReadS LineChartSeriesSettings
ReadS [LineChartSeriesSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LineChartSeriesSettings]
$creadListPrec :: ReadPrec [LineChartSeriesSettings]
readPrec :: ReadPrec LineChartSeriesSettings
$creadPrec :: ReadPrec LineChartSeriesSettings
readList :: ReadS [LineChartSeriesSettings]
$creadList :: ReadS [LineChartSeriesSettings]
readsPrec :: Int -> ReadS LineChartSeriesSettings
$creadsPrec :: Int -> ReadS LineChartSeriesSettings
Prelude.Read, Int -> LineChartSeriesSettings -> ShowS
[LineChartSeriesSettings] -> ShowS
LineChartSeriesSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LineChartSeriesSettings] -> ShowS
$cshowList :: [LineChartSeriesSettings] -> ShowS
show :: LineChartSeriesSettings -> String
$cshow :: LineChartSeriesSettings -> String
showsPrec :: Int -> LineChartSeriesSettings -> ShowS
$cshowsPrec :: Int -> LineChartSeriesSettings -> ShowS
Prelude.Show, forall x. Rep LineChartSeriesSettings x -> LineChartSeriesSettings
forall x. LineChartSeriesSettings -> Rep LineChartSeriesSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LineChartSeriesSettings x -> LineChartSeriesSettings
$cfrom :: forall x. LineChartSeriesSettings -> Rep LineChartSeriesSettings x
Prelude.Generic)

-- |
-- Create a value of 'LineChartSeriesSettings' 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:
--
-- 'lineStyleSettings', 'lineChartSeriesSettings_lineStyleSettings' - Line styles options for a line series in @LineChartVisual@.
--
-- 'markerStyleSettings', 'lineChartSeriesSettings_markerStyleSettings' - Marker styles options for a line series in @LineChartVisual@.
newLineChartSeriesSettings ::
  LineChartSeriesSettings
newLineChartSeriesSettings :: LineChartSeriesSettings
newLineChartSeriesSettings =
  LineChartSeriesSettings'
    { $sel:lineStyleSettings:LineChartSeriesSettings' :: Maybe LineChartLineStyleSettings
lineStyleSettings =
        forall a. Maybe a
Prelude.Nothing,
      $sel:markerStyleSettings:LineChartSeriesSettings' :: Maybe LineChartMarkerStyleSettings
markerStyleSettings = forall a. Maybe a
Prelude.Nothing
    }

-- | Line styles options for a line series in @LineChartVisual@.
lineChartSeriesSettings_lineStyleSettings :: Lens.Lens' LineChartSeriesSettings (Prelude.Maybe LineChartLineStyleSettings)
lineChartSeriesSettings_lineStyleSettings :: Lens' LineChartSeriesSettings (Maybe LineChartLineStyleSettings)
lineChartSeriesSettings_lineStyleSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LineChartSeriesSettings' {Maybe LineChartLineStyleSettings
lineStyleSettings :: Maybe LineChartLineStyleSettings
$sel:lineStyleSettings:LineChartSeriesSettings' :: LineChartSeriesSettings -> Maybe LineChartLineStyleSettings
lineStyleSettings} -> Maybe LineChartLineStyleSettings
lineStyleSettings) (\s :: LineChartSeriesSettings
s@LineChartSeriesSettings' {} Maybe LineChartLineStyleSettings
a -> LineChartSeriesSettings
s {$sel:lineStyleSettings:LineChartSeriesSettings' :: Maybe LineChartLineStyleSettings
lineStyleSettings = Maybe LineChartLineStyleSettings
a} :: LineChartSeriesSettings)

-- | Marker styles options for a line series in @LineChartVisual@.
lineChartSeriesSettings_markerStyleSettings :: Lens.Lens' LineChartSeriesSettings (Prelude.Maybe LineChartMarkerStyleSettings)
lineChartSeriesSettings_markerStyleSettings :: Lens' LineChartSeriesSettings (Maybe LineChartMarkerStyleSettings)
lineChartSeriesSettings_markerStyleSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LineChartSeriesSettings' {Maybe LineChartMarkerStyleSettings
markerStyleSettings :: Maybe LineChartMarkerStyleSettings
$sel:markerStyleSettings:LineChartSeriesSettings' :: LineChartSeriesSettings -> Maybe LineChartMarkerStyleSettings
markerStyleSettings} -> Maybe LineChartMarkerStyleSettings
markerStyleSettings) (\s :: LineChartSeriesSettings
s@LineChartSeriesSettings' {} Maybe LineChartMarkerStyleSettings
a -> LineChartSeriesSettings
s {$sel:markerStyleSettings:LineChartSeriesSettings' :: Maybe LineChartMarkerStyleSettings
markerStyleSettings = Maybe LineChartMarkerStyleSettings
a} :: LineChartSeriesSettings)

instance Data.FromJSON LineChartSeriesSettings where
  parseJSON :: Value -> Parser LineChartSeriesSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LineChartSeriesSettings"
      ( \Object
x ->
          Maybe LineChartLineStyleSettings
-> Maybe LineChartMarkerStyleSettings -> LineChartSeriesSettings
LineChartSeriesSettings'
            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
"LineStyleSettings")
            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
"MarkerStyleSettings")
      )

instance Prelude.Hashable LineChartSeriesSettings where
  hashWithSalt :: Int -> LineChartSeriesSettings -> Int
hashWithSalt Int
_salt LineChartSeriesSettings' {Maybe LineChartMarkerStyleSettings
Maybe LineChartLineStyleSettings
markerStyleSettings :: Maybe LineChartMarkerStyleSettings
lineStyleSettings :: Maybe LineChartLineStyleSettings
$sel:markerStyleSettings:LineChartSeriesSettings' :: LineChartSeriesSettings -> Maybe LineChartMarkerStyleSettings
$sel:lineStyleSettings:LineChartSeriesSettings' :: LineChartSeriesSettings -> Maybe LineChartLineStyleSettings
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LineChartLineStyleSettings
lineStyleSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LineChartMarkerStyleSettings
markerStyleSettings

instance Prelude.NFData LineChartSeriesSettings where
  rnf :: LineChartSeriesSettings -> ()
rnf LineChartSeriesSettings' {Maybe LineChartMarkerStyleSettings
Maybe LineChartLineStyleSettings
markerStyleSettings :: Maybe LineChartMarkerStyleSettings
lineStyleSettings :: Maybe LineChartLineStyleSettings
$sel:markerStyleSettings:LineChartSeriesSettings' :: LineChartSeriesSettings -> Maybe LineChartMarkerStyleSettings
$sel:lineStyleSettings:LineChartSeriesSettings' :: LineChartSeriesSettings -> Maybe LineChartLineStyleSettings
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe LineChartLineStyleSettings
lineStyleSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LineChartMarkerStyleSettings
markerStyleSettings

instance Data.ToJSON LineChartSeriesSettings where
  toJSON :: LineChartSeriesSettings -> Value
toJSON LineChartSeriesSettings' {Maybe LineChartMarkerStyleSettings
Maybe LineChartLineStyleSettings
markerStyleSettings :: Maybe LineChartMarkerStyleSettings
lineStyleSettings :: Maybe LineChartLineStyleSettings
$sel:markerStyleSettings:LineChartSeriesSettings' :: LineChartSeriesSettings -> Maybe LineChartMarkerStyleSettings
$sel:lineStyleSettings:LineChartSeriesSettings' :: LineChartSeriesSettings -> Maybe LineChartLineStyleSettings
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"LineStyleSettings" 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 LineChartLineStyleSettings
lineStyleSettings,
            (Key
"MarkerStyleSettings" 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 LineChartMarkerStyleSettings
markerStyleSettings
          ]
      )