{-# 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.AccountCustomization
-- 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.AccountCustomization 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

-- | The Amazon QuickSight customizations associated with your Amazon Web
-- Services account or a QuickSight namespace in a specific Amazon Web
-- Services Region.
--
-- /See:/ 'newAccountCustomization' smart constructor.
data AccountCustomization = AccountCustomization'
  { -- | The default email customization template.
    AccountCustomization -> Maybe Text
defaultEmailCustomizationTemplate :: Prelude.Maybe Prelude.Text,
    -- | The default theme for this Amazon QuickSight subscription.
    AccountCustomization -> Maybe Text
defaultTheme :: Prelude.Maybe Prelude.Text
  }
  deriving (AccountCustomization -> AccountCustomization -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountCustomization -> AccountCustomization -> Bool
$c/= :: AccountCustomization -> AccountCustomization -> Bool
== :: AccountCustomization -> AccountCustomization -> Bool
$c== :: AccountCustomization -> AccountCustomization -> Bool
Prelude.Eq, ReadPrec [AccountCustomization]
ReadPrec AccountCustomization
Int -> ReadS AccountCustomization
ReadS [AccountCustomization]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccountCustomization]
$creadListPrec :: ReadPrec [AccountCustomization]
readPrec :: ReadPrec AccountCustomization
$creadPrec :: ReadPrec AccountCustomization
readList :: ReadS [AccountCustomization]
$creadList :: ReadS [AccountCustomization]
readsPrec :: Int -> ReadS AccountCustomization
$creadsPrec :: Int -> ReadS AccountCustomization
Prelude.Read, Int -> AccountCustomization -> ShowS
[AccountCustomization] -> ShowS
AccountCustomization -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountCustomization] -> ShowS
$cshowList :: [AccountCustomization] -> ShowS
show :: AccountCustomization -> String
$cshow :: AccountCustomization -> String
showsPrec :: Int -> AccountCustomization -> ShowS
$cshowsPrec :: Int -> AccountCustomization -> ShowS
Prelude.Show, forall x. Rep AccountCustomization x -> AccountCustomization
forall x. AccountCustomization -> Rep AccountCustomization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccountCustomization x -> AccountCustomization
$cfrom :: forall x. AccountCustomization -> Rep AccountCustomization x
Prelude.Generic)

-- |
-- Create a value of 'AccountCustomization' 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:
--
-- 'defaultEmailCustomizationTemplate', 'accountCustomization_defaultEmailCustomizationTemplate' - The default email customization template.
--
-- 'defaultTheme', 'accountCustomization_defaultTheme' - The default theme for this Amazon QuickSight subscription.
newAccountCustomization ::
  AccountCustomization
newAccountCustomization :: AccountCustomization
newAccountCustomization =
  AccountCustomization'
    { $sel:defaultEmailCustomizationTemplate:AccountCustomization' :: Maybe Text
defaultEmailCustomizationTemplate =
        forall a. Maybe a
Prelude.Nothing,
      $sel:defaultTheme:AccountCustomization' :: Maybe Text
defaultTheme = forall a. Maybe a
Prelude.Nothing
    }

-- | The default email customization template.
accountCustomization_defaultEmailCustomizationTemplate :: Lens.Lens' AccountCustomization (Prelude.Maybe Prelude.Text)
accountCustomization_defaultEmailCustomizationTemplate :: Lens' AccountCustomization (Maybe Text)
accountCustomization_defaultEmailCustomizationTemplate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountCustomization' {Maybe Text
defaultEmailCustomizationTemplate :: Maybe Text
$sel:defaultEmailCustomizationTemplate:AccountCustomization' :: AccountCustomization -> Maybe Text
defaultEmailCustomizationTemplate} -> Maybe Text
defaultEmailCustomizationTemplate) (\s :: AccountCustomization
s@AccountCustomization' {} Maybe Text
a -> AccountCustomization
s {$sel:defaultEmailCustomizationTemplate:AccountCustomization' :: Maybe Text
defaultEmailCustomizationTemplate = Maybe Text
a} :: AccountCustomization)

-- | The default theme for this Amazon QuickSight subscription.
accountCustomization_defaultTheme :: Lens.Lens' AccountCustomization (Prelude.Maybe Prelude.Text)
accountCustomization_defaultTheme :: Lens' AccountCustomization (Maybe Text)
accountCustomization_defaultTheme = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountCustomization' {Maybe Text
defaultTheme :: Maybe Text
$sel:defaultTheme:AccountCustomization' :: AccountCustomization -> Maybe Text
defaultTheme} -> Maybe Text
defaultTheme) (\s :: AccountCustomization
s@AccountCustomization' {} Maybe Text
a -> AccountCustomization
s {$sel:defaultTheme:AccountCustomization' :: Maybe Text
defaultTheme = Maybe Text
a} :: AccountCustomization)

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

instance Prelude.Hashable AccountCustomization where
  hashWithSalt :: Int -> AccountCustomization -> Int
hashWithSalt Int
_salt AccountCustomization' {Maybe Text
defaultTheme :: Maybe Text
defaultEmailCustomizationTemplate :: Maybe Text
$sel:defaultTheme:AccountCustomization' :: AccountCustomization -> Maybe Text
$sel:defaultEmailCustomizationTemplate:AccountCustomization' :: AccountCustomization -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultEmailCustomizationTemplate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultTheme

instance Prelude.NFData AccountCustomization where
  rnf :: AccountCustomization -> ()
rnf AccountCustomization' {Maybe Text
defaultTheme :: Maybe Text
defaultEmailCustomizationTemplate :: Maybe Text
$sel:defaultTheme:AccountCustomization' :: AccountCustomization -> Maybe Text
$sel:defaultEmailCustomizationTemplate:AccountCustomization' :: AccountCustomization -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultEmailCustomizationTemplate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultTheme

instance Data.ToJSON AccountCustomization where
  toJSON :: AccountCustomization -> Value
toJSON AccountCustomization' {Maybe Text
defaultTheme :: Maybe Text
defaultEmailCustomizationTemplate :: Maybe Text
$sel:defaultTheme:AccountCustomization' :: AccountCustomization -> Maybe Text
$sel:defaultEmailCustomizationTemplate:AccountCustomization' :: AccountCustomization -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DefaultEmailCustomizationTemplate" 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 Text
defaultEmailCustomizationTemplate,
            (Key
"DefaultTheme" 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 Text
defaultTheme
          ]
      )