{-# 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.DashboardPublishOptions
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.QuickSight.Types.DashboardPublishOptions where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types.AdHocFilteringOption
import Amazonka.QuickSight.Types.ExportToCSVOption
import Amazonka.QuickSight.Types.SheetControlsOption

-- | Dashboard publish options.
--
-- /See:/ 'newDashboardPublishOptions' smart constructor.
data DashboardPublishOptions = DashboardPublishOptions'
  { -- | Ad hoc (one-time) filtering option.
    DashboardPublishOptions -> Maybe AdHocFilteringOption
adHocFilteringOption :: Prelude.Maybe AdHocFilteringOption,
    -- | Export to .csv option.
    DashboardPublishOptions -> Maybe ExportToCSVOption
exportToCSVOption :: Prelude.Maybe ExportToCSVOption,
    -- | Sheet controls option.
    DashboardPublishOptions -> Maybe SheetControlsOption
sheetControlsOption :: Prelude.Maybe SheetControlsOption
  }
  deriving (DashboardPublishOptions -> DashboardPublishOptions -> Bool
(DashboardPublishOptions -> DashboardPublishOptions -> Bool)
-> (DashboardPublishOptions -> DashboardPublishOptions -> Bool)
-> Eq DashboardPublishOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DashboardPublishOptions -> DashboardPublishOptions -> Bool
$c/= :: DashboardPublishOptions -> DashboardPublishOptions -> Bool
== :: DashboardPublishOptions -> DashboardPublishOptions -> Bool
$c== :: DashboardPublishOptions -> DashboardPublishOptions -> Bool
Prelude.Eq, ReadPrec [DashboardPublishOptions]
ReadPrec DashboardPublishOptions
Int -> ReadS DashboardPublishOptions
ReadS [DashboardPublishOptions]
(Int -> ReadS DashboardPublishOptions)
-> ReadS [DashboardPublishOptions]
-> ReadPrec DashboardPublishOptions
-> ReadPrec [DashboardPublishOptions]
-> Read DashboardPublishOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DashboardPublishOptions]
$creadListPrec :: ReadPrec [DashboardPublishOptions]
readPrec :: ReadPrec DashboardPublishOptions
$creadPrec :: ReadPrec DashboardPublishOptions
readList :: ReadS [DashboardPublishOptions]
$creadList :: ReadS [DashboardPublishOptions]
readsPrec :: Int -> ReadS DashboardPublishOptions
$creadsPrec :: Int -> ReadS DashboardPublishOptions
Prelude.Read, Int -> DashboardPublishOptions -> ShowS
[DashboardPublishOptions] -> ShowS
DashboardPublishOptions -> String
(Int -> DashboardPublishOptions -> ShowS)
-> (DashboardPublishOptions -> String)
-> ([DashboardPublishOptions] -> ShowS)
-> Show DashboardPublishOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DashboardPublishOptions] -> ShowS
$cshowList :: [DashboardPublishOptions] -> ShowS
show :: DashboardPublishOptions -> String
$cshow :: DashboardPublishOptions -> String
showsPrec :: Int -> DashboardPublishOptions -> ShowS
$cshowsPrec :: Int -> DashboardPublishOptions -> ShowS
Prelude.Show, (forall x.
 DashboardPublishOptions -> Rep DashboardPublishOptions x)
-> (forall x.
    Rep DashboardPublishOptions x -> DashboardPublishOptions)
-> Generic DashboardPublishOptions
forall x. Rep DashboardPublishOptions x -> DashboardPublishOptions
forall x. DashboardPublishOptions -> Rep DashboardPublishOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DashboardPublishOptions x -> DashboardPublishOptions
$cfrom :: forall x. DashboardPublishOptions -> Rep DashboardPublishOptions x
Prelude.Generic)

-- |
-- Create a value of 'DashboardPublishOptions' 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:
--
-- 'adHocFilteringOption', 'dashboardPublishOptions_adHocFilteringOption' - Ad hoc (one-time) filtering option.
--
-- 'exportToCSVOption', 'dashboardPublishOptions_exportToCSVOption' - Export to .csv option.
--
-- 'sheetControlsOption', 'dashboardPublishOptions_sheetControlsOption' - Sheet controls option.
newDashboardPublishOptions ::
  DashboardPublishOptions
newDashboardPublishOptions :: DashboardPublishOptions
newDashboardPublishOptions =
  DashboardPublishOptions' :: Maybe AdHocFilteringOption
-> Maybe ExportToCSVOption
-> Maybe SheetControlsOption
-> DashboardPublishOptions
DashboardPublishOptions'
    { $sel:adHocFilteringOption:DashboardPublishOptions' :: Maybe AdHocFilteringOption
adHocFilteringOption =
        Maybe AdHocFilteringOption
forall a. Maybe a
Prelude.Nothing,
      $sel:exportToCSVOption:DashboardPublishOptions' :: Maybe ExportToCSVOption
exportToCSVOption = Maybe ExportToCSVOption
forall a. Maybe a
Prelude.Nothing,
      $sel:sheetControlsOption:DashboardPublishOptions' :: Maybe SheetControlsOption
sheetControlsOption = Maybe SheetControlsOption
forall a. Maybe a
Prelude.Nothing
    }

-- | Ad hoc (one-time) filtering option.
dashboardPublishOptions_adHocFilteringOption :: Lens.Lens' DashboardPublishOptions (Prelude.Maybe AdHocFilteringOption)
dashboardPublishOptions_adHocFilteringOption :: (Maybe AdHocFilteringOption -> f (Maybe AdHocFilteringOption))
-> DashboardPublishOptions -> f DashboardPublishOptions
dashboardPublishOptions_adHocFilteringOption = (DashboardPublishOptions -> Maybe AdHocFilteringOption)
-> (DashboardPublishOptions
    -> Maybe AdHocFilteringOption -> DashboardPublishOptions)
-> Lens
     DashboardPublishOptions
     DashboardPublishOptions
     (Maybe AdHocFilteringOption)
     (Maybe AdHocFilteringOption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashboardPublishOptions' {Maybe AdHocFilteringOption
adHocFilteringOption :: Maybe AdHocFilteringOption
$sel:adHocFilteringOption:DashboardPublishOptions' :: DashboardPublishOptions -> Maybe AdHocFilteringOption
adHocFilteringOption} -> Maybe AdHocFilteringOption
adHocFilteringOption) (\s :: DashboardPublishOptions
s@DashboardPublishOptions' {} Maybe AdHocFilteringOption
a -> DashboardPublishOptions
s {$sel:adHocFilteringOption:DashboardPublishOptions' :: Maybe AdHocFilteringOption
adHocFilteringOption = Maybe AdHocFilteringOption
a} :: DashboardPublishOptions)

-- | Export to .csv option.
dashboardPublishOptions_exportToCSVOption :: Lens.Lens' DashboardPublishOptions (Prelude.Maybe ExportToCSVOption)
dashboardPublishOptions_exportToCSVOption :: (Maybe ExportToCSVOption -> f (Maybe ExportToCSVOption))
-> DashboardPublishOptions -> f DashboardPublishOptions
dashboardPublishOptions_exportToCSVOption = (DashboardPublishOptions -> Maybe ExportToCSVOption)
-> (DashboardPublishOptions
    -> Maybe ExportToCSVOption -> DashboardPublishOptions)
-> Lens
     DashboardPublishOptions
     DashboardPublishOptions
     (Maybe ExportToCSVOption)
     (Maybe ExportToCSVOption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashboardPublishOptions' {Maybe ExportToCSVOption
exportToCSVOption :: Maybe ExportToCSVOption
$sel:exportToCSVOption:DashboardPublishOptions' :: DashboardPublishOptions -> Maybe ExportToCSVOption
exportToCSVOption} -> Maybe ExportToCSVOption
exportToCSVOption) (\s :: DashboardPublishOptions
s@DashboardPublishOptions' {} Maybe ExportToCSVOption
a -> DashboardPublishOptions
s {$sel:exportToCSVOption:DashboardPublishOptions' :: Maybe ExportToCSVOption
exportToCSVOption = Maybe ExportToCSVOption
a} :: DashboardPublishOptions)

-- | Sheet controls option.
dashboardPublishOptions_sheetControlsOption :: Lens.Lens' DashboardPublishOptions (Prelude.Maybe SheetControlsOption)
dashboardPublishOptions_sheetControlsOption :: (Maybe SheetControlsOption -> f (Maybe SheetControlsOption))
-> DashboardPublishOptions -> f DashboardPublishOptions
dashboardPublishOptions_sheetControlsOption = (DashboardPublishOptions -> Maybe SheetControlsOption)
-> (DashboardPublishOptions
    -> Maybe SheetControlsOption -> DashboardPublishOptions)
-> Lens
     DashboardPublishOptions
     DashboardPublishOptions
     (Maybe SheetControlsOption)
     (Maybe SheetControlsOption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashboardPublishOptions' {Maybe SheetControlsOption
sheetControlsOption :: Maybe SheetControlsOption
$sel:sheetControlsOption:DashboardPublishOptions' :: DashboardPublishOptions -> Maybe SheetControlsOption
sheetControlsOption} -> Maybe SheetControlsOption
sheetControlsOption) (\s :: DashboardPublishOptions
s@DashboardPublishOptions' {} Maybe SheetControlsOption
a -> DashboardPublishOptions
s {$sel:sheetControlsOption:DashboardPublishOptions' :: Maybe SheetControlsOption
sheetControlsOption = Maybe SheetControlsOption
a} :: DashboardPublishOptions)

instance Prelude.Hashable DashboardPublishOptions

instance Prelude.NFData DashboardPublishOptions

instance Core.ToJSON DashboardPublishOptions where
  toJSON :: DashboardPublishOptions -> Value
toJSON DashboardPublishOptions' {Maybe AdHocFilteringOption
Maybe ExportToCSVOption
Maybe SheetControlsOption
sheetControlsOption :: Maybe SheetControlsOption
exportToCSVOption :: Maybe ExportToCSVOption
adHocFilteringOption :: Maybe AdHocFilteringOption
$sel:sheetControlsOption:DashboardPublishOptions' :: DashboardPublishOptions -> Maybe SheetControlsOption
$sel:exportToCSVOption:DashboardPublishOptions' :: DashboardPublishOptions -> Maybe ExportToCSVOption
$sel:adHocFilteringOption:DashboardPublishOptions' :: DashboardPublishOptions -> Maybe AdHocFilteringOption
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"AdHocFilteringOption" Text -> AdHocFilteringOption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AdHocFilteringOption -> Pair)
-> Maybe AdHocFilteringOption -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AdHocFilteringOption
adHocFilteringOption,
            (Text
"ExportToCSVOption" Text -> ExportToCSVOption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ExportToCSVOption -> Pair)
-> Maybe ExportToCSVOption -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ExportToCSVOption
exportToCSVOption,
            (Text
"SheetControlsOption" Text -> SheetControlsOption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SheetControlsOption -> Pair)
-> Maybe SheetControlsOption -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SheetControlsOption
sheetControlsOption
          ]
      )