{-# 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.SmallMultiplesOptions
-- 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.SmallMultiplesOptions 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.PanelConfiguration

-- | Options that determine the layout and display options of a chart\'s
-- small multiples.
--
-- /See:/ 'newSmallMultiplesOptions' smart constructor.
data SmallMultiplesOptions = SmallMultiplesOptions'
  { -- | Sets the maximum number of visible columns to display in the grid of
    -- small multiples panels.
    --
    -- The default is @Auto@, which automatically adjusts the columns in the
    -- grid to fit the overall layout and size of the given chart.
    SmallMultiplesOptions -> Maybe Natural
maxVisibleColumns :: Prelude.Maybe Prelude.Natural,
    -- | Sets the maximum number of visible rows to display in the grid of small
    -- multiples panels.
    --
    -- The default value is @Auto@, which automatically adjusts the rows in the
    -- grid to fit the overall layout and size of the given chart.
    SmallMultiplesOptions -> Maybe Natural
maxVisibleRows :: Prelude.Maybe Prelude.Natural,
    -- | Configures the display options for each small multiples panel.
    SmallMultiplesOptions -> Maybe PanelConfiguration
panelConfiguration :: Prelude.Maybe PanelConfiguration
  }
  deriving (SmallMultiplesOptions -> SmallMultiplesOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SmallMultiplesOptions -> SmallMultiplesOptions -> Bool
$c/= :: SmallMultiplesOptions -> SmallMultiplesOptions -> Bool
== :: SmallMultiplesOptions -> SmallMultiplesOptions -> Bool
$c== :: SmallMultiplesOptions -> SmallMultiplesOptions -> Bool
Prelude.Eq, ReadPrec [SmallMultiplesOptions]
ReadPrec SmallMultiplesOptions
Int -> ReadS SmallMultiplesOptions
ReadS [SmallMultiplesOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SmallMultiplesOptions]
$creadListPrec :: ReadPrec [SmallMultiplesOptions]
readPrec :: ReadPrec SmallMultiplesOptions
$creadPrec :: ReadPrec SmallMultiplesOptions
readList :: ReadS [SmallMultiplesOptions]
$creadList :: ReadS [SmallMultiplesOptions]
readsPrec :: Int -> ReadS SmallMultiplesOptions
$creadsPrec :: Int -> ReadS SmallMultiplesOptions
Prelude.Read, Int -> SmallMultiplesOptions -> ShowS
[SmallMultiplesOptions] -> ShowS
SmallMultiplesOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SmallMultiplesOptions] -> ShowS
$cshowList :: [SmallMultiplesOptions] -> ShowS
show :: SmallMultiplesOptions -> String
$cshow :: SmallMultiplesOptions -> String
showsPrec :: Int -> SmallMultiplesOptions -> ShowS
$cshowsPrec :: Int -> SmallMultiplesOptions -> ShowS
Prelude.Show, forall x. Rep SmallMultiplesOptions x -> SmallMultiplesOptions
forall x. SmallMultiplesOptions -> Rep SmallMultiplesOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SmallMultiplesOptions x -> SmallMultiplesOptions
$cfrom :: forall x. SmallMultiplesOptions -> Rep SmallMultiplesOptions x
Prelude.Generic)

-- |
-- Create a value of 'SmallMultiplesOptions' 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:
--
-- 'maxVisibleColumns', 'smallMultiplesOptions_maxVisibleColumns' - Sets the maximum number of visible columns to display in the grid of
-- small multiples panels.
--
-- The default is @Auto@, which automatically adjusts the columns in the
-- grid to fit the overall layout and size of the given chart.
--
-- 'maxVisibleRows', 'smallMultiplesOptions_maxVisibleRows' - Sets the maximum number of visible rows to display in the grid of small
-- multiples panels.
--
-- The default value is @Auto@, which automatically adjusts the rows in the
-- grid to fit the overall layout and size of the given chart.
--
-- 'panelConfiguration', 'smallMultiplesOptions_panelConfiguration' - Configures the display options for each small multiples panel.
newSmallMultiplesOptions ::
  SmallMultiplesOptions
newSmallMultiplesOptions :: SmallMultiplesOptions
newSmallMultiplesOptions =
  SmallMultiplesOptions'
    { $sel:maxVisibleColumns:SmallMultiplesOptions' :: Maybe Natural
maxVisibleColumns =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxVisibleRows:SmallMultiplesOptions' :: Maybe Natural
maxVisibleRows = forall a. Maybe a
Prelude.Nothing,
      $sel:panelConfiguration:SmallMultiplesOptions' :: Maybe PanelConfiguration
panelConfiguration = forall a. Maybe a
Prelude.Nothing
    }

-- | Sets the maximum number of visible columns to display in the grid of
-- small multiples panels.
--
-- The default is @Auto@, which automatically adjusts the columns in the
-- grid to fit the overall layout and size of the given chart.
smallMultiplesOptions_maxVisibleColumns :: Lens.Lens' SmallMultiplesOptions (Prelude.Maybe Prelude.Natural)
smallMultiplesOptions_maxVisibleColumns :: Lens' SmallMultiplesOptions (Maybe Natural)
smallMultiplesOptions_maxVisibleColumns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SmallMultiplesOptions' {Maybe Natural
maxVisibleColumns :: Maybe Natural
$sel:maxVisibleColumns:SmallMultiplesOptions' :: SmallMultiplesOptions -> Maybe Natural
maxVisibleColumns} -> Maybe Natural
maxVisibleColumns) (\s :: SmallMultiplesOptions
s@SmallMultiplesOptions' {} Maybe Natural
a -> SmallMultiplesOptions
s {$sel:maxVisibleColumns:SmallMultiplesOptions' :: Maybe Natural
maxVisibleColumns = Maybe Natural
a} :: SmallMultiplesOptions)

-- | Sets the maximum number of visible rows to display in the grid of small
-- multiples panels.
--
-- The default value is @Auto@, which automatically adjusts the rows in the
-- grid to fit the overall layout and size of the given chart.
smallMultiplesOptions_maxVisibleRows :: Lens.Lens' SmallMultiplesOptions (Prelude.Maybe Prelude.Natural)
smallMultiplesOptions_maxVisibleRows :: Lens' SmallMultiplesOptions (Maybe Natural)
smallMultiplesOptions_maxVisibleRows = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SmallMultiplesOptions' {Maybe Natural
maxVisibleRows :: Maybe Natural
$sel:maxVisibleRows:SmallMultiplesOptions' :: SmallMultiplesOptions -> Maybe Natural
maxVisibleRows} -> Maybe Natural
maxVisibleRows) (\s :: SmallMultiplesOptions
s@SmallMultiplesOptions' {} Maybe Natural
a -> SmallMultiplesOptions
s {$sel:maxVisibleRows:SmallMultiplesOptions' :: Maybe Natural
maxVisibleRows = Maybe Natural
a} :: SmallMultiplesOptions)

-- | Configures the display options for each small multiples panel.
smallMultiplesOptions_panelConfiguration :: Lens.Lens' SmallMultiplesOptions (Prelude.Maybe PanelConfiguration)
smallMultiplesOptions_panelConfiguration :: Lens' SmallMultiplesOptions (Maybe PanelConfiguration)
smallMultiplesOptions_panelConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SmallMultiplesOptions' {Maybe PanelConfiguration
panelConfiguration :: Maybe PanelConfiguration
$sel:panelConfiguration:SmallMultiplesOptions' :: SmallMultiplesOptions -> Maybe PanelConfiguration
panelConfiguration} -> Maybe PanelConfiguration
panelConfiguration) (\s :: SmallMultiplesOptions
s@SmallMultiplesOptions' {} Maybe PanelConfiguration
a -> SmallMultiplesOptions
s {$sel:panelConfiguration:SmallMultiplesOptions' :: Maybe PanelConfiguration
panelConfiguration = Maybe PanelConfiguration
a} :: SmallMultiplesOptions)

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

instance Prelude.Hashable SmallMultiplesOptions where
  hashWithSalt :: Int -> SmallMultiplesOptions -> Int
hashWithSalt Int
_salt SmallMultiplesOptions' {Maybe Natural
Maybe PanelConfiguration
panelConfiguration :: Maybe PanelConfiguration
maxVisibleRows :: Maybe Natural
maxVisibleColumns :: Maybe Natural
$sel:panelConfiguration:SmallMultiplesOptions' :: SmallMultiplesOptions -> Maybe PanelConfiguration
$sel:maxVisibleRows:SmallMultiplesOptions' :: SmallMultiplesOptions -> Maybe Natural
$sel:maxVisibleColumns:SmallMultiplesOptions' :: SmallMultiplesOptions -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxVisibleColumns
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxVisibleRows
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PanelConfiguration
panelConfiguration

instance Prelude.NFData SmallMultiplesOptions where
  rnf :: SmallMultiplesOptions -> ()
rnf SmallMultiplesOptions' {Maybe Natural
Maybe PanelConfiguration
panelConfiguration :: Maybe PanelConfiguration
maxVisibleRows :: Maybe Natural
maxVisibleColumns :: Maybe Natural
$sel:panelConfiguration:SmallMultiplesOptions' :: SmallMultiplesOptions -> Maybe PanelConfiguration
$sel:maxVisibleRows:SmallMultiplesOptions' :: SmallMultiplesOptions -> Maybe Natural
$sel:maxVisibleColumns:SmallMultiplesOptions' :: SmallMultiplesOptions -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxVisibleColumns
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxVisibleRows
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PanelConfiguration
panelConfiguration

instance Data.ToJSON SmallMultiplesOptions where
  toJSON :: SmallMultiplesOptions -> Value
toJSON SmallMultiplesOptions' {Maybe Natural
Maybe PanelConfiguration
panelConfiguration :: Maybe PanelConfiguration
maxVisibleRows :: Maybe Natural
maxVisibleColumns :: Maybe Natural
$sel:panelConfiguration:SmallMultiplesOptions' :: SmallMultiplesOptions -> Maybe PanelConfiguration
$sel:maxVisibleRows:SmallMultiplesOptions' :: SmallMultiplesOptions -> Maybe Natural
$sel:maxVisibleColumns:SmallMultiplesOptions' :: SmallMultiplesOptions -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MaxVisibleColumns" 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 Natural
maxVisibleColumns,
            (Key
"MaxVisibleRows" 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 Natural
maxVisibleRows,
            (Key
"PanelConfiguration" 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 PanelConfiguration
panelConfiguration
          ]
      )