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

-- | A @SignupResponse@ object that contains a summary of a newly created
-- account.
--
-- /See:/ 'newSignupResponse' smart constructor.
data SignupResponse = SignupResponse'
  { -- | A Boolean that is @TRUE@ if the Amazon QuickSight uses IAM as an
    -- authentication method.
    SignupResponse -> Maybe Bool
iAMUser :: Prelude.Maybe Prelude.Bool,
    -- | The name of your Amazon QuickSight account.
    SignupResponse -> Maybe Text
accountName :: Prelude.Maybe Prelude.Text,
    -- | The type of Active Directory that is being used to authenticate the
    -- Amazon QuickSight account. Valid values are @SIMPLE_AD@, @AD_CONNECTOR@,
    -- and @MICROSOFT_AD@.
    SignupResponse -> Maybe Text
directoryType :: Prelude.Maybe Prelude.Text,
    -- | The user login name for your Amazon QuickSight account.
    SignupResponse -> Maybe Text
userLoginName :: Prelude.Maybe Prelude.Text
  }
  deriving (SignupResponse -> SignupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignupResponse -> SignupResponse -> Bool
$c/= :: SignupResponse -> SignupResponse -> Bool
== :: SignupResponse -> SignupResponse -> Bool
$c== :: SignupResponse -> SignupResponse -> Bool
Prelude.Eq, ReadPrec [SignupResponse]
ReadPrec SignupResponse
Int -> ReadS SignupResponse
ReadS [SignupResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SignupResponse]
$creadListPrec :: ReadPrec [SignupResponse]
readPrec :: ReadPrec SignupResponse
$creadPrec :: ReadPrec SignupResponse
readList :: ReadS [SignupResponse]
$creadList :: ReadS [SignupResponse]
readsPrec :: Int -> ReadS SignupResponse
$creadsPrec :: Int -> ReadS SignupResponse
Prelude.Read, Int -> SignupResponse -> ShowS
[SignupResponse] -> ShowS
SignupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SignupResponse] -> ShowS
$cshowList :: [SignupResponse] -> ShowS
show :: SignupResponse -> String
$cshow :: SignupResponse -> String
showsPrec :: Int -> SignupResponse -> ShowS
$cshowsPrec :: Int -> SignupResponse -> ShowS
Prelude.Show, forall x. Rep SignupResponse x -> SignupResponse
forall x. SignupResponse -> Rep SignupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SignupResponse x -> SignupResponse
$cfrom :: forall x. SignupResponse -> Rep SignupResponse x
Prelude.Generic)

-- |
-- Create a value of 'SignupResponse' 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:
--
-- 'iAMUser', 'signupResponse_iAMUser' - A Boolean that is @TRUE@ if the Amazon QuickSight uses IAM as an
-- authentication method.
--
-- 'accountName', 'signupResponse_accountName' - The name of your Amazon QuickSight account.
--
-- 'directoryType', 'signupResponse_directoryType' - The type of Active Directory that is being used to authenticate the
-- Amazon QuickSight account. Valid values are @SIMPLE_AD@, @AD_CONNECTOR@,
-- and @MICROSOFT_AD@.
--
-- 'userLoginName', 'signupResponse_userLoginName' - The user login name for your Amazon QuickSight account.
newSignupResponse ::
  SignupResponse
newSignupResponse :: SignupResponse
newSignupResponse =
  SignupResponse'
    { $sel:iAMUser:SignupResponse' :: Maybe Bool
iAMUser = forall a. Maybe a
Prelude.Nothing,
      $sel:accountName:SignupResponse' :: Maybe Text
accountName = forall a. Maybe a
Prelude.Nothing,
      $sel:directoryType:SignupResponse' :: Maybe Text
directoryType = forall a. Maybe a
Prelude.Nothing,
      $sel:userLoginName:SignupResponse' :: Maybe Text
userLoginName = forall a. Maybe a
Prelude.Nothing
    }

-- | A Boolean that is @TRUE@ if the Amazon QuickSight uses IAM as an
-- authentication method.
signupResponse_iAMUser :: Lens.Lens' SignupResponse (Prelude.Maybe Prelude.Bool)
signupResponse_iAMUser :: Lens' SignupResponse (Maybe Bool)
signupResponse_iAMUser = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignupResponse' {Maybe Bool
iAMUser :: Maybe Bool
$sel:iAMUser:SignupResponse' :: SignupResponse -> Maybe Bool
iAMUser} -> Maybe Bool
iAMUser) (\s :: SignupResponse
s@SignupResponse' {} Maybe Bool
a -> SignupResponse
s {$sel:iAMUser:SignupResponse' :: Maybe Bool
iAMUser = Maybe Bool
a} :: SignupResponse)

-- | The name of your Amazon QuickSight account.
signupResponse_accountName :: Lens.Lens' SignupResponse (Prelude.Maybe Prelude.Text)
signupResponse_accountName :: Lens' SignupResponse (Maybe Text)
signupResponse_accountName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignupResponse' {Maybe Text
accountName :: Maybe Text
$sel:accountName:SignupResponse' :: SignupResponse -> Maybe Text
accountName} -> Maybe Text
accountName) (\s :: SignupResponse
s@SignupResponse' {} Maybe Text
a -> SignupResponse
s {$sel:accountName:SignupResponse' :: Maybe Text
accountName = Maybe Text
a} :: SignupResponse)

-- | The type of Active Directory that is being used to authenticate the
-- Amazon QuickSight account. Valid values are @SIMPLE_AD@, @AD_CONNECTOR@,
-- and @MICROSOFT_AD@.
signupResponse_directoryType :: Lens.Lens' SignupResponse (Prelude.Maybe Prelude.Text)
signupResponse_directoryType :: Lens' SignupResponse (Maybe Text)
signupResponse_directoryType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignupResponse' {Maybe Text
directoryType :: Maybe Text
$sel:directoryType:SignupResponse' :: SignupResponse -> Maybe Text
directoryType} -> Maybe Text
directoryType) (\s :: SignupResponse
s@SignupResponse' {} Maybe Text
a -> SignupResponse
s {$sel:directoryType:SignupResponse' :: Maybe Text
directoryType = Maybe Text
a} :: SignupResponse)

-- | The user login name for your Amazon QuickSight account.
signupResponse_userLoginName :: Lens.Lens' SignupResponse (Prelude.Maybe Prelude.Text)
signupResponse_userLoginName :: Lens' SignupResponse (Maybe Text)
signupResponse_userLoginName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignupResponse' {Maybe Text
userLoginName :: Maybe Text
$sel:userLoginName:SignupResponse' :: SignupResponse -> Maybe Text
userLoginName} -> Maybe Text
userLoginName) (\s :: SignupResponse
s@SignupResponse' {} Maybe Text
a -> SignupResponse
s {$sel:userLoginName:SignupResponse' :: Maybe Text
userLoginName = Maybe Text
a} :: SignupResponse)

instance Data.FromJSON SignupResponse where
  parseJSON :: Value -> Parser SignupResponse
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SignupResponse"
      ( \Object
x ->
          Maybe Bool
-> Maybe Text -> Maybe Text -> Maybe Text -> SignupResponse
SignupResponse'
            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
"IAMUser")
            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
"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
"directoryType")
            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
"userLoginName")
      )

instance Prelude.Hashable SignupResponse where
  hashWithSalt :: Int -> SignupResponse -> Int
hashWithSalt Int
_salt SignupResponse' {Maybe Bool
Maybe Text
userLoginName :: Maybe Text
directoryType :: Maybe Text
accountName :: Maybe Text
iAMUser :: Maybe Bool
$sel:userLoginName:SignupResponse' :: SignupResponse -> Maybe Text
$sel:directoryType:SignupResponse' :: SignupResponse -> Maybe Text
$sel:accountName:SignupResponse' :: SignupResponse -> Maybe Text
$sel:iAMUser:SignupResponse' :: SignupResponse -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
iAMUser
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accountName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
directoryType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
userLoginName

instance Prelude.NFData SignupResponse where
  rnf :: SignupResponse -> ()
rnf SignupResponse' {Maybe Bool
Maybe Text
userLoginName :: Maybe Text
directoryType :: Maybe Text
accountName :: Maybe Text
iAMUser :: Maybe Bool
$sel:userLoginName:SignupResponse' :: SignupResponse -> Maybe Text
$sel:directoryType:SignupResponse' :: SignupResponse -> Maybe Text
$sel:accountName:SignupResponse' :: SignupResponse -> Maybe Text
$sel:iAMUser:SignupResponse' :: SignupResponse -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
iAMUser
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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
directoryType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userLoginName