{-# 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.ExportToCSVOption
-- 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.ExportToCSVOption where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types.DashboardBehavior

-- | Export to .csv option.
--
-- /See:/ 'newExportToCSVOption' smart constructor.
data ExportToCSVOption = ExportToCSVOption'
  { -- | Availability status.
    ExportToCSVOption -> Maybe DashboardBehavior
availabilityStatus :: Prelude.Maybe DashboardBehavior
  }
  deriving (ExportToCSVOption -> ExportToCSVOption -> Bool
(ExportToCSVOption -> ExportToCSVOption -> Bool)
-> (ExportToCSVOption -> ExportToCSVOption -> Bool)
-> Eq ExportToCSVOption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportToCSVOption -> ExportToCSVOption -> Bool
$c/= :: ExportToCSVOption -> ExportToCSVOption -> Bool
== :: ExportToCSVOption -> ExportToCSVOption -> Bool
$c== :: ExportToCSVOption -> ExportToCSVOption -> Bool
Prelude.Eq, ReadPrec [ExportToCSVOption]
ReadPrec ExportToCSVOption
Int -> ReadS ExportToCSVOption
ReadS [ExportToCSVOption]
(Int -> ReadS ExportToCSVOption)
-> ReadS [ExportToCSVOption]
-> ReadPrec ExportToCSVOption
-> ReadPrec [ExportToCSVOption]
-> Read ExportToCSVOption
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportToCSVOption]
$creadListPrec :: ReadPrec [ExportToCSVOption]
readPrec :: ReadPrec ExportToCSVOption
$creadPrec :: ReadPrec ExportToCSVOption
readList :: ReadS [ExportToCSVOption]
$creadList :: ReadS [ExportToCSVOption]
readsPrec :: Int -> ReadS ExportToCSVOption
$creadsPrec :: Int -> ReadS ExportToCSVOption
Prelude.Read, Int -> ExportToCSVOption -> ShowS
[ExportToCSVOption] -> ShowS
ExportToCSVOption -> String
(Int -> ExportToCSVOption -> ShowS)
-> (ExportToCSVOption -> String)
-> ([ExportToCSVOption] -> ShowS)
-> Show ExportToCSVOption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportToCSVOption] -> ShowS
$cshowList :: [ExportToCSVOption] -> ShowS
show :: ExportToCSVOption -> String
$cshow :: ExportToCSVOption -> String
showsPrec :: Int -> ExportToCSVOption -> ShowS
$cshowsPrec :: Int -> ExportToCSVOption -> ShowS
Prelude.Show, (forall x. ExportToCSVOption -> Rep ExportToCSVOption x)
-> (forall x. Rep ExportToCSVOption x -> ExportToCSVOption)
-> Generic ExportToCSVOption
forall x. Rep ExportToCSVOption x -> ExportToCSVOption
forall x. ExportToCSVOption -> Rep ExportToCSVOption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExportToCSVOption x -> ExportToCSVOption
$cfrom :: forall x. ExportToCSVOption -> Rep ExportToCSVOption x
Prelude.Generic)

-- |
-- Create a value of 'ExportToCSVOption' 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:
--
-- 'availabilityStatus', 'exportToCSVOption_availabilityStatus' - Availability status.
newExportToCSVOption ::
  ExportToCSVOption
newExportToCSVOption :: ExportToCSVOption
newExportToCSVOption =
  ExportToCSVOption' :: Maybe DashboardBehavior -> ExportToCSVOption
ExportToCSVOption'
    { $sel:availabilityStatus:ExportToCSVOption' :: Maybe DashboardBehavior
availabilityStatus =
        Maybe DashboardBehavior
forall a. Maybe a
Prelude.Nothing
    }

-- | Availability status.
exportToCSVOption_availabilityStatus :: Lens.Lens' ExportToCSVOption (Prelude.Maybe DashboardBehavior)
exportToCSVOption_availabilityStatus :: (Maybe DashboardBehavior -> f (Maybe DashboardBehavior))
-> ExportToCSVOption -> f ExportToCSVOption
exportToCSVOption_availabilityStatus = (ExportToCSVOption -> Maybe DashboardBehavior)
-> (ExportToCSVOption
    -> Maybe DashboardBehavior -> ExportToCSVOption)
-> Lens
     ExportToCSVOption
     ExportToCSVOption
     (Maybe DashboardBehavior)
     (Maybe DashboardBehavior)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportToCSVOption' {Maybe DashboardBehavior
availabilityStatus :: Maybe DashboardBehavior
$sel:availabilityStatus:ExportToCSVOption' :: ExportToCSVOption -> Maybe DashboardBehavior
availabilityStatus} -> Maybe DashboardBehavior
availabilityStatus) (\s :: ExportToCSVOption
s@ExportToCSVOption' {} Maybe DashboardBehavior
a -> ExportToCSVOption
s {$sel:availabilityStatus:ExportToCSVOption' :: Maybe DashboardBehavior
availabilityStatus = Maybe DashboardBehavior
a} :: ExportToCSVOption)

instance Prelude.Hashable ExportToCSVOption

instance Prelude.NFData ExportToCSVOption

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