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

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

-- | The Amazon QuickSight settings associated with your Amazon Web Services
-- account.
--
-- /See:/ 'newAccountSettings' smart constructor.
data AccountSettings = AccountSettings'
  { -- | The edition of Amazon QuickSight that you\'re currently subscribed to:
    -- Enterprise edition or Standard edition.
    AccountSettings -> Maybe Edition
edition :: Prelude.Maybe Edition,
    -- | The \"account name\" you provided for the Amazon QuickSight subscription
    -- in your Amazon Web Services account. You create this name when you sign
    -- up for Amazon QuickSight. It is unique in all of Amazon Web Services and
    -- it appears only when users sign in.
    AccountSettings -> Maybe Text
accountName :: Prelude.Maybe Prelude.Text,
    -- | The default Amazon QuickSight namespace for your Amazon Web Services
    -- account.
    AccountSettings -> Maybe Text
defaultNamespace :: Prelude.Maybe Prelude.Text,
    -- | The main notification email for your Amazon QuickSight subscription.
    AccountSettings -> Maybe Text
notificationEmail :: Prelude.Maybe Prelude.Text
  }
  deriving (AccountSettings -> AccountSettings -> Bool
(AccountSettings -> AccountSettings -> Bool)
-> (AccountSettings -> AccountSettings -> Bool)
-> Eq AccountSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountSettings -> AccountSettings -> Bool
$c/= :: AccountSettings -> AccountSettings -> Bool
== :: AccountSettings -> AccountSettings -> Bool
$c== :: AccountSettings -> AccountSettings -> Bool
Prelude.Eq, ReadPrec [AccountSettings]
ReadPrec AccountSettings
Int -> ReadS AccountSettings
ReadS [AccountSettings]
(Int -> ReadS AccountSettings)
-> ReadS [AccountSettings]
-> ReadPrec AccountSettings
-> ReadPrec [AccountSettings]
-> Read AccountSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccountSettings]
$creadListPrec :: ReadPrec [AccountSettings]
readPrec :: ReadPrec AccountSettings
$creadPrec :: ReadPrec AccountSettings
readList :: ReadS [AccountSettings]
$creadList :: ReadS [AccountSettings]
readsPrec :: Int -> ReadS AccountSettings
$creadsPrec :: Int -> ReadS AccountSettings
Prelude.Read, Int -> AccountSettings -> ShowS
[AccountSettings] -> ShowS
AccountSettings -> String
(Int -> AccountSettings -> ShowS)
-> (AccountSettings -> String)
-> ([AccountSettings] -> ShowS)
-> Show AccountSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountSettings] -> ShowS
$cshowList :: [AccountSettings] -> ShowS
show :: AccountSettings -> String
$cshow :: AccountSettings -> String
showsPrec :: Int -> AccountSettings -> ShowS
$cshowsPrec :: Int -> AccountSettings -> ShowS
Prelude.Show, (forall x. AccountSettings -> Rep AccountSettings x)
-> (forall x. Rep AccountSettings x -> AccountSettings)
-> Generic AccountSettings
forall x. Rep AccountSettings x -> AccountSettings
forall x. AccountSettings -> Rep AccountSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccountSettings x -> AccountSettings
$cfrom :: forall x. AccountSettings -> Rep AccountSettings x
Prelude.Generic)

-- |
-- Create a value of 'AccountSettings' 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:
--
-- 'edition', 'accountSettings_edition' - The edition of Amazon QuickSight that you\'re currently subscribed to:
-- Enterprise edition or Standard edition.
--
-- 'accountName', 'accountSettings_accountName' - The \"account name\" you provided for the Amazon QuickSight subscription
-- in your Amazon Web Services account. You create this name when you sign
-- up for Amazon QuickSight. It is unique in all of Amazon Web Services and
-- it appears only when users sign in.
--
-- 'defaultNamespace', 'accountSettings_defaultNamespace' - The default Amazon QuickSight namespace for your Amazon Web Services
-- account.
--
-- 'notificationEmail', 'accountSettings_notificationEmail' - The main notification email for your Amazon QuickSight subscription.
newAccountSettings ::
  AccountSettings
newAccountSettings :: AccountSettings
newAccountSettings =
  AccountSettings' :: Maybe Edition
-> Maybe Text -> Maybe Text -> Maybe Text -> AccountSettings
AccountSettings'
    { $sel:edition:AccountSettings' :: Maybe Edition
edition = Maybe Edition
forall a. Maybe a
Prelude.Nothing,
      $sel:accountName:AccountSettings' :: Maybe Text
accountName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultNamespace:AccountSettings' :: Maybe Text
defaultNamespace = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:notificationEmail:AccountSettings' :: Maybe Text
notificationEmail = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The edition of Amazon QuickSight that you\'re currently subscribed to:
-- Enterprise edition or Standard edition.
accountSettings_edition :: Lens.Lens' AccountSettings (Prelude.Maybe Edition)
accountSettings_edition :: (Maybe Edition -> f (Maybe Edition))
-> AccountSettings -> f AccountSettings
accountSettings_edition = (AccountSettings -> Maybe Edition)
-> (AccountSettings -> Maybe Edition -> AccountSettings)
-> Lens
     AccountSettings AccountSettings (Maybe Edition) (Maybe Edition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountSettings' {Maybe Edition
edition :: Maybe Edition
$sel:edition:AccountSettings' :: AccountSettings -> Maybe Edition
edition} -> Maybe Edition
edition) (\s :: AccountSettings
s@AccountSettings' {} Maybe Edition
a -> AccountSettings
s {$sel:edition:AccountSettings' :: Maybe Edition
edition = Maybe Edition
a} :: AccountSettings)

-- | The \"account name\" you provided for the Amazon QuickSight subscription
-- in your Amazon Web Services account. You create this name when you sign
-- up for Amazon QuickSight. It is unique in all of Amazon Web Services and
-- it appears only when users sign in.
accountSettings_accountName :: Lens.Lens' AccountSettings (Prelude.Maybe Prelude.Text)
accountSettings_accountName :: (Maybe Text -> f (Maybe Text))
-> AccountSettings -> f AccountSettings
accountSettings_accountName = (AccountSettings -> Maybe Text)
-> (AccountSettings -> Maybe Text -> AccountSettings)
-> Lens AccountSettings AccountSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountSettings' {Maybe Text
accountName :: Maybe Text
$sel:accountName:AccountSettings' :: AccountSettings -> Maybe Text
accountName} -> Maybe Text
accountName) (\s :: AccountSettings
s@AccountSettings' {} Maybe Text
a -> AccountSettings
s {$sel:accountName:AccountSettings' :: Maybe Text
accountName = Maybe Text
a} :: AccountSettings)

-- | The default Amazon QuickSight namespace for your Amazon Web Services
-- account.
accountSettings_defaultNamespace :: Lens.Lens' AccountSettings (Prelude.Maybe Prelude.Text)
accountSettings_defaultNamespace :: (Maybe Text -> f (Maybe Text))
-> AccountSettings -> f AccountSettings
accountSettings_defaultNamespace = (AccountSettings -> Maybe Text)
-> (AccountSettings -> Maybe Text -> AccountSettings)
-> Lens AccountSettings AccountSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountSettings' {Maybe Text
defaultNamespace :: Maybe Text
$sel:defaultNamespace:AccountSettings' :: AccountSettings -> Maybe Text
defaultNamespace} -> Maybe Text
defaultNamespace) (\s :: AccountSettings
s@AccountSettings' {} Maybe Text
a -> AccountSettings
s {$sel:defaultNamespace:AccountSettings' :: Maybe Text
defaultNamespace = Maybe Text
a} :: AccountSettings)

-- | The main notification email for your Amazon QuickSight subscription.
accountSettings_notificationEmail :: Lens.Lens' AccountSettings (Prelude.Maybe Prelude.Text)
accountSettings_notificationEmail :: (Maybe Text -> f (Maybe Text))
-> AccountSettings -> f AccountSettings
accountSettings_notificationEmail = (AccountSettings -> Maybe Text)
-> (AccountSettings -> Maybe Text -> AccountSettings)
-> Lens AccountSettings AccountSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountSettings' {Maybe Text
notificationEmail :: Maybe Text
$sel:notificationEmail:AccountSettings' :: AccountSettings -> Maybe Text
notificationEmail} -> Maybe Text
notificationEmail) (\s :: AccountSettings
s@AccountSettings' {} Maybe Text
a -> AccountSettings
s {$sel:notificationEmail:AccountSettings' :: Maybe Text
notificationEmail = Maybe Text
a} :: AccountSettings)

instance Core.FromJSON AccountSettings where
  parseJSON :: Value -> Parser AccountSettings
parseJSON =
    String
-> (Object -> Parser AccountSettings)
-> Value
-> Parser AccountSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AccountSettings"
      ( \Object
x ->
          Maybe Edition
-> Maybe Text -> Maybe Text -> Maybe Text -> AccountSettings
AccountSettings'
            (Maybe Edition
 -> Maybe Text -> Maybe Text -> Maybe Text -> AccountSettings)
-> Parser (Maybe Edition)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> AccountSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Edition)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Edition")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> AccountSettings)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> AccountSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AccountName")
            Parser (Maybe Text -> Maybe Text -> AccountSettings)
-> Parser (Maybe Text) -> Parser (Maybe Text -> AccountSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DefaultNamespace")
            Parser (Maybe Text -> AccountSettings)
-> Parser (Maybe Text) -> Parser AccountSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NotificationEmail")
      )

instance Prelude.Hashable AccountSettings

instance Prelude.NFData AccountSettings