{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.CreateAccountSubscription
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an Amazon QuickSight account, or subscribes to Amazon QuickSight
-- Q.
--
-- The Amazon Web Services Region for the account is derived from what is
-- configured in the CLI or SDK. This operation isn\'t supported in the US
-- East (Ohio) Region, South America (Sao Paulo) Region, or Asia Pacific
-- (Singapore) Region.
--
-- Before you use this operation, make sure that you can connect to an
-- existing Amazon Web Services account. If you don\'t have an Amazon Web
-- Services account, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/setting-up-aws-sign-up.html Sign up for Amazon Web Services>
-- in the /Amazon QuickSight User Guide/. The person who signs up for
-- Amazon QuickSight needs to have the correct Identity and Access
-- Management (IAM) permissions. For more information, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/iam-policy-examples.html IAM Policy Examples for Amazon QuickSight>
-- in the /Amazon QuickSight User Guide/.
--
-- If your IAM policy includes both the @Subscribe@ and
-- @CreateAccountSubscription@ actions, make sure that both actions are set
-- to @Allow@. If either action is set to @Deny@, the @Deny@ action
-- prevails and your API call fails.
--
-- You can\'t pass an existing IAM role to access other Amazon Web Services
-- services using this API operation. To pass your existing IAM role to
-- Amazon QuickSight, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/security_iam_service-with-iam.html#security-create-iam-role Passing IAM roles to Amazon QuickSight>
-- in the /Amazon QuickSight User Guide/.
--
-- You can\'t set default resource access on the new account from the
-- Amazon QuickSight API. Instead, add default resource access from the
-- Amazon QuickSight console. For more information about setting default
-- resource access to Amazon Web Services services, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/scoping-policies-defaults.html Setting default resource access to Amazon Web Services services>
-- in the /Amazon QuickSight User Guide/.
module Amazonka.QuickSight.CreateAccountSubscription
  ( -- * Creating a Request
    CreateAccountSubscription (..),
    newCreateAccountSubscription,

    -- * Request Lenses
    createAccountSubscription_activeDirectoryName,
    createAccountSubscription_adminGroup,
    createAccountSubscription_authorGroup,
    createAccountSubscription_contactNumber,
    createAccountSubscription_directoryId,
    createAccountSubscription_emailAddress,
    createAccountSubscription_firstName,
    createAccountSubscription_lastName,
    createAccountSubscription_readerGroup,
    createAccountSubscription_realm,
    createAccountSubscription_edition,
    createAccountSubscription_authenticationMethod,
    createAccountSubscription_awsAccountId,
    createAccountSubscription_accountName,
    createAccountSubscription_notificationEmail,

    -- * Destructuring the Response
    CreateAccountSubscriptionResponse (..),
    newCreateAccountSubscriptionResponse,

    -- * Response Lenses
    createAccountSubscriptionResponse_requestId,
    createAccountSubscriptionResponse_signupResponse,
    createAccountSubscriptionResponse_status,
  )
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateAccountSubscription' smart constructor.
data CreateAccountSubscription = CreateAccountSubscription'
  { -- | The name of your Active Directory. This field is required if
    -- @ACTIVE_DIRECTORY@ is the selected authentication method of the new
    -- Amazon QuickSight account.
    CreateAccountSubscription -> Maybe Text
activeDirectoryName :: Prelude.Maybe Prelude.Text,
    -- | The admin group associated with your Active Directory. This field is
    -- required if @ACTIVE_DIRECTORY@ is the selected authentication method of
    -- the new Amazon QuickSight account. For more information about using
    -- Active Directory in Amazon QuickSight, see
    -- <https://docs.aws.amazon.com/quicksight/latest/user/aws-directory-service.html Using Active Directory with Amazon QuickSight Enterprise Edition>
    -- in the Amazon QuickSight User Guide.
    CreateAccountSubscription -> Maybe [Text]
adminGroup :: Prelude.Maybe [Prelude.Text],
    -- | The author group associated with your Active Directory. For more
    -- information about using Active Directory in Amazon QuickSight, see
    -- <https://docs.aws.amazon.com/quicksight/latest/user/aws-directory-service.html Using Active Directory with Amazon QuickSight Enterprise Edition>
    -- in the Amazon QuickSight User Guide.
    CreateAccountSubscription -> Maybe [Text]
authorGroup :: Prelude.Maybe [Prelude.Text],
    -- | A 10-digit phone number for the author of the Amazon QuickSight account
    -- to use for future communications. This field is required if
    -- @ENTERPPRISE_AND_Q@ is the selected edition of the new Amazon QuickSight
    -- account.
    CreateAccountSubscription -> Maybe Text
contactNumber :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Active Directory that is associated with your Amazon
    -- QuickSight account.
    CreateAccountSubscription -> Maybe Text
directoryId :: Prelude.Maybe Prelude.Text,
    -- | The email address of the author of the Amazon QuickSight account to use
    -- for future communications. This field is required if @ENTERPPRISE_AND_Q@
    -- is the selected edition of the new Amazon QuickSight account.
    CreateAccountSubscription -> Maybe Text
emailAddress :: Prelude.Maybe Prelude.Text,
    -- | The first name of the author of the Amazon QuickSight account to use for
    -- future communications. This field is required if @ENTERPPRISE_AND_Q@ is
    -- the selected edition of the new Amazon QuickSight account.
    CreateAccountSubscription -> Maybe Text
firstName :: Prelude.Maybe Prelude.Text,
    -- | The last name of the author of the Amazon QuickSight account to use for
    -- future communications. This field is required if @ENTERPPRISE_AND_Q@ is
    -- the selected edition of the new Amazon QuickSight account.
    CreateAccountSubscription -> Maybe Text
lastName :: Prelude.Maybe Prelude.Text,
    -- | The reader group associated with your Active Direcrtory. For more
    -- information about using Active Directory in Amazon QuickSight, see
    -- <https://docs.aws.amazon.com/quicksight/latest/user/aws-directory-service.html Using Active Directory with Amazon QuickSight Enterprise Edition>
    -- in the /Amazon QuickSight User Guide/.
    CreateAccountSubscription -> Maybe [Text]
readerGroup :: Prelude.Maybe [Prelude.Text],
    -- | The realm of the Active Directory that is associated with your Amazon
    -- QuickSight account. This field is required if @ACTIVE_DIRECTORY@ is the
    -- selected authentication method of the new Amazon QuickSight account.
    CreateAccountSubscription -> Maybe Text
realm :: Prelude.Maybe Prelude.Text,
    -- | The edition of Amazon QuickSight that you want your account to have.
    -- Currently, you can choose from @ENTERPRISE@ or @ENTERPRISE_AND_Q@.
    --
    -- If you choose @ENTERPRISE_AND_Q@, the following parameters are required:
    --
    -- -   @FirstName@
    --
    -- -   @LastName@
    --
    -- -   @EmailAddress@
    --
    -- -   @ContactNumber@
    CreateAccountSubscription -> Edition
edition :: Edition,
    -- | The method that you want to use to authenticate your Amazon QuickSight
    -- account. Currently, the valid values for this parameter are
    -- @IAM_AND_QUICKSIGHT@, @IAM_ONLY@, and @ACTIVE_DIRECTORY@.
    --
    -- If you choose @ACTIVE_DIRECTORY@, provide an @ActiveDirectoryName@ and
    -- an @AdminGroup@ associated with your Active Directory.
    CreateAccountSubscription -> AuthenticationMethodOption
authenticationMethod :: AuthenticationMethodOption,
    -- | The Amazon Web Services account ID of the account that you\'re using to
    -- create your Amazon QuickSight account.
    CreateAccountSubscription -> Text
awsAccountId :: Prelude.Text,
    -- | The name of your Amazon QuickSight account. This name is unique over all
    -- of Amazon Web Services, and it appears only when users sign in. You
    -- can\'t change @AccountName@ value after the Amazon QuickSight account is
    -- created.
    CreateAccountSubscription -> Text
accountName :: Prelude.Text,
    -- | The email address that you want Amazon QuickSight to send notifications
    -- to regarding your Amazon QuickSight account or Amazon QuickSight
    -- subscription.
    CreateAccountSubscription -> Text
notificationEmail :: Prelude.Text
  }
  deriving (CreateAccountSubscription -> CreateAccountSubscription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAccountSubscription -> CreateAccountSubscription -> Bool
$c/= :: CreateAccountSubscription -> CreateAccountSubscription -> Bool
== :: CreateAccountSubscription -> CreateAccountSubscription -> Bool
$c== :: CreateAccountSubscription -> CreateAccountSubscription -> Bool
Prelude.Eq, ReadPrec [CreateAccountSubscription]
ReadPrec CreateAccountSubscription
Int -> ReadS CreateAccountSubscription
ReadS [CreateAccountSubscription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAccountSubscription]
$creadListPrec :: ReadPrec [CreateAccountSubscription]
readPrec :: ReadPrec CreateAccountSubscription
$creadPrec :: ReadPrec CreateAccountSubscription
readList :: ReadS [CreateAccountSubscription]
$creadList :: ReadS [CreateAccountSubscription]
readsPrec :: Int -> ReadS CreateAccountSubscription
$creadsPrec :: Int -> ReadS CreateAccountSubscription
Prelude.Read, Int -> CreateAccountSubscription -> ShowS
[CreateAccountSubscription] -> ShowS
CreateAccountSubscription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAccountSubscription] -> ShowS
$cshowList :: [CreateAccountSubscription] -> ShowS
show :: CreateAccountSubscription -> String
$cshow :: CreateAccountSubscription -> String
showsPrec :: Int -> CreateAccountSubscription -> ShowS
$cshowsPrec :: Int -> CreateAccountSubscription -> ShowS
Prelude.Show, forall x.
Rep CreateAccountSubscription x -> CreateAccountSubscription
forall x.
CreateAccountSubscription -> Rep CreateAccountSubscription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAccountSubscription x -> CreateAccountSubscription
$cfrom :: forall x.
CreateAccountSubscription -> Rep CreateAccountSubscription x
Prelude.Generic)

-- |
-- Create a value of 'CreateAccountSubscription' 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:
--
-- 'activeDirectoryName', 'createAccountSubscription_activeDirectoryName' - The name of your Active Directory. This field is required if
-- @ACTIVE_DIRECTORY@ is the selected authentication method of the new
-- Amazon QuickSight account.
--
-- 'adminGroup', 'createAccountSubscription_adminGroup' - The admin group associated with your Active Directory. This field is
-- required if @ACTIVE_DIRECTORY@ is the selected authentication method of
-- the new Amazon QuickSight account. For more information about using
-- Active Directory in Amazon QuickSight, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/aws-directory-service.html Using Active Directory with Amazon QuickSight Enterprise Edition>
-- in the Amazon QuickSight User Guide.
--
-- 'authorGroup', 'createAccountSubscription_authorGroup' - The author group associated with your Active Directory. For more
-- information about using Active Directory in Amazon QuickSight, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/aws-directory-service.html Using Active Directory with Amazon QuickSight Enterprise Edition>
-- in the Amazon QuickSight User Guide.
--
-- 'contactNumber', 'createAccountSubscription_contactNumber' - A 10-digit phone number for the author of the Amazon QuickSight account
-- to use for future communications. This field is required if
-- @ENTERPPRISE_AND_Q@ is the selected edition of the new Amazon QuickSight
-- account.
--
-- 'directoryId', 'createAccountSubscription_directoryId' - The ID of the Active Directory that is associated with your Amazon
-- QuickSight account.
--
-- 'emailAddress', 'createAccountSubscription_emailAddress' - The email address of the author of the Amazon QuickSight account to use
-- for future communications. This field is required if @ENTERPPRISE_AND_Q@
-- is the selected edition of the new Amazon QuickSight account.
--
-- 'firstName', 'createAccountSubscription_firstName' - The first name of the author of the Amazon QuickSight account to use for
-- future communications. This field is required if @ENTERPPRISE_AND_Q@ is
-- the selected edition of the new Amazon QuickSight account.
--
-- 'lastName', 'createAccountSubscription_lastName' - The last name of the author of the Amazon QuickSight account to use for
-- future communications. This field is required if @ENTERPPRISE_AND_Q@ is
-- the selected edition of the new Amazon QuickSight account.
--
-- 'readerGroup', 'createAccountSubscription_readerGroup' - The reader group associated with your Active Direcrtory. For more
-- information about using Active Directory in Amazon QuickSight, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/aws-directory-service.html Using Active Directory with Amazon QuickSight Enterprise Edition>
-- in the /Amazon QuickSight User Guide/.
--
-- 'realm', 'createAccountSubscription_realm' - The realm of the Active Directory that is associated with your Amazon
-- QuickSight account. This field is required if @ACTIVE_DIRECTORY@ is the
-- selected authentication method of the new Amazon QuickSight account.
--
-- 'edition', 'createAccountSubscription_edition' - The edition of Amazon QuickSight that you want your account to have.
-- Currently, you can choose from @ENTERPRISE@ or @ENTERPRISE_AND_Q@.
--
-- If you choose @ENTERPRISE_AND_Q@, the following parameters are required:
--
-- -   @FirstName@
--
-- -   @LastName@
--
-- -   @EmailAddress@
--
-- -   @ContactNumber@
--
-- 'authenticationMethod', 'createAccountSubscription_authenticationMethod' - The method that you want to use to authenticate your Amazon QuickSight
-- account. Currently, the valid values for this parameter are
-- @IAM_AND_QUICKSIGHT@, @IAM_ONLY@, and @ACTIVE_DIRECTORY@.
--
-- If you choose @ACTIVE_DIRECTORY@, provide an @ActiveDirectoryName@ and
-- an @AdminGroup@ associated with your Active Directory.
--
-- 'awsAccountId', 'createAccountSubscription_awsAccountId' - The Amazon Web Services account ID of the account that you\'re using to
-- create your Amazon QuickSight account.
--
-- 'accountName', 'createAccountSubscription_accountName' - The name of your Amazon QuickSight account. This name is unique over all
-- of Amazon Web Services, and it appears only when users sign in. You
-- can\'t change @AccountName@ value after the Amazon QuickSight account is
-- created.
--
-- 'notificationEmail', 'createAccountSubscription_notificationEmail' - The email address that you want Amazon QuickSight to send notifications
-- to regarding your Amazon QuickSight account or Amazon QuickSight
-- subscription.
newCreateAccountSubscription ::
  -- | 'edition'
  Edition ->
  -- | 'authenticationMethod'
  AuthenticationMethodOption ->
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'accountName'
  Prelude.Text ->
  -- | 'notificationEmail'
  Prelude.Text ->
  CreateAccountSubscription
newCreateAccountSubscription :: Edition
-> AuthenticationMethodOption
-> Text
-> Text
-> Text
-> CreateAccountSubscription
newCreateAccountSubscription
  Edition
pEdition_
  AuthenticationMethodOption
pAuthenticationMethod_
  Text
pAwsAccountId_
  Text
pAccountName_
  Text
pNotificationEmail_ =
    CreateAccountSubscription'
      { $sel:activeDirectoryName:CreateAccountSubscription' :: Maybe Text
activeDirectoryName =
          forall a. Maybe a
Prelude.Nothing,
        $sel:adminGroup:CreateAccountSubscription' :: Maybe [Text]
adminGroup = forall a. Maybe a
Prelude.Nothing,
        $sel:authorGroup:CreateAccountSubscription' :: Maybe [Text]
authorGroup = forall a. Maybe a
Prelude.Nothing,
        $sel:contactNumber:CreateAccountSubscription' :: Maybe Text
contactNumber = forall a. Maybe a
Prelude.Nothing,
        $sel:directoryId:CreateAccountSubscription' :: Maybe Text
directoryId = forall a. Maybe a
Prelude.Nothing,
        $sel:emailAddress:CreateAccountSubscription' :: Maybe Text
emailAddress = forall a. Maybe a
Prelude.Nothing,
        $sel:firstName:CreateAccountSubscription' :: Maybe Text
firstName = forall a. Maybe a
Prelude.Nothing,
        $sel:lastName:CreateAccountSubscription' :: Maybe Text
lastName = forall a. Maybe a
Prelude.Nothing,
        $sel:readerGroup:CreateAccountSubscription' :: Maybe [Text]
readerGroup = forall a. Maybe a
Prelude.Nothing,
        $sel:realm:CreateAccountSubscription' :: Maybe Text
realm = forall a. Maybe a
Prelude.Nothing,
        $sel:edition:CreateAccountSubscription' :: Edition
edition = Edition
pEdition_,
        $sel:authenticationMethod:CreateAccountSubscription' :: AuthenticationMethodOption
authenticationMethod = AuthenticationMethodOption
pAuthenticationMethod_,
        $sel:awsAccountId:CreateAccountSubscription' :: Text
awsAccountId = Text
pAwsAccountId_,
        $sel:accountName:CreateAccountSubscription' :: Text
accountName = Text
pAccountName_,
        $sel:notificationEmail:CreateAccountSubscription' :: Text
notificationEmail = Text
pNotificationEmail_
      }

-- | The name of your Active Directory. This field is required if
-- @ACTIVE_DIRECTORY@ is the selected authentication method of the new
-- Amazon QuickSight account.
createAccountSubscription_activeDirectoryName :: Lens.Lens' CreateAccountSubscription (Prelude.Maybe Prelude.Text)
createAccountSubscription_activeDirectoryName :: Lens' CreateAccountSubscription (Maybe Text)
createAccountSubscription_activeDirectoryName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscription' {Maybe Text
activeDirectoryName :: Maybe Text
$sel:activeDirectoryName:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
activeDirectoryName} -> Maybe Text
activeDirectoryName) (\s :: CreateAccountSubscription
s@CreateAccountSubscription' {} Maybe Text
a -> CreateAccountSubscription
s {$sel:activeDirectoryName:CreateAccountSubscription' :: Maybe Text
activeDirectoryName = Maybe Text
a} :: CreateAccountSubscription)

-- | The admin group associated with your Active Directory. This field is
-- required if @ACTIVE_DIRECTORY@ is the selected authentication method of
-- the new Amazon QuickSight account. For more information about using
-- Active Directory in Amazon QuickSight, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/aws-directory-service.html Using Active Directory with Amazon QuickSight Enterprise Edition>
-- in the Amazon QuickSight User Guide.
createAccountSubscription_adminGroup :: Lens.Lens' CreateAccountSubscription (Prelude.Maybe [Prelude.Text])
createAccountSubscription_adminGroup :: Lens' CreateAccountSubscription (Maybe [Text])
createAccountSubscription_adminGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscription' {Maybe [Text]
adminGroup :: Maybe [Text]
$sel:adminGroup:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe [Text]
adminGroup} -> Maybe [Text]
adminGroup) (\s :: CreateAccountSubscription
s@CreateAccountSubscription' {} Maybe [Text]
a -> CreateAccountSubscription
s {$sel:adminGroup:CreateAccountSubscription' :: Maybe [Text]
adminGroup = Maybe [Text]
a} :: CreateAccountSubscription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The author group associated with your Active Directory. For more
-- information about using Active Directory in Amazon QuickSight, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/aws-directory-service.html Using Active Directory with Amazon QuickSight Enterprise Edition>
-- in the Amazon QuickSight User Guide.
createAccountSubscription_authorGroup :: Lens.Lens' CreateAccountSubscription (Prelude.Maybe [Prelude.Text])
createAccountSubscription_authorGroup :: Lens' CreateAccountSubscription (Maybe [Text])
createAccountSubscription_authorGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscription' {Maybe [Text]
authorGroup :: Maybe [Text]
$sel:authorGroup:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe [Text]
authorGroup} -> Maybe [Text]
authorGroup) (\s :: CreateAccountSubscription
s@CreateAccountSubscription' {} Maybe [Text]
a -> CreateAccountSubscription
s {$sel:authorGroup:CreateAccountSubscription' :: Maybe [Text]
authorGroup = Maybe [Text]
a} :: CreateAccountSubscription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A 10-digit phone number for the author of the Amazon QuickSight account
-- to use for future communications. This field is required if
-- @ENTERPPRISE_AND_Q@ is the selected edition of the new Amazon QuickSight
-- account.
createAccountSubscription_contactNumber :: Lens.Lens' CreateAccountSubscription (Prelude.Maybe Prelude.Text)
createAccountSubscription_contactNumber :: Lens' CreateAccountSubscription (Maybe Text)
createAccountSubscription_contactNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscription' {Maybe Text
contactNumber :: Maybe Text
$sel:contactNumber:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
contactNumber} -> Maybe Text
contactNumber) (\s :: CreateAccountSubscription
s@CreateAccountSubscription' {} Maybe Text
a -> CreateAccountSubscription
s {$sel:contactNumber:CreateAccountSubscription' :: Maybe Text
contactNumber = Maybe Text
a} :: CreateAccountSubscription)

-- | The ID of the Active Directory that is associated with your Amazon
-- QuickSight account.
createAccountSubscription_directoryId :: Lens.Lens' CreateAccountSubscription (Prelude.Maybe Prelude.Text)
createAccountSubscription_directoryId :: Lens' CreateAccountSubscription (Maybe Text)
createAccountSubscription_directoryId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscription' {Maybe Text
directoryId :: Maybe Text
$sel:directoryId:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
directoryId} -> Maybe Text
directoryId) (\s :: CreateAccountSubscription
s@CreateAccountSubscription' {} Maybe Text
a -> CreateAccountSubscription
s {$sel:directoryId:CreateAccountSubscription' :: Maybe Text
directoryId = Maybe Text
a} :: CreateAccountSubscription)

-- | The email address of the author of the Amazon QuickSight account to use
-- for future communications. This field is required if @ENTERPPRISE_AND_Q@
-- is the selected edition of the new Amazon QuickSight account.
createAccountSubscription_emailAddress :: Lens.Lens' CreateAccountSubscription (Prelude.Maybe Prelude.Text)
createAccountSubscription_emailAddress :: Lens' CreateAccountSubscription (Maybe Text)
createAccountSubscription_emailAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscription' {Maybe Text
emailAddress :: Maybe Text
$sel:emailAddress:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
emailAddress} -> Maybe Text
emailAddress) (\s :: CreateAccountSubscription
s@CreateAccountSubscription' {} Maybe Text
a -> CreateAccountSubscription
s {$sel:emailAddress:CreateAccountSubscription' :: Maybe Text
emailAddress = Maybe Text
a} :: CreateAccountSubscription)

-- | The first name of the author of the Amazon QuickSight account to use for
-- future communications. This field is required if @ENTERPPRISE_AND_Q@ is
-- the selected edition of the new Amazon QuickSight account.
createAccountSubscription_firstName :: Lens.Lens' CreateAccountSubscription (Prelude.Maybe Prelude.Text)
createAccountSubscription_firstName :: Lens' CreateAccountSubscription (Maybe Text)
createAccountSubscription_firstName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscription' {Maybe Text
firstName :: Maybe Text
$sel:firstName:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
firstName} -> Maybe Text
firstName) (\s :: CreateAccountSubscription
s@CreateAccountSubscription' {} Maybe Text
a -> CreateAccountSubscription
s {$sel:firstName:CreateAccountSubscription' :: Maybe Text
firstName = Maybe Text
a} :: CreateAccountSubscription)

-- | The last name of the author of the Amazon QuickSight account to use for
-- future communications. This field is required if @ENTERPPRISE_AND_Q@ is
-- the selected edition of the new Amazon QuickSight account.
createAccountSubscription_lastName :: Lens.Lens' CreateAccountSubscription (Prelude.Maybe Prelude.Text)
createAccountSubscription_lastName :: Lens' CreateAccountSubscription (Maybe Text)
createAccountSubscription_lastName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscription' {Maybe Text
lastName :: Maybe Text
$sel:lastName:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
lastName} -> Maybe Text
lastName) (\s :: CreateAccountSubscription
s@CreateAccountSubscription' {} Maybe Text
a -> CreateAccountSubscription
s {$sel:lastName:CreateAccountSubscription' :: Maybe Text
lastName = Maybe Text
a} :: CreateAccountSubscription)

-- | The reader group associated with your Active Direcrtory. For more
-- information about using Active Directory in Amazon QuickSight, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/aws-directory-service.html Using Active Directory with Amazon QuickSight Enterprise Edition>
-- in the /Amazon QuickSight User Guide/.
createAccountSubscription_readerGroup :: Lens.Lens' CreateAccountSubscription (Prelude.Maybe [Prelude.Text])
createAccountSubscription_readerGroup :: Lens' CreateAccountSubscription (Maybe [Text])
createAccountSubscription_readerGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscription' {Maybe [Text]
readerGroup :: Maybe [Text]
$sel:readerGroup:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe [Text]
readerGroup} -> Maybe [Text]
readerGroup) (\s :: CreateAccountSubscription
s@CreateAccountSubscription' {} Maybe [Text]
a -> CreateAccountSubscription
s {$sel:readerGroup:CreateAccountSubscription' :: Maybe [Text]
readerGroup = Maybe [Text]
a} :: CreateAccountSubscription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The realm of the Active Directory that is associated with your Amazon
-- QuickSight account. This field is required if @ACTIVE_DIRECTORY@ is the
-- selected authentication method of the new Amazon QuickSight account.
createAccountSubscription_realm :: Lens.Lens' CreateAccountSubscription (Prelude.Maybe Prelude.Text)
createAccountSubscription_realm :: Lens' CreateAccountSubscription (Maybe Text)
createAccountSubscription_realm = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscription' {Maybe Text
realm :: Maybe Text
$sel:realm:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
realm} -> Maybe Text
realm) (\s :: CreateAccountSubscription
s@CreateAccountSubscription' {} Maybe Text
a -> CreateAccountSubscription
s {$sel:realm:CreateAccountSubscription' :: Maybe Text
realm = Maybe Text
a} :: CreateAccountSubscription)

-- | The edition of Amazon QuickSight that you want your account to have.
-- Currently, you can choose from @ENTERPRISE@ or @ENTERPRISE_AND_Q@.
--
-- If you choose @ENTERPRISE_AND_Q@, the following parameters are required:
--
-- -   @FirstName@
--
-- -   @LastName@
--
-- -   @EmailAddress@
--
-- -   @ContactNumber@
createAccountSubscription_edition :: Lens.Lens' CreateAccountSubscription Edition
createAccountSubscription_edition :: Lens' CreateAccountSubscription Edition
createAccountSubscription_edition = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscription' {Edition
edition :: Edition
$sel:edition:CreateAccountSubscription' :: CreateAccountSubscription -> Edition
edition} -> Edition
edition) (\s :: CreateAccountSubscription
s@CreateAccountSubscription' {} Edition
a -> CreateAccountSubscription
s {$sel:edition:CreateAccountSubscription' :: Edition
edition = Edition
a} :: CreateAccountSubscription)

-- | The method that you want to use to authenticate your Amazon QuickSight
-- account. Currently, the valid values for this parameter are
-- @IAM_AND_QUICKSIGHT@, @IAM_ONLY@, and @ACTIVE_DIRECTORY@.
--
-- If you choose @ACTIVE_DIRECTORY@, provide an @ActiveDirectoryName@ and
-- an @AdminGroup@ associated with your Active Directory.
createAccountSubscription_authenticationMethod :: Lens.Lens' CreateAccountSubscription AuthenticationMethodOption
createAccountSubscription_authenticationMethod :: Lens' CreateAccountSubscription AuthenticationMethodOption
createAccountSubscription_authenticationMethod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscription' {AuthenticationMethodOption
authenticationMethod :: AuthenticationMethodOption
$sel:authenticationMethod:CreateAccountSubscription' :: CreateAccountSubscription -> AuthenticationMethodOption
authenticationMethod} -> AuthenticationMethodOption
authenticationMethod) (\s :: CreateAccountSubscription
s@CreateAccountSubscription' {} AuthenticationMethodOption
a -> CreateAccountSubscription
s {$sel:authenticationMethod:CreateAccountSubscription' :: AuthenticationMethodOption
authenticationMethod = AuthenticationMethodOption
a} :: CreateAccountSubscription)

-- | The Amazon Web Services account ID of the account that you\'re using to
-- create your Amazon QuickSight account.
createAccountSubscription_awsAccountId :: Lens.Lens' CreateAccountSubscription Prelude.Text
createAccountSubscription_awsAccountId :: Lens' CreateAccountSubscription Text
createAccountSubscription_awsAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscription' {Text
awsAccountId :: Text
$sel:awsAccountId:CreateAccountSubscription' :: CreateAccountSubscription -> Text
awsAccountId} -> Text
awsAccountId) (\s :: CreateAccountSubscription
s@CreateAccountSubscription' {} Text
a -> CreateAccountSubscription
s {$sel:awsAccountId:CreateAccountSubscription' :: Text
awsAccountId = Text
a} :: CreateAccountSubscription)

-- | The name of your Amazon QuickSight account. This name is unique over all
-- of Amazon Web Services, and it appears only when users sign in. You
-- can\'t change @AccountName@ value after the Amazon QuickSight account is
-- created.
createAccountSubscription_accountName :: Lens.Lens' CreateAccountSubscription Prelude.Text
createAccountSubscription_accountName :: Lens' CreateAccountSubscription Text
createAccountSubscription_accountName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscription' {Text
accountName :: Text
$sel:accountName:CreateAccountSubscription' :: CreateAccountSubscription -> Text
accountName} -> Text
accountName) (\s :: CreateAccountSubscription
s@CreateAccountSubscription' {} Text
a -> CreateAccountSubscription
s {$sel:accountName:CreateAccountSubscription' :: Text
accountName = Text
a} :: CreateAccountSubscription)

-- | The email address that you want Amazon QuickSight to send notifications
-- to regarding your Amazon QuickSight account or Amazon QuickSight
-- subscription.
createAccountSubscription_notificationEmail :: Lens.Lens' CreateAccountSubscription Prelude.Text
createAccountSubscription_notificationEmail :: Lens' CreateAccountSubscription Text
createAccountSubscription_notificationEmail = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscription' {Text
notificationEmail :: Text
$sel:notificationEmail:CreateAccountSubscription' :: CreateAccountSubscription -> Text
notificationEmail} -> Text
notificationEmail) (\s :: CreateAccountSubscription
s@CreateAccountSubscription' {} Text
a -> CreateAccountSubscription
s {$sel:notificationEmail:CreateAccountSubscription' :: Text
notificationEmail = Text
a} :: CreateAccountSubscription)

instance Core.AWSRequest CreateAccountSubscription where
  type
    AWSResponse CreateAccountSubscription =
      CreateAccountSubscriptionResponse
  request :: (Service -> Service)
-> CreateAccountSubscription -> Request CreateAccountSubscription
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateAccountSubscription
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateAccountSubscription)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe SignupResponse -> Int -> CreateAccountSubscriptionResponse
CreateAccountSubscriptionResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RequestId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"SignupResponse")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateAccountSubscription where
  hashWithSalt :: Int -> CreateAccountSubscription -> Int
hashWithSalt Int
_salt CreateAccountSubscription' {Maybe [Text]
Maybe Text
Text
AuthenticationMethodOption
Edition
notificationEmail :: Text
accountName :: Text
awsAccountId :: Text
authenticationMethod :: AuthenticationMethodOption
edition :: Edition
realm :: Maybe Text
readerGroup :: Maybe [Text]
lastName :: Maybe Text
firstName :: Maybe Text
emailAddress :: Maybe Text
directoryId :: Maybe Text
contactNumber :: Maybe Text
authorGroup :: Maybe [Text]
adminGroup :: Maybe [Text]
activeDirectoryName :: Maybe Text
$sel:notificationEmail:CreateAccountSubscription' :: CreateAccountSubscription -> Text
$sel:accountName:CreateAccountSubscription' :: CreateAccountSubscription -> Text
$sel:awsAccountId:CreateAccountSubscription' :: CreateAccountSubscription -> Text
$sel:authenticationMethod:CreateAccountSubscription' :: CreateAccountSubscription -> AuthenticationMethodOption
$sel:edition:CreateAccountSubscription' :: CreateAccountSubscription -> Edition
$sel:realm:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:readerGroup:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe [Text]
$sel:lastName:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:firstName:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:emailAddress:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:directoryId:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:contactNumber:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:authorGroup:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe [Text]
$sel:adminGroup:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe [Text]
$sel:activeDirectoryName:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
activeDirectoryName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
adminGroup
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
authorGroup
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
contactNumber
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
directoryId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
emailAddress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
firstName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
readerGroup
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
realm
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Edition
edition
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AuthenticationMethodOption
authenticationMethod
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
awsAccountId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
accountName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
notificationEmail

instance Prelude.NFData CreateAccountSubscription where
  rnf :: CreateAccountSubscription -> ()
rnf CreateAccountSubscription' {Maybe [Text]
Maybe Text
Text
AuthenticationMethodOption
Edition
notificationEmail :: Text
accountName :: Text
awsAccountId :: Text
authenticationMethod :: AuthenticationMethodOption
edition :: Edition
realm :: Maybe Text
readerGroup :: Maybe [Text]
lastName :: Maybe Text
firstName :: Maybe Text
emailAddress :: Maybe Text
directoryId :: Maybe Text
contactNumber :: Maybe Text
authorGroup :: Maybe [Text]
adminGroup :: Maybe [Text]
activeDirectoryName :: Maybe Text
$sel:notificationEmail:CreateAccountSubscription' :: CreateAccountSubscription -> Text
$sel:accountName:CreateAccountSubscription' :: CreateAccountSubscription -> Text
$sel:awsAccountId:CreateAccountSubscription' :: CreateAccountSubscription -> Text
$sel:authenticationMethod:CreateAccountSubscription' :: CreateAccountSubscription -> AuthenticationMethodOption
$sel:edition:CreateAccountSubscription' :: CreateAccountSubscription -> Edition
$sel:realm:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:readerGroup:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe [Text]
$sel:lastName:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:firstName:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:emailAddress:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:directoryId:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:contactNumber:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:authorGroup:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe [Text]
$sel:adminGroup:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe [Text]
$sel:activeDirectoryName:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
activeDirectoryName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
adminGroup
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
authorGroup
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contactNumber
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
directoryId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
emailAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
firstName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lastName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
readerGroup
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
realm
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Edition
edition
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AuthenticationMethodOption
authenticationMethod
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
awsAccountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
accountName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
notificationEmail

instance Data.ToHeaders CreateAccountSubscription where
  toHeaders :: CreateAccountSubscription -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateAccountSubscription where
  toJSON :: CreateAccountSubscription -> Value
toJSON CreateAccountSubscription' {Maybe [Text]
Maybe Text
Text
AuthenticationMethodOption
Edition
notificationEmail :: Text
accountName :: Text
awsAccountId :: Text
authenticationMethod :: AuthenticationMethodOption
edition :: Edition
realm :: Maybe Text
readerGroup :: Maybe [Text]
lastName :: Maybe Text
firstName :: Maybe Text
emailAddress :: Maybe Text
directoryId :: Maybe Text
contactNumber :: Maybe Text
authorGroup :: Maybe [Text]
adminGroup :: Maybe [Text]
activeDirectoryName :: Maybe Text
$sel:notificationEmail:CreateAccountSubscription' :: CreateAccountSubscription -> Text
$sel:accountName:CreateAccountSubscription' :: CreateAccountSubscription -> Text
$sel:awsAccountId:CreateAccountSubscription' :: CreateAccountSubscription -> Text
$sel:authenticationMethod:CreateAccountSubscription' :: CreateAccountSubscription -> AuthenticationMethodOption
$sel:edition:CreateAccountSubscription' :: CreateAccountSubscription -> Edition
$sel:realm:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:readerGroup:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe [Text]
$sel:lastName:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:firstName:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:emailAddress:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:directoryId:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:contactNumber:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:authorGroup:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe [Text]
$sel:adminGroup:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe [Text]
$sel:activeDirectoryName:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ActiveDirectoryName" 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
activeDirectoryName,
            (Key
"AdminGroup" 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]
adminGroup,
            (Key
"AuthorGroup" 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]
authorGroup,
            (Key
"ContactNumber" 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
contactNumber,
            (Key
"DirectoryId" 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
directoryId,
            (Key
"EmailAddress" 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
emailAddress,
            (Key
"FirstName" 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
firstName,
            (Key
"LastName" 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
lastName,
            (Key
"ReaderGroup" 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]
readerGroup,
            (Key
"Realm" 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
realm,
            forall a. a -> Maybe a
Prelude.Just (Key
"Edition" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Edition
edition),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"AuthenticationMethod"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= AuthenticationMethodOption
authenticationMethod
              ),
            forall a. a -> Maybe a
Prelude.Just (Key
"AccountName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
accountName),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"NotificationEmail" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
notificationEmail)
          ]
      )

instance Data.ToPath CreateAccountSubscription where
  toPath :: CreateAccountSubscription -> ByteString
toPath CreateAccountSubscription' {Maybe [Text]
Maybe Text
Text
AuthenticationMethodOption
Edition
notificationEmail :: Text
accountName :: Text
awsAccountId :: Text
authenticationMethod :: AuthenticationMethodOption
edition :: Edition
realm :: Maybe Text
readerGroup :: Maybe [Text]
lastName :: Maybe Text
firstName :: Maybe Text
emailAddress :: Maybe Text
directoryId :: Maybe Text
contactNumber :: Maybe Text
authorGroup :: Maybe [Text]
adminGroup :: Maybe [Text]
activeDirectoryName :: Maybe Text
$sel:notificationEmail:CreateAccountSubscription' :: CreateAccountSubscription -> Text
$sel:accountName:CreateAccountSubscription' :: CreateAccountSubscription -> Text
$sel:awsAccountId:CreateAccountSubscription' :: CreateAccountSubscription -> Text
$sel:authenticationMethod:CreateAccountSubscription' :: CreateAccountSubscription -> AuthenticationMethodOption
$sel:edition:CreateAccountSubscription' :: CreateAccountSubscription -> Edition
$sel:realm:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:readerGroup:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe [Text]
$sel:lastName:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:firstName:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:emailAddress:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:directoryId:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:contactNumber:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
$sel:authorGroup:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe [Text]
$sel:adminGroup:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe [Text]
$sel:activeDirectoryName:CreateAccountSubscription' :: CreateAccountSubscription -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/account/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
awsAccountId]

instance Data.ToQuery CreateAccountSubscription where
  toQuery :: CreateAccountSubscription -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateAccountSubscriptionResponse' smart constructor.
data CreateAccountSubscriptionResponse = CreateAccountSubscriptionResponse'
  { -- | The Amazon Web Services request ID for this operation.
    CreateAccountSubscriptionResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | A @SignupResponse@ object that returns information about a newly created
    -- Amazon QuickSight account.
    CreateAccountSubscriptionResponse -> Maybe SignupResponse
signupResponse :: Prelude.Maybe SignupResponse,
    -- | The HTTP status of the request.
    CreateAccountSubscriptionResponse -> Int
status :: Prelude.Int
  }
  deriving (CreateAccountSubscriptionResponse
-> CreateAccountSubscriptionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAccountSubscriptionResponse
-> CreateAccountSubscriptionResponse -> Bool
$c/= :: CreateAccountSubscriptionResponse
-> CreateAccountSubscriptionResponse -> Bool
== :: CreateAccountSubscriptionResponse
-> CreateAccountSubscriptionResponse -> Bool
$c== :: CreateAccountSubscriptionResponse
-> CreateAccountSubscriptionResponse -> Bool
Prelude.Eq, ReadPrec [CreateAccountSubscriptionResponse]
ReadPrec CreateAccountSubscriptionResponse
Int -> ReadS CreateAccountSubscriptionResponse
ReadS [CreateAccountSubscriptionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAccountSubscriptionResponse]
$creadListPrec :: ReadPrec [CreateAccountSubscriptionResponse]
readPrec :: ReadPrec CreateAccountSubscriptionResponse
$creadPrec :: ReadPrec CreateAccountSubscriptionResponse
readList :: ReadS [CreateAccountSubscriptionResponse]
$creadList :: ReadS [CreateAccountSubscriptionResponse]
readsPrec :: Int -> ReadS CreateAccountSubscriptionResponse
$creadsPrec :: Int -> ReadS CreateAccountSubscriptionResponse
Prelude.Read, Int -> CreateAccountSubscriptionResponse -> ShowS
[CreateAccountSubscriptionResponse] -> ShowS
CreateAccountSubscriptionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAccountSubscriptionResponse] -> ShowS
$cshowList :: [CreateAccountSubscriptionResponse] -> ShowS
show :: CreateAccountSubscriptionResponse -> String
$cshow :: CreateAccountSubscriptionResponse -> String
showsPrec :: Int -> CreateAccountSubscriptionResponse -> ShowS
$cshowsPrec :: Int -> CreateAccountSubscriptionResponse -> ShowS
Prelude.Show, forall x.
Rep CreateAccountSubscriptionResponse x
-> CreateAccountSubscriptionResponse
forall x.
CreateAccountSubscriptionResponse
-> Rep CreateAccountSubscriptionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAccountSubscriptionResponse x
-> CreateAccountSubscriptionResponse
$cfrom :: forall x.
CreateAccountSubscriptionResponse
-> Rep CreateAccountSubscriptionResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateAccountSubscriptionResponse' 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:
--
-- 'requestId', 'createAccountSubscriptionResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'signupResponse', 'createAccountSubscriptionResponse_signupResponse' - A @SignupResponse@ object that returns information about a newly created
-- Amazon QuickSight account.
--
-- 'status', 'createAccountSubscriptionResponse_status' - The HTTP status of the request.
newCreateAccountSubscriptionResponse ::
  -- | 'status'
  Prelude.Int ->
  CreateAccountSubscriptionResponse
newCreateAccountSubscriptionResponse :: Int -> CreateAccountSubscriptionResponse
newCreateAccountSubscriptionResponse Int
pStatus_ =
  CreateAccountSubscriptionResponse'
    { $sel:requestId:CreateAccountSubscriptionResponse' :: Maybe Text
requestId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:signupResponse:CreateAccountSubscriptionResponse' :: Maybe SignupResponse
signupResponse = forall a. Maybe a
Prelude.Nothing,
      $sel:status:CreateAccountSubscriptionResponse' :: Int
status = Int
pStatus_
    }

-- | The Amazon Web Services request ID for this operation.
createAccountSubscriptionResponse_requestId :: Lens.Lens' CreateAccountSubscriptionResponse (Prelude.Maybe Prelude.Text)
createAccountSubscriptionResponse_requestId :: Lens' CreateAccountSubscriptionResponse (Maybe Text)
createAccountSubscriptionResponse_requestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscriptionResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:CreateAccountSubscriptionResponse' :: CreateAccountSubscriptionResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: CreateAccountSubscriptionResponse
s@CreateAccountSubscriptionResponse' {} Maybe Text
a -> CreateAccountSubscriptionResponse
s {$sel:requestId:CreateAccountSubscriptionResponse' :: Maybe Text
requestId = Maybe Text
a} :: CreateAccountSubscriptionResponse)

-- | A @SignupResponse@ object that returns information about a newly created
-- Amazon QuickSight account.
createAccountSubscriptionResponse_signupResponse :: Lens.Lens' CreateAccountSubscriptionResponse (Prelude.Maybe SignupResponse)
createAccountSubscriptionResponse_signupResponse :: Lens' CreateAccountSubscriptionResponse (Maybe SignupResponse)
createAccountSubscriptionResponse_signupResponse = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscriptionResponse' {Maybe SignupResponse
signupResponse :: Maybe SignupResponse
$sel:signupResponse:CreateAccountSubscriptionResponse' :: CreateAccountSubscriptionResponse -> Maybe SignupResponse
signupResponse} -> Maybe SignupResponse
signupResponse) (\s :: CreateAccountSubscriptionResponse
s@CreateAccountSubscriptionResponse' {} Maybe SignupResponse
a -> CreateAccountSubscriptionResponse
s {$sel:signupResponse:CreateAccountSubscriptionResponse' :: Maybe SignupResponse
signupResponse = Maybe SignupResponse
a} :: CreateAccountSubscriptionResponse)

-- | The HTTP status of the request.
createAccountSubscriptionResponse_status :: Lens.Lens' CreateAccountSubscriptionResponse Prelude.Int
createAccountSubscriptionResponse_status :: Lens' CreateAccountSubscriptionResponse Int
createAccountSubscriptionResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountSubscriptionResponse' {Int
status :: Int
$sel:status:CreateAccountSubscriptionResponse' :: CreateAccountSubscriptionResponse -> Int
status} -> Int
status) (\s :: CreateAccountSubscriptionResponse
s@CreateAccountSubscriptionResponse' {} Int
a -> CreateAccountSubscriptionResponse
s {$sel:status:CreateAccountSubscriptionResponse' :: Int
status = Int
a} :: CreateAccountSubscriptionResponse)

instance
  Prelude.NFData
    CreateAccountSubscriptionResponse
  where
  rnf :: CreateAccountSubscriptionResponse -> ()
rnf CreateAccountSubscriptionResponse' {Int
Maybe Text
Maybe SignupResponse
status :: Int
signupResponse :: Maybe SignupResponse
requestId :: Maybe Text
$sel:status:CreateAccountSubscriptionResponse' :: CreateAccountSubscriptionResponse -> Int
$sel:signupResponse:CreateAccountSubscriptionResponse' :: CreateAccountSubscriptionResponse -> Maybe SignupResponse
$sel:requestId:CreateAccountSubscriptionResponse' :: CreateAccountSubscriptionResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
requestId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SignupResponse
signupResponse
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
status