{-# 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.BoxPlotStyleOptions
-- 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.BoxPlotStyleOptions 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.BoxPlotFillStyle

-- | The style options of the box plot.
--
-- /See:/ 'newBoxPlotStyleOptions' smart constructor.
data BoxPlotStyleOptions = BoxPlotStyleOptions'
  { -- | The fill styles (solid, transparent) of the box plot.
    BoxPlotStyleOptions -> Maybe BoxPlotFillStyle
fillStyle :: Prelude.Maybe BoxPlotFillStyle
  }
  deriving (BoxPlotStyleOptions -> BoxPlotStyleOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BoxPlotStyleOptions -> BoxPlotStyleOptions -> Bool
$c/= :: BoxPlotStyleOptions -> BoxPlotStyleOptions -> Bool
== :: BoxPlotStyleOptions -> BoxPlotStyleOptions -> Bool
$c== :: BoxPlotStyleOptions -> BoxPlotStyleOptions -> Bool
Prelude.Eq, ReadPrec [BoxPlotStyleOptions]
ReadPrec BoxPlotStyleOptions
Int -> ReadS BoxPlotStyleOptions
ReadS [BoxPlotStyleOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BoxPlotStyleOptions]
$creadListPrec :: ReadPrec [BoxPlotStyleOptions]
readPrec :: ReadPrec BoxPlotStyleOptions
$creadPrec :: ReadPrec BoxPlotStyleOptions
readList :: ReadS [BoxPlotStyleOptions]
$creadList :: ReadS [BoxPlotStyleOptions]
readsPrec :: Int -> ReadS BoxPlotStyleOptions
$creadsPrec :: Int -> ReadS BoxPlotStyleOptions
Prelude.Read, Int -> BoxPlotStyleOptions -> ShowS
[BoxPlotStyleOptions] -> ShowS
BoxPlotStyleOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BoxPlotStyleOptions] -> ShowS
$cshowList :: [BoxPlotStyleOptions] -> ShowS
show :: BoxPlotStyleOptions -> String
$cshow :: BoxPlotStyleOptions -> String
showsPrec :: Int -> BoxPlotStyleOptions -> ShowS
$cshowsPrec :: Int -> BoxPlotStyleOptions -> ShowS
Prelude.Show, forall x. Rep BoxPlotStyleOptions x -> BoxPlotStyleOptions
forall x. BoxPlotStyleOptions -> Rep BoxPlotStyleOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BoxPlotStyleOptions x -> BoxPlotStyleOptions
$cfrom :: forall x. BoxPlotStyleOptions -> Rep BoxPlotStyleOptions x
Prelude.Generic)

-- |
-- Create a value of 'BoxPlotStyleOptions' 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:
--
-- 'fillStyle', 'boxPlotStyleOptions_fillStyle' - The fill styles (solid, transparent) of the box plot.
newBoxPlotStyleOptions ::
  BoxPlotStyleOptions
newBoxPlotStyleOptions :: BoxPlotStyleOptions
newBoxPlotStyleOptions =
  BoxPlotStyleOptions' {$sel:fillStyle:BoxPlotStyleOptions' :: Maybe BoxPlotFillStyle
fillStyle = forall a. Maybe a
Prelude.Nothing}

-- | The fill styles (solid, transparent) of the box plot.
boxPlotStyleOptions_fillStyle :: Lens.Lens' BoxPlotStyleOptions (Prelude.Maybe BoxPlotFillStyle)
boxPlotStyleOptions_fillStyle :: Lens' BoxPlotStyleOptions (Maybe BoxPlotFillStyle)
boxPlotStyleOptions_fillStyle = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BoxPlotStyleOptions' {Maybe BoxPlotFillStyle
fillStyle :: Maybe BoxPlotFillStyle
$sel:fillStyle:BoxPlotStyleOptions' :: BoxPlotStyleOptions -> Maybe BoxPlotFillStyle
fillStyle} -> Maybe BoxPlotFillStyle
fillStyle) (\s :: BoxPlotStyleOptions
s@BoxPlotStyleOptions' {} Maybe BoxPlotFillStyle
a -> BoxPlotStyleOptions
s {$sel:fillStyle:BoxPlotStyleOptions' :: Maybe BoxPlotFillStyle
fillStyle = Maybe BoxPlotFillStyle
a} :: BoxPlotStyleOptions)

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

instance Prelude.Hashable BoxPlotStyleOptions where
  hashWithSalt :: Int -> BoxPlotStyleOptions -> Int
hashWithSalt Int
_salt BoxPlotStyleOptions' {Maybe BoxPlotFillStyle
fillStyle :: Maybe BoxPlotFillStyle
$sel:fillStyle:BoxPlotStyleOptions' :: BoxPlotStyleOptions -> Maybe BoxPlotFillStyle
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BoxPlotFillStyle
fillStyle

instance Prelude.NFData BoxPlotStyleOptions where
  rnf :: BoxPlotStyleOptions -> ()
rnf BoxPlotStyleOptions' {Maybe BoxPlotFillStyle
fillStyle :: Maybe BoxPlotFillStyle
$sel:fillStyle:BoxPlotStyleOptions' :: BoxPlotStyleOptions -> Maybe BoxPlotFillStyle
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe BoxPlotFillStyle
fillStyle

instance Data.ToJSON BoxPlotStyleOptions where
  toJSON :: BoxPlotStyleOptions -> Value
toJSON BoxPlotStyleOptions' {Maybe BoxPlotFillStyle
fillStyle :: Maybe BoxPlotFillStyle
$sel:fillStyle:BoxPlotStyleOptions' :: BoxPlotStyleOptions -> Maybe BoxPlotFillStyle
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"FillStyle" 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 BoxPlotFillStyle
fillStyle]
      )