{-# 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.WaterfallChartFieldWells
-- 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.WaterfallChartFieldWells 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.WaterfallChartAggregatedFieldWells

-- | The field well configuration of a waterfall visual.
--
-- /See:/ 'newWaterfallChartFieldWells' smart constructor.
data WaterfallChartFieldWells = WaterfallChartFieldWells'
  { -- | The field well configuration of a waterfall visual.
    WaterfallChartFieldWells
-> Maybe WaterfallChartAggregatedFieldWells
waterfallChartAggregatedFieldWells :: Prelude.Maybe WaterfallChartAggregatedFieldWells
  }
  deriving (WaterfallChartFieldWells -> WaterfallChartFieldWells -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WaterfallChartFieldWells -> WaterfallChartFieldWells -> Bool
$c/= :: WaterfallChartFieldWells -> WaterfallChartFieldWells -> Bool
== :: WaterfallChartFieldWells -> WaterfallChartFieldWells -> Bool
$c== :: WaterfallChartFieldWells -> WaterfallChartFieldWells -> Bool
Prelude.Eq, Int -> WaterfallChartFieldWells -> ShowS
[WaterfallChartFieldWells] -> ShowS
WaterfallChartFieldWells -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WaterfallChartFieldWells] -> ShowS
$cshowList :: [WaterfallChartFieldWells] -> ShowS
show :: WaterfallChartFieldWells -> String
$cshow :: WaterfallChartFieldWells -> String
showsPrec :: Int -> WaterfallChartFieldWells -> ShowS
$cshowsPrec :: Int -> WaterfallChartFieldWells -> ShowS
Prelude.Show, forall x.
Rep WaterfallChartFieldWells x -> WaterfallChartFieldWells
forall x.
WaterfallChartFieldWells -> Rep WaterfallChartFieldWells x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WaterfallChartFieldWells x -> WaterfallChartFieldWells
$cfrom :: forall x.
WaterfallChartFieldWells -> Rep WaterfallChartFieldWells x
Prelude.Generic)

-- |
-- Create a value of 'WaterfallChartFieldWells' 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:
--
-- 'waterfallChartAggregatedFieldWells', 'waterfallChartFieldWells_waterfallChartAggregatedFieldWells' - The field well configuration of a waterfall visual.
newWaterfallChartFieldWells ::
  WaterfallChartFieldWells
newWaterfallChartFieldWells :: WaterfallChartFieldWells
newWaterfallChartFieldWells =
  WaterfallChartFieldWells'
    { $sel:waterfallChartAggregatedFieldWells:WaterfallChartFieldWells' :: Maybe WaterfallChartAggregatedFieldWells
waterfallChartAggregatedFieldWells =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The field well configuration of a waterfall visual.
waterfallChartFieldWells_waterfallChartAggregatedFieldWells :: Lens.Lens' WaterfallChartFieldWells (Prelude.Maybe WaterfallChartAggregatedFieldWells)
waterfallChartFieldWells_waterfallChartAggregatedFieldWells :: Lens'
  WaterfallChartFieldWells (Maybe WaterfallChartAggregatedFieldWells)
waterfallChartFieldWells_waterfallChartAggregatedFieldWells = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WaterfallChartFieldWells' {Maybe WaterfallChartAggregatedFieldWells
waterfallChartAggregatedFieldWells :: Maybe WaterfallChartAggregatedFieldWells
$sel:waterfallChartAggregatedFieldWells:WaterfallChartFieldWells' :: WaterfallChartFieldWells
-> Maybe WaterfallChartAggregatedFieldWells
waterfallChartAggregatedFieldWells} -> Maybe WaterfallChartAggregatedFieldWells
waterfallChartAggregatedFieldWells) (\s :: WaterfallChartFieldWells
s@WaterfallChartFieldWells' {} Maybe WaterfallChartAggregatedFieldWells
a -> WaterfallChartFieldWells
s {$sel:waterfallChartAggregatedFieldWells:WaterfallChartFieldWells' :: Maybe WaterfallChartAggregatedFieldWells
waterfallChartAggregatedFieldWells = Maybe WaterfallChartAggregatedFieldWells
a} :: WaterfallChartFieldWells)

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

instance Prelude.Hashable WaterfallChartFieldWells where
  hashWithSalt :: Int -> WaterfallChartFieldWells -> Int
hashWithSalt Int
_salt WaterfallChartFieldWells' {Maybe WaterfallChartAggregatedFieldWells
waterfallChartAggregatedFieldWells :: Maybe WaterfallChartAggregatedFieldWells
$sel:waterfallChartAggregatedFieldWells:WaterfallChartFieldWells' :: WaterfallChartFieldWells
-> Maybe WaterfallChartAggregatedFieldWells
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WaterfallChartAggregatedFieldWells
waterfallChartAggregatedFieldWells

instance Prelude.NFData WaterfallChartFieldWells where
  rnf :: WaterfallChartFieldWells -> ()
rnf WaterfallChartFieldWells' {Maybe WaterfallChartAggregatedFieldWells
waterfallChartAggregatedFieldWells :: Maybe WaterfallChartAggregatedFieldWells
$sel:waterfallChartAggregatedFieldWells:WaterfallChartFieldWells' :: WaterfallChartFieldWells
-> Maybe WaterfallChartAggregatedFieldWells
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe WaterfallChartAggregatedFieldWells
waterfallChartAggregatedFieldWells

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