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

-- | A structure that contains the following account information elements:
--
-- -   Your Amazon QuickSight account name.
--
-- -   The edition of Amazon QuickSight that your account is using.
--
-- -   The notification email address that is associated with the Amazon
--     QuickSight account.
--
-- -   The authentication type of the Amazon QuickSight account.
--
-- -   The status of the Amazon QuickSight account\'s subscription.
--
-- /See:/ 'newAccountInfo' smart constructor.
data AccountInfo = AccountInfo'
  { -- | The account name that 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\'s unique over all of Amazon
    -- Web Services, and it appears only when users sign in.
    AccountInfo -> Maybe Text
accountName :: Prelude.Maybe Prelude.Text,
    -- | The status of your account subscription.
    AccountInfo -> Maybe Text
accountSubscriptionStatus :: Prelude.Maybe Prelude.Text,
    -- | The way that your Amazon QuickSight account is authenticated.
    AccountInfo -> Maybe Text
authenticationType :: Prelude.Maybe Prelude.Text,
    -- | The edition of your Amazon QuickSight account.
    AccountInfo -> Maybe Edition
edition :: Prelude.Maybe Edition,
    -- | The email address that will be used for Amazon QuickSight to send
    -- notifications regarding your Amazon Web Services account or Amazon
    -- QuickSight subscription.
    AccountInfo -> Maybe Text
notificationEmail :: Prelude.Maybe Prelude.Text
  }
  deriving (AccountInfo -> AccountInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountInfo -> AccountInfo -> Bool
$c/= :: AccountInfo -> AccountInfo -> Bool
== :: AccountInfo -> AccountInfo -> Bool
$c== :: AccountInfo -> AccountInfo -> Bool
Prelude.Eq, ReadPrec [AccountInfo]
ReadPrec AccountInfo
Int -> ReadS AccountInfo
ReadS [AccountInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccountInfo]
$creadListPrec :: ReadPrec [AccountInfo]
readPrec :: ReadPrec AccountInfo
$creadPrec :: ReadPrec AccountInfo
readList :: ReadS [AccountInfo]
$creadList :: ReadS [AccountInfo]
readsPrec :: Int -> ReadS AccountInfo
$creadsPrec :: Int -> ReadS AccountInfo
Prelude.Read, Int -> AccountInfo -> ShowS
[AccountInfo] -> ShowS
AccountInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountInfo] -> ShowS
$cshowList :: [AccountInfo] -> ShowS
show :: AccountInfo -> String
$cshow :: AccountInfo -> String
showsPrec :: Int -> AccountInfo -> ShowS
$cshowsPrec :: Int -> AccountInfo -> ShowS
Prelude.Show, forall x. Rep AccountInfo x -> AccountInfo
forall x. AccountInfo -> Rep AccountInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccountInfo x -> AccountInfo
$cfrom :: forall x. AccountInfo -> Rep AccountInfo x
Prelude.Generic)

-- |
-- Create a value of 'AccountInfo' 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', 'accountInfo_accountName' - The account name that 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\'s unique over all of Amazon
-- Web Services, and it appears only when users sign in.
--
-- 'accountSubscriptionStatus', 'accountInfo_accountSubscriptionStatus' - The status of your account subscription.
--
-- 'authenticationType', 'accountInfo_authenticationType' - The way that your Amazon QuickSight account is authenticated.
--
-- 'edition', 'accountInfo_edition' - The edition of your Amazon QuickSight account.
--
-- 'notificationEmail', 'accountInfo_notificationEmail' - The email address that will be used for Amazon QuickSight to send
-- notifications regarding your Amazon Web Services account or Amazon
-- QuickSight subscription.
newAccountInfo ::
  AccountInfo
newAccountInfo :: AccountInfo
newAccountInfo =
  AccountInfo'
    { $sel:accountName:AccountInfo' :: Maybe Text
accountName = forall a. Maybe a
Prelude.Nothing,
      $sel:accountSubscriptionStatus:AccountInfo' :: Maybe Text
accountSubscriptionStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:authenticationType:AccountInfo' :: Maybe Text
authenticationType = forall a. Maybe a
Prelude.Nothing,
      $sel:edition:AccountInfo' :: Maybe Edition
edition = forall a. Maybe a
Prelude.Nothing,
      $sel:notificationEmail:AccountInfo' :: Maybe Text
notificationEmail = forall a. Maybe a
Prelude.Nothing
    }

-- | The account name that 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\'s unique over all of Amazon
-- Web Services, and it appears only when users sign in.
accountInfo_accountName :: Lens.Lens' AccountInfo (Prelude.Maybe Prelude.Text)
accountInfo_accountName :: Lens' AccountInfo (Maybe Text)
accountInfo_accountName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountInfo' {Maybe Text
accountName :: Maybe Text
$sel:accountName:AccountInfo' :: AccountInfo -> Maybe Text
accountName} -> Maybe Text
accountName) (\s :: AccountInfo
s@AccountInfo' {} Maybe Text
a -> AccountInfo
s {$sel:accountName:AccountInfo' :: Maybe Text
accountName = Maybe Text
a} :: AccountInfo)

-- | The status of your account subscription.
accountInfo_accountSubscriptionStatus :: Lens.Lens' AccountInfo (Prelude.Maybe Prelude.Text)
accountInfo_accountSubscriptionStatus :: Lens' AccountInfo (Maybe Text)
accountInfo_accountSubscriptionStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountInfo' {Maybe Text
accountSubscriptionStatus :: Maybe Text
$sel:accountSubscriptionStatus:AccountInfo' :: AccountInfo -> Maybe Text
accountSubscriptionStatus} -> Maybe Text
accountSubscriptionStatus) (\s :: AccountInfo
s@AccountInfo' {} Maybe Text
a -> AccountInfo
s {$sel:accountSubscriptionStatus:AccountInfo' :: Maybe Text
accountSubscriptionStatus = Maybe Text
a} :: AccountInfo)

-- | The way that your Amazon QuickSight account is authenticated.
accountInfo_authenticationType :: Lens.Lens' AccountInfo (Prelude.Maybe Prelude.Text)
accountInfo_authenticationType :: Lens' AccountInfo (Maybe Text)
accountInfo_authenticationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountInfo' {Maybe Text
authenticationType :: Maybe Text
$sel:authenticationType:AccountInfo' :: AccountInfo -> Maybe Text
authenticationType} -> Maybe Text
authenticationType) (\s :: AccountInfo
s@AccountInfo' {} Maybe Text
a -> AccountInfo
s {$sel:authenticationType:AccountInfo' :: Maybe Text
authenticationType = Maybe Text
a} :: AccountInfo)

-- | The edition of your Amazon QuickSight account.
accountInfo_edition :: Lens.Lens' AccountInfo (Prelude.Maybe Edition)
accountInfo_edition :: Lens' AccountInfo (Maybe Edition)
accountInfo_edition = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountInfo' {Maybe Edition
edition :: Maybe Edition
$sel:edition:AccountInfo' :: AccountInfo -> Maybe Edition
edition} -> Maybe Edition
edition) (\s :: AccountInfo
s@AccountInfo' {} Maybe Edition
a -> AccountInfo
s {$sel:edition:AccountInfo' :: Maybe Edition
edition = Maybe Edition
a} :: AccountInfo)

-- | The email address that will be used for Amazon QuickSight to send
-- notifications regarding your Amazon Web Services account or Amazon
-- QuickSight subscription.
accountInfo_notificationEmail :: Lens.Lens' AccountInfo (Prelude.Maybe Prelude.Text)
accountInfo_notificationEmail :: Lens' AccountInfo (Maybe Text)
accountInfo_notificationEmail = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountInfo' {Maybe Text
notificationEmail :: Maybe Text
$sel:notificationEmail:AccountInfo' :: AccountInfo -> Maybe Text
notificationEmail} -> Maybe Text
notificationEmail) (\s :: AccountInfo
s@AccountInfo' {} Maybe Text
a -> AccountInfo
s {$sel:notificationEmail:AccountInfo' :: Maybe Text
notificationEmail = Maybe Text
a} :: AccountInfo)

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

instance Prelude.Hashable AccountInfo where
  hashWithSalt :: Int -> AccountInfo -> Int
hashWithSalt Int
_salt AccountInfo' {Maybe Text
Maybe Edition
notificationEmail :: Maybe Text
edition :: Maybe Edition
authenticationType :: Maybe Text
accountSubscriptionStatus :: Maybe Text
accountName :: Maybe Text
$sel:notificationEmail:AccountInfo' :: AccountInfo -> Maybe Text
$sel:edition:AccountInfo' :: AccountInfo -> Maybe Edition
$sel:authenticationType:AccountInfo' :: AccountInfo -> Maybe Text
$sel:accountSubscriptionStatus:AccountInfo' :: AccountInfo -> Maybe Text
$sel:accountName:AccountInfo' :: AccountInfo -> 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
accountSubscriptionStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
authenticationType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Edition
edition
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
notificationEmail

instance Prelude.NFData AccountInfo where
  rnf :: AccountInfo -> ()
rnf AccountInfo' {Maybe Text
Maybe Edition
notificationEmail :: Maybe Text
edition :: Maybe Edition
authenticationType :: Maybe Text
accountSubscriptionStatus :: Maybe Text
accountName :: Maybe Text
$sel:notificationEmail:AccountInfo' :: AccountInfo -> Maybe Text
$sel:edition:AccountInfo' :: AccountInfo -> Maybe Edition
$sel:authenticationType:AccountInfo' :: AccountInfo -> Maybe Text
$sel:accountSubscriptionStatus:AccountInfo' :: AccountInfo -> Maybe Text
$sel:accountName:AccountInfo' :: AccountInfo -> 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
accountSubscriptionStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authenticationType
      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