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

-- | The Amazon QuickSight settings associated with your Amazon Web Services
-- account.
--
-- /See:/ 'newAccountSettings' smart constructor.
data AccountSettings = 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 -> 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 edition of Amazon QuickSight that you\'re currently subscribed to:
    -- Enterprise edition or Standard edition.
    AccountSettings -> Maybe Edition
edition :: Prelude.Maybe Edition,
    -- | The main notification email for your Amazon QuickSight subscription.
    AccountSettings -> Maybe Text
notificationEmail :: Prelude.Maybe Prelude.Text,
    -- | A Boolean value that indicates whether public sharing is turned on for
    -- an Amazon QuickSight account. For more information about turning on
    -- public sharing, see
    -- <https://docs.aws.amazon.com/quicksight/latest/APIReference/API_UpdatePublicSharingSettings.html UpdatePublicSharingSettings>.
    AccountSettings -> Maybe Bool
publicSharingEnabled :: Prelude.Maybe Prelude.Bool,
    -- | A boolean value that determines whether or not an Amazon QuickSight
    -- account can be deleted. A @True@ value doesn\'t allow the account to be
    -- deleted and results in an error message if a user tries to make a
    -- @DeleteAccountSubsctiption@ request. A @False@ value will allow the
    -- ccount to be deleted.
    AccountSettings -> Maybe Bool
terminationProtectionEnabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (AccountSettings -> AccountSettings -> Bool
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]
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
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. 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:
--
-- '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.
--
-- 'edition', 'accountSettings_edition' - The edition of Amazon QuickSight that you\'re currently subscribed to:
-- Enterprise edition or Standard edition.
--
-- 'notificationEmail', 'accountSettings_notificationEmail' - The main notification email for your Amazon QuickSight subscription.
--
-- 'publicSharingEnabled', 'accountSettings_publicSharingEnabled' - A Boolean value that indicates whether public sharing is turned on for
-- an Amazon QuickSight account. For more information about turning on
-- public sharing, see
-- <https://docs.aws.amazon.com/quicksight/latest/APIReference/API_UpdatePublicSharingSettings.html UpdatePublicSharingSettings>.
--
-- 'terminationProtectionEnabled', 'accountSettings_terminationProtectionEnabled' - A boolean value that determines whether or not an Amazon QuickSight
-- account can be deleted. A @True@ value doesn\'t allow the account to be
-- deleted and results in an error message if a user tries to make a
-- @DeleteAccountSubsctiption@ request. A @False@ value will allow the
-- ccount to be deleted.
newAccountSettings ::
  AccountSettings
newAccountSettings :: AccountSettings
newAccountSettings =
  AccountSettings'
    { $sel:accountName:AccountSettings' :: Maybe Text
accountName = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultNamespace:AccountSettings' :: Maybe Text
defaultNamespace = forall a. Maybe a
Prelude.Nothing,
      $sel:edition:AccountSettings' :: Maybe Edition
edition = forall a. Maybe a
Prelude.Nothing,
      $sel:notificationEmail:AccountSettings' :: Maybe Text
notificationEmail = forall a. Maybe a
Prelude.Nothing,
      $sel:publicSharingEnabled:AccountSettings' :: Maybe Bool
publicSharingEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:terminationProtectionEnabled:AccountSettings' :: Maybe Bool
terminationProtectionEnabled = forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: Lens' AccountSettings (Maybe Text)
accountSettings_accountName = 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 :: Lens' AccountSettings (Maybe Text)
accountSettings_defaultNamespace = 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 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 :: Lens' AccountSettings (Maybe Edition)
accountSettings_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 main notification email for your Amazon QuickSight subscription.
accountSettings_notificationEmail :: Lens.Lens' AccountSettings (Prelude.Maybe Prelude.Text)
accountSettings_notificationEmail :: Lens' AccountSettings (Maybe Text)
accountSettings_notificationEmail = 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)

-- | A Boolean value that indicates whether public sharing is turned on for
-- an Amazon QuickSight account. For more information about turning on
-- public sharing, see
-- <https://docs.aws.amazon.com/quicksight/latest/APIReference/API_UpdatePublicSharingSettings.html UpdatePublicSharingSettings>.
accountSettings_publicSharingEnabled :: Lens.Lens' AccountSettings (Prelude.Maybe Prelude.Bool)
accountSettings_publicSharingEnabled :: Lens' AccountSettings (Maybe Bool)
accountSettings_publicSharingEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountSettings' {Maybe Bool
publicSharingEnabled :: Maybe Bool
$sel:publicSharingEnabled:AccountSettings' :: AccountSettings -> Maybe Bool
publicSharingEnabled} -> Maybe Bool
publicSharingEnabled) (\s :: AccountSettings
s@AccountSettings' {} Maybe Bool
a -> AccountSettings
s {$sel:publicSharingEnabled:AccountSettings' :: Maybe Bool
publicSharingEnabled = Maybe Bool
a} :: AccountSettings)

-- | A boolean value that determines whether or not an Amazon QuickSight
-- account can be deleted. A @True@ value doesn\'t allow the account to be
-- deleted and results in an error message if a user tries to make a
-- @DeleteAccountSubsctiption@ request. A @False@ value will allow the
-- ccount to be deleted.
accountSettings_terminationProtectionEnabled :: Lens.Lens' AccountSettings (Prelude.Maybe Prelude.Bool)
accountSettings_terminationProtectionEnabled :: Lens' AccountSettings (Maybe Bool)
accountSettings_terminationProtectionEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountSettings' {Maybe Bool
terminationProtectionEnabled :: Maybe Bool
$sel:terminationProtectionEnabled:AccountSettings' :: AccountSettings -> Maybe Bool
terminationProtectionEnabled} -> Maybe Bool
terminationProtectionEnabled) (\s :: AccountSettings
s@AccountSettings' {} Maybe Bool
a -> AccountSettings
s {$sel:terminationProtectionEnabled:AccountSettings' :: Maybe Bool
terminationProtectionEnabled = Maybe Bool
a} :: AccountSettings)

instance Data.FromJSON AccountSettings where
  parseJSON :: Value -> Parser AccountSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AccountSettings"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Edition
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> AccountSettings
AccountSettings'
            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
"AccountName")
            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
"DefaultNamespace")
            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
"Edition")
            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
"NotificationEmail")
            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
"PublicSharingEnabled")
            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
"TerminationProtectionEnabled")
      )

instance Prelude.Hashable AccountSettings where
  hashWithSalt :: Int -> AccountSettings -> Int
hashWithSalt Int
_salt AccountSettings' {Maybe Bool
Maybe Text
Maybe Edition
terminationProtectionEnabled :: Maybe Bool
publicSharingEnabled :: Maybe Bool
notificationEmail :: Maybe Text
edition :: Maybe Edition
defaultNamespace :: Maybe Text
accountName :: Maybe Text
$sel:terminationProtectionEnabled:AccountSettings' :: AccountSettings -> Maybe Bool
$sel:publicSharingEnabled:AccountSettings' :: AccountSettings -> Maybe Bool
$sel:notificationEmail:AccountSettings' :: AccountSettings -> Maybe Text
$sel:edition:AccountSettings' :: AccountSettings -> Maybe Edition
$sel:defaultNamespace:AccountSettings' :: AccountSettings -> Maybe Text
$sel:accountName:AccountSettings' :: AccountSettings -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accountName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultNamespace
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Edition
edition
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
notificationEmail
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
publicSharingEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
terminationProtectionEnabled

instance Prelude.NFData AccountSettings where
  rnf :: AccountSettings -> ()
rnf AccountSettings' {Maybe Bool
Maybe Text
Maybe Edition
terminationProtectionEnabled :: Maybe Bool
publicSharingEnabled :: Maybe Bool
notificationEmail :: Maybe Text
edition :: Maybe Edition
defaultNamespace :: Maybe Text
accountName :: Maybe Text
$sel:terminationProtectionEnabled:AccountSettings' :: AccountSettings -> Maybe Bool
$sel:publicSharingEnabled:AccountSettings' :: AccountSettings -> Maybe Bool
$sel:notificationEmail:AccountSettings' :: AccountSettings -> Maybe Text
$sel:edition:AccountSettings' :: AccountSettings -> Maybe Edition
$sel:defaultNamespace:AccountSettings' :: AccountSettings -> Maybe Text
$sel:accountName:AccountSettings' :: AccountSettings -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accountName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultNamespace
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Edition
edition
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
notificationEmail
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
publicSharingEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
terminationProtectionEnabled