{-# 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.CreateAccountCustomization
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates Amazon QuickSight customizations the current Amazon Web Services
-- Region. Currently, you can add a custom default theme by using the
-- @CreateAccountCustomization@ or @UpdateAccountCustomization@ API
-- operation. To further customize Amazon QuickSight by removing Amazon
-- QuickSight sample assets and videos for all new users, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/customizing-quicksight.html Customizing Amazon QuickSight>
-- in the /Amazon QuickSight User Guide./
--
-- You can create customizations for your Amazon Web Services account or,
-- if you specify a namespace, for a Amazon QuickSight namespace instead.
-- Customizations that apply to a namespace always override customizations
-- that apply to an Amazon Web Services account. To find out which
-- customizations apply, use the @DescribeAccountCustomization@ API
-- operation.
--
-- Before you use the @CreateAccountCustomization@ API operation to add a
-- theme as the namespace default, make sure that you first share the theme
-- with the namespace. If you don\'t share it with the namespace, the theme
-- isn\'t visible to your users even if you make it the default theme. To
-- check if the theme is shared, view the current permissions by using the
-- @ DescribeThemePermissions @ API operation. To share the theme, grant
-- permissions by using the @ UpdateThemePermissions @ API operation.
module Amazonka.QuickSight.CreateAccountCustomization
  ( -- * Creating a Request
    CreateAccountCustomization (..),
    newCreateAccountCustomization,

    -- * Request Lenses
    createAccountCustomization_namespace,
    createAccountCustomization_tags,
    createAccountCustomization_awsAccountId,
    createAccountCustomization_accountCustomization,

    -- * Destructuring the Response
    CreateAccountCustomizationResponse (..),
    newCreateAccountCustomizationResponse,

    -- * Response Lenses
    createAccountCustomizationResponse_requestId,
    createAccountCustomizationResponse_accountCustomization,
    createAccountCustomizationResponse_arn,
    createAccountCustomizationResponse_namespace,
    createAccountCustomizationResponse_awsAccountId,
    createAccountCustomizationResponse_status,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateAccountCustomization' smart constructor.
data CreateAccountCustomization = CreateAccountCustomization'
  { -- | The Amazon QuickSight namespace that you want to add customizations to.
    CreateAccountCustomization -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text,
    -- | A list of the tags that you want to attach to this resource.
    CreateAccountCustomization -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | The ID for the Amazon Web Services account that you want to customize
    -- Amazon QuickSight for.
    CreateAccountCustomization -> Text
awsAccountId :: Prelude.Text,
    -- | The Amazon QuickSight customizations you\'re adding in the current
    -- Amazon Web Services Region. You can add these to an Amazon Web Services
    -- account and a Amazon QuickSight namespace.
    --
    -- For example, you can add a default theme by setting
    -- @AccountCustomization@ to the midnight theme:
    -- @\"AccountCustomization\": { \"DefaultTheme\": \"arn:aws:quicksight::aws:theme\/MIDNIGHT\" }@.
    -- Or, you can add a custom theme by specifying
    -- @\"AccountCustomization\": { \"DefaultTheme\": \"arn:aws:quicksight:us-west-2:111122223333:theme\/bdb844d0-0fe9-4d9d-b520-0fe602d93639\" }@.
    CreateAccountCustomization -> AccountCustomization
accountCustomization :: AccountCustomization
  }
  deriving (CreateAccountCustomization -> CreateAccountCustomization -> Bool
(CreateAccountCustomization -> CreateAccountCustomization -> Bool)
-> (CreateAccountCustomization
    -> CreateAccountCustomization -> Bool)
-> Eq CreateAccountCustomization
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAccountCustomization -> CreateAccountCustomization -> Bool
$c/= :: CreateAccountCustomization -> CreateAccountCustomization -> Bool
== :: CreateAccountCustomization -> CreateAccountCustomization -> Bool
$c== :: CreateAccountCustomization -> CreateAccountCustomization -> Bool
Prelude.Eq, ReadPrec [CreateAccountCustomization]
ReadPrec CreateAccountCustomization
Int -> ReadS CreateAccountCustomization
ReadS [CreateAccountCustomization]
(Int -> ReadS CreateAccountCustomization)
-> ReadS [CreateAccountCustomization]
-> ReadPrec CreateAccountCustomization
-> ReadPrec [CreateAccountCustomization]
-> Read CreateAccountCustomization
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAccountCustomization]
$creadListPrec :: ReadPrec [CreateAccountCustomization]
readPrec :: ReadPrec CreateAccountCustomization
$creadPrec :: ReadPrec CreateAccountCustomization
readList :: ReadS [CreateAccountCustomization]
$creadList :: ReadS [CreateAccountCustomization]
readsPrec :: Int -> ReadS CreateAccountCustomization
$creadsPrec :: Int -> ReadS CreateAccountCustomization
Prelude.Read, Int -> CreateAccountCustomization -> ShowS
[CreateAccountCustomization] -> ShowS
CreateAccountCustomization -> String
(Int -> CreateAccountCustomization -> ShowS)
-> (CreateAccountCustomization -> String)
-> ([CreateAccountCustomization] -> ShowS)
-> Show CreateAccountCustomization
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAccountCustomization] -> ShowS
$cshowList :: [CreateAccountCustomization] -> ShowS
show :: CreateAccountCustomization -> String
$cshow :: CreateAccountCustomization -> String
showsPrec :: Int -> CreateAccountCustomization -> ShowS
$cshowsPrec :: Int -> CreateAccountCustomization -> ShowS
Prelude.Show, (forall x.
 CreateAccountCustomization -> Rep CreateAccountCustomization x)
-> (forall x.
    Rep CreateAccountCustomization x -> CreateAccountCustomization)
-> Generic CreateAccountCustomization
forall x.
Rep CreateAccountCustomization x -> CreateAccountCustomization
forall x.
CreateAccountCustomization -> Rep CreateAccountCustomization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAccountCustomization x -> CreateAccountCustomization
$cfrom :: forall x.
CreateAccountCustomization -> Rep CreateAccountCustomization x
Prelude.Generic)

-- |
-- Create a value of 'CreateAccountCustomization' 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:
--
-- 'namespace', 'createAccountCustomization_namespace' - The Amazon QuickSight namespace that you want to add customizations to.
--
-- 'tags', 'createAccountCustomization_tags' - A list of the tags that you want to attach to this resource.
--
-- 'awsAccountId', 'createAccountCustomization_awsAccountId' - The ID for the Amazon Web Services account that you want to customize
-- Amazon QuickSight for.
--
-- 'accountCustomization', 'createAccountCustomization_accountCustomization' - The Amazon QuickSight customizations you\'re adding in the current
-- Amazon Web Services Region. You can add these to an Amazon Web Services
-- account and a Amazon QuickSight namespace.
--
-- For example, you can add a default theme by setting
-- @AccountCustomization@ to the midnight theme:
-- @\"AccountCustomization\": { \"DefaultTheme\": \"arn:aws:quicksight::aws:theme\/MIDNIGHT\" }@.
-- Or, you can add a custom theme by specifying
-- @\"AccountCustomization\": { \"DefaultTheme\": \"arn:aws:quicksight:us-west-2:111122223333:theme\/bdb844d0-0fe9-4d9d-b520-0fe602d93639\" }@.
newCreateAccountCustomization ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'accountCustomization'
  AccountCustomization ->
  CreateAccountCustomization
newCreateAccountCustomization :: Text -> AccountCustomization -> CreateAccountCustomization
newCreateAccountCustomization
  Text
pAwsAccountId_
  AccountCustomization
pAccountCustomization_ =
    CreateAccountCustomization' :: Maybe Text
-> Maybe (NonEmpty Tag)
-> Text
-> AccountCustomization
-> CreateAccountCustomization
CreateAccountCustomization'
      { $sel:namespace:CreateAccountCustomization' :: Maybe Text
namespace =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateAccountCustomization' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
        $sel:awsAccountId:CreateAccountCustomization' :: Text
awsAccountId = Text
pAwsAccountId_,
        $sel:accountCustomization:CreateAccountCustomization' :: AccountCustomization
accountCustomization = AccountCustomization
pAccountCustomization_
      }

-- | The Amazon QuickSight namespace that you want to add customizations to.
createAccountCustomization_namespace :: Lens.Lens' CreateAccountCustomization (Prelude.Maybe Prelude.Text)
createAccountCustomization_namespace :: (Maybe Text -> f (Maybe Text))
-> CreateAccountCustomization -> f CreateAccountCustomization
createAccountCustomization_namespace = (CreateAccountCustomization -> Maybe Text)
-> (CreateAccountCustomization
    -> Maybe Text -> CreateAccountCustomization)
-> Lens
     CreateAccountCustomization
     CreateAccountCustomization
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountCustomization' {Maybe Text
namespace :: Maybe Text
$sel:namespace:CreateAccountCustomization' :: CreateAccountCustomization -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: CreateAccountCustomization
s@CreateAccountCustomization' {} Maybe Text
a -> CreateAccountCustomization
s {$sel:namespace:CreateAccountCustomization' :: Maybe Text
namespace = Maybe Text
a} :: CreateAccountCustomization)

-- | A list of the tags that you want to attach to this resource.
createAccountCustomization_tags :: Lens.Lens' CreateAccountCustomization (Prelude.Maybe (Prelude.NonEmpty Tag))
createAccountCustomization_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateAccountCustomization -> f CreateAccountCustomization
createAccountCustomization_tags = (CreateAccountCustomization -> Maybe (NonEmpty Tag))
-> (CreateAccountCustomization
    -> Maybe (NonEmpty Tag) -> CreateAccountCustomization)
-> Lens
     CreateAccountCustomization
     CreateAccountCustomization
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountCustomization' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateAccountCustomization' :: CreateAccountCustomization -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateAccountCustomization
s@CreateAccountCustomization' {} Maybe (NonEmpty Tag)
a -> CreateAccountCustomization
s {$sel:tags:CreateAccountCustomization' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateAccountCustomization) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> CreateAccountCustomization -> f CreateAccountCustomization)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateAccountCustomization
-> f CreateAccountCustomization
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
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 AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID for the Amazon Web Services account that you want to customize
-- Amazon QuickSight for.
createAccountCustomization_awsAccountId :: Lens.Lens' CreateAccountCustomization Prelude.Text
createAccountCustomization_awsAccountId :: (Text -> f Text)
-> CreateAccountCustomization -> f CreateAccountCustomization
createAccountCustomization_awsAccountId = (CreateAccountCustomization -> Text)
-> (CreateAccountCustomization
    -> Text -> CreateAccountCustomization)
-> Lens
     CreateAccountCustomization CreateAccountCustomization Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountCustomization' {Text
awsAccountId :: Text
$sel:awsAccountId:CreateAccountCustomization' :: CreateAccountCustomization -> Text
awsAccountId} -> Text
awsAccountId) (\s :: CreateAccountCustomization
s@CreateAccountCustomization' {} Text
a -> CreateAccountCustomization
s {$sel:awsAccountId:CreateAccountCustomization' :: Text
awsAccountId = Text
a} :: CreateAccountCustomization)

-- | The Amazon QuickSight customizations you\'re adding in the current
-- Amazon Web Services Region. You can add these to an Amazon Web Services
-- account and a Amazon QuickSight namespace.
--
-- For example, you can add a default theme by setting
-- @AccountCustomization@ to the midnight theme:
-- @\"AccountCustomization\": { \"DefaultTheme\": \"arn:aws:quicksight::aws:theme\/MIDNIGHT\" }@.
-- Or, you can add a custom theme by specifying
-- @\"AccountCustomization\": { \"DefaultTheme\": \"arn:aws:quicksight:us-west-2:111122223333:theme\/bdb844d0-0fe9-4d9d-b520-0fe602d93639\" }@.
createAccountCustomization_accountCustomization :: Lens.Lens' CreateAccountCustomization AccountCustomization
createAccountCustomization_accountCustomization :: (AccountCustomization -> f AccountCustomization)
-> CreateAccountCustomization -> f CreateAccountCustomization
createAccountCustomization_accountCustomization = (CreateAccountCustomization -> AccountCustomization)
-> (CreateAccountCustomization
    -> AccountCustomization -> CreateAccountCustomization)
-> Lens
     CreateAccountCustomization
     CreateAccountCustomization
     AccountCustomization
     AccountCustomization
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountCustomization' {AccountCustomization
accountCustomization :: AccountCustomization
$sel:accountCustomization:CreateAccountCustomization' :: CreateAccountCustomization -> AccountCustomization
accountCustomization} -> AccountCustomization
accountCustomization) (\s :: CreateAccountCustomization
s@CreateAccountCustomization' {} AccountCustomization
a -> CreateAccountCustomization
s {$sel:accountCustomization:CreateAccountCustomization' :: AccountCustomization
accountCustomization = AccountCustomization
a} :: CreateAccountCustomization)

instance Core.AWSRequest CreateAccountCustomization where
  type
    AWSResponse CreateAccountCustomization =
      CreateAccountCustomizationResponse
  request :: CreateAccountCustomization -> Request CreateAccountCustomization
request = Service
-> CreateAccountCustomization -> Request CreateAccountCustomization
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateAccountCustomization
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateAccountCustomization)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateAccountCustomization))
-> Logger
-> Service
-> Proxy CreateAccountCustomization
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateAccountCustomization)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe AccountCustomization
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateAccountCustomizationResponse
CreateAccountCustomizationResponse'
            (Maybe Text
 -> Maybe AccountCustomization
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> CreateAccountCustomizationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe AccountCustomization
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateAccountCustomizationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RequestId")
            Either
  String
  (Maybe AccountCustomization
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateAccountCustomizationResponse)
-> Either String (Maybe AccountCustomization)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateAccountCustomizationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AccountCustomization)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AccountCustomization")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateAccountCustomizationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> CreateAccountCustomizationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Arn")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Int -> CreateAccountCustomizationResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> CreateAccountCustomizationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Namespace")
            Either
  String (Maybe Text -> Int -> CreateAccountCustomizationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateAccountCustomizationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AwsAccountId")
            Either String (Int -> CreateAccountCustomizationResponse)
-> Either String Int
-> Either String CreateAccountCustomizationResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateAccountCustomization

instance Prelude.NFData CreateAccountCustomization

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

instance Core.ToJSON CreateAccountCustomization where
  toJSON :: CreateAccountCustomization -> Value
toJSON CreateAccountCustomization' {Maybe (NonEmpty Tag)
Maybe Text
Text
AccountCustomization
accountCustomization :: AccountCustomization
awsAccountId :: Text
tags :: Maybe (NonEmpty Tag)
namespace :: Maybe Text
$sel:accountCustomization:CreateAccountCustomization' :: CreateAccountCustomization -> AccountCustomization
$sel:awsAccountId:CreateAccountCustomization' :: CreateAccountCustomization -> Text
$sel:tags:CreateAccountCustomization' :: CreateAccountCustomization -> Maybe (NonEmpty Tag)
$sel:namespace:CreateAccountCustomization' :: CreateAccountCustomization -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"AccountCustomization"
                  Text -> AccountCustomization -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AccountCustomization
accountCustomization
              )
          ]
      )

instance Core.ToPath CreateAccountCustomization where
  toPath :: CreateAccountCustomization -> ByteString
toPath CreateAccountCustomization' {Maybe (NonEmpty Tag)
Maybe Text
Text
AccountCustomization
accountCustomization :: AccountCustomization
awsAccountId :: Text
tags :: Maybe (NonEmpty Tag)
namespace :: Maybe Text
$sel:accountCustomization:CreateAccountCustomization' :: CreateAccountCustomization -> AccountCustomization
$sel:awsAccountId:CreateAccountCustomization' :: CreateAccountCustomization -> Text
$sel:tags:CreateAccountCustomization' :: CreateAccountCustomization -> Maybe (NonEmpty Tag)
$sel:namespace:CreateAccountCustomization' :: CreateAccountCustomization -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/accounts/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId,
        ByteString
"/customizations"
      ]

instance Core.ToQuery CreateAccountCustomization where
  toQuery :: CreateAccountCustomization -> QueryString
toQuery CreateAccountCustomization' {Maybe (NonEmpty Tag)
Maybe Text
Text
AccountCustomization
accountCustomization :: AccountCustomization
awsAccountId :: Text
tags :: Maybe (NonEmpty Tag)
namespace :: Maybe Text
$sel:accountCustomization:CreateAccountCustomization' :: CreateAccountCustomization -> AccountCustomization
$sel:awsAccountId:CreateAccountCustomization' :: CreateAccountCustomization -> Text
$sel:tags:CreateAccountCustomization' :: CreateAccountCustomization -> Maybe (NonEmpty Tag)
$sel:namespace:CreateAccountCustomization' :: CreateAccountCustomization -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"namespace" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
namespace]

-- | /See:/ 'newCreateAccountCustomizationResponse' smart constructor.
data CreateAccountCustomizationResponse = CreateAccountCustomizationResponse'
  { -- | The Amazon Web Services request ID for this operation.
    CreateAccountCustomizationResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon QuickSight customizations you\'re adding in the current
    -- Amazon Web Services Region.
    CreateAccountCustomizationResponse -> Maybe AccountCustomization
accountCustomization :: Prelude.Maybe AccountCustomization,
    -- | The Amazon Resource Name (ARN) for the customization that you created
    -- for this Amazon Web Services account.
    CreateAccountCustomizationResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The namespace associated with the customization you\'re creating.
    CreateAccountCustomizationResponse -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text,
    -- | The ID for the Amazon Web Services account that you want to customize
    -- Amazon QuickSight for.
    CreateAccountCustomizationResponse -> Maybe Text
awsAccountId :: Prelude.Maybe Prelude.Text,
    -- | The HTTP status of the request.
    CreateAccountCustomizationResponse -> Int
status :: Prelude.Int
  }
  deriving (CreateAccountCustomizationResponse
-> CreateAccountCustomizationResponse -> Bool
(CreateAccountCustomizationResponse
 -> CreateAccountCustomizationResponse -> Bool)
-> (CreateAccountCustomizationResponse
    -> CreateAccountCustomizationResponse -> Bool)
-> Eq CreateAccountCustomizationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAccountCustomizationResponse
-> CreateAccountCustomizationResponse -> Bool
$c/= :: CreateAccountCustomizationResponse
-> CreateAccountCustomizationResponse -> Bool
== :: CreateAccountCustomizationResponse
-> CreateAccountCustomizationResponse -> Bool
$c== :: CreateAccountCustomizationResponse
-> CreateAccountCustomizationResponse -> Bool
Prelude.Eq, ReadPrec [CreateAccountCustomizationResponse]
ReadPrec CreateAccountCustomizationResponse
Int -> ReadS CreateAccountCustomizationResponse
ReadS [CreateAccountCustomizationResponse]
(Int -> ReadS CreateAccountCustomizationResponse)
-> ReadS [CreateAccountCustomizationResponse]
-> ReadPrec CreateAccountCustomizationResponse
-> ReadPrec [CreateAccountCustomizationResponse]
-> Read CreateAccountCustomizationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAccountCustomizationResponse]
$creadListPrec :: ReadPrec [CreateAccountCustomizationResponse]
readPrec :: ReadPrec CreateAccountCustomizationResponse
$creadPrec :: ReadPrec CreateAccountCustomizationResponse
readList :: ReadS [CreateAccountCustomizationResponse]
$creadList :: ReadS [CreateAccountCustomizationResponse]
readsPrec :: Int -> ReadS CreateAccountCustomizationResponse
$creadsPrec :: Int -> ReadS CreateAccountCustomizationResponse
Prelude.Read, Int -> CreateAccountCustomizationResponse -> ShowS
[CreateAccountCustomizationResponse] -> ShowS
CreateAccountCustomizationResponse -> String
(Int -> CreateAccountCustomizationResponse -> ShowS)
-> (CreateAccountCustomizationResponse -> String)
-> ([CreateAccountCustomizationResponse] -> ShowS)
-> Show CreateAccountCustomizationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAccountCustomizationResponse] -> ShowS
$cshowList :: [CreateAccountCustomizationResponse] -> ShowS
show :: CreateAccountCustomizationResponse -> String
$cshow :: CreateAccountCustomizationResponse -> String
showsPrec :: Int -> CreateAccountCustomizationResponse -> ShowS
$cshowsPrec :: Int -> CreateAccountCustomizationResponse -> ShowS
Prelude.Show, (forall x.
 CreateAccountCustomizationResponse
 -> Rep CreateAccountCustomizationResponse x)
-> (forall x.
    Rep CreateAccountCustomizationResponse x
    -> CreateAccountCustomizationResponse)
-> Generic CreateAccountCustomizationResponse
forall x.
Rep CreateAccountCustomizationResponse x
-> CreateAccountCustomizationResponse
forall x.
CreateAccountCustomizationResponse
-> Rep CreateAccountCustomizationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAccountCustomizationResponse x
-> CreateAccountCustomizationResponse
$cfrom :: forall x.
CreateAccountCustomizationResponse
-> Rep CreateAccountCustomizationResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateAccountCustomizationResponse' 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', 'createAccountCustomizationResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'accountCustomization', 'createAccountCustomizationResponse_accountCustomization' - The Amazon QuickSight customizations you\'re adding in the current
-- Amazon Web Services Region.
--
-- 'arn', 'createAccountCustomizationResponse_arn' - The Amazon Resource Name (ARN) for the customization that you created
-- for this Amazon Web Services account.
--
-- 'namespace', 'createAccountCustomizationResponse_namespace' - The namespace associated with the customization you\'re creating.
--
-- 'awsAccountId', 'createAccountCustomizationResponse_awsAccountId' - The ID for the Amazon Web Services account that you want to customize
-- Amazon QuickSight for.
--
-- 'status', 'createAccountCustomizationResponse_status' - The HTTP status of the request.
newCreateAccountCustomizationResponse ::
  -- | 'status'
  Prelude.Int ->
  CreateAccountCustomizationResponse
newCreateAccountCustomizationResponse :: Int -> CreateAccountCustomizationResponse
newCreateAccountCustomizationResponse Int
pStatus_ =
  CreateAccountCustomizationResponse' :: Maybe Text
-> Maybe AccountCustomization
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateAccountCustomizationResponse
CreateAccountCustomizationResponse'
    { $sel:requestId:CreateAccountCustomizationResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:accountCustomization:CreateAccountCustomizationResponse' :: Maybe AccountCustomization
accountCustomization = Maybe AccountCustomization
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:CreateAccountCustomizationResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:namespace:CreateAccountCustomizationResponse' :: Maybe Text
namespace = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:awsAccountId:CreateAccountCustomizationResponse' :: Maybe Text
awsAccountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:CreateAccountCustomizationResponse' :: Int
status = Int
pStatus_
    }

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

-- | The Amazon QuickSight customizations you\'re adding in the current
-- Amazon Web Services Region.
createAccountCustomizationResponse_accountCustomization :: Lens.Lens' CreateAccountCustomizationResponse (Prelude.Maybe AccountCustomization)
createAccountCustomizationResponse_accountCustomization :: (Maybe AccountCustomization -> f (Maybe AccountCustomization))
-> CreateAccountCustomizationResponse
-> f CreateAccountCustomizationResponse
createAccountCustomizationResponse_accountCustomization = (CreateAccountCustomizationResponse -> Maybe AccountCustomization)
-> (CreateAccountCustomizationResponse
    -> Maybe AccountCustomization
    -> CreateAccountCustomizationResponse)
-> Lens
     CreateAccountCustomizationResponse
     CreateAccountCustomizationResponse
     (Maybe AccountCustomization)
     (Maybe AccountCustomization)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountCustomizationResponse' {Maybe AccountCustomization
accountCustomization :: Maybe AccountCustomization
$sel:accountCustomization:CreateAccountCustomizationResponse' :: CreateAccountCustomizationResponse -> Maybe AccountCustomization
accountCustomization} -> Maybe AccountCustomization
accountCustomization) (\s :: CreateAccountCustomizationResponse
s@CreateAccountCustomizationResponse' {} Maybe AccountCustomization
a -> CreateAccountCustomizationResponse
s {$sel:accountCustomization:CreateAccountCustomizationResponse' :: Maybe AccountCustomization
accountCustomization = Maybe AccountCustomization
a} :: CreateAccountCustomizationResponse)

-- | The Amazon Resource Name (ARN) for the customization that you created
-- for this Amazon Web Services account.
createAccountCustomizationResponse_arn :: Lens.Lens' CreateAccountCustomizationResponse (Prelude.Maybe Prelude.Text)
createAccountCustomizationResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CreateAccountCustomizationResponse
-> f CreateAccountCustomizationResponse
createAccountCustomizationResponse_arn = (CreateAccountCustomizationResponse -> Maybe Text)
-> (CreateAccountCustomizationResponse
    -> Maybe Text -> CreateAccountCustomizationResponse)
-> Lens
     CreateAccountCustomizationResponse
     CreateAccountCustomizationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountCustomizationResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateAccountCustomizationResponse' :: CreateAccountCustomizationResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateAccountCustomizationResponse
s@CreateAccountCustomizationResponse' {} Maybe Text
a -> CreateAccountCustomizationResponse
s {$sel:arn:CreateAccountCustomizationResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateAccountCustomizationResponse)

-- | The namespace associated with the customization you\'re creating.
createAccountCustomizationResponse_namespace :: Lens.Lens' CreateAccountCustomizationResponse (Prelude.Maybe Prelude.Text)
createAccountCustomizationResponse_namespace :: (Maybe Text -> f (Maybe Text))
-> CreateAccountCustomizationResponse
-> f CreateAccountCustomizationResponse
createAccountCustomizationResponse_namespace = (CreateAccountCustomizationResponse -> Maybe Text)
-> (CreateAccountCustomizationResponse
    -> Maybe Text -> CreateAccountCustomizationResponse)
-> Lens
     CreateAccountCustomizationResponse
     CreateAccountCustomizationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountCustomizationResponse' {Maybe Text
namespace :: Maybe Text
$sel:namespace:CreateAccountCustomizationResponse' :: CreateAccountCustomizationResponse -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: CreateAccountCustomizationResponse
s@CreateAccountCustomizationResponse' {} Maybe Text
a -> CreateAccountCustomizationResponse
s {$sel:namespace:CreateAccountCustomizationResponse' :: Maybe Text
namespace = Maybe Text
a} :: CreateAccountCustomizationResponse)

-- | The ID for the Amazon Web Services account that you want to customize
-- Amazon QuickSight for.
createAccountCustomizationResponse_awsAccountId :: Lens.Lens' CreateAccountCustomizationResponse (Prelude.Maybe Prelude.Text)
createAccountCustomizationResponse_awsAccountId :: (Maybe Text -> f (Maybe Text))
-> CreateAccountCustomizationResponse
-> f CreateAccountCustomizationResponse
createAccountCustomizationResponse_awsAccountId = (CreateAccountCustomizationResponse -> Maybe Text)
-> (CreateAccountCustomizationResponse
    -> Maybe Text -> CreateAccountCustomizationResponse)
-> Lens
     CreateAccountCustomizationResponse
     CreateAccountCustomizationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountCustomizationResponse' {Maybe Text
awsAccountId :: Maybe Text
$sel:awsAccountId:CreateAccountCustomizationResponse' :: CreateAccountCustomizationResponse -> Maybe Text
awsAccountId} -> Maybe Text
awsAccountId) (\s :: CreateAccountCustomizationResponse
s@CreateAccountCustomizationResponse' {} Maybe Text
a -> CreateAccountCustomizationResponse
s {$sel:awsAccountId:CreateAccountCustomizationResponse' :: Maybe Text
awsAccountId = Maybe Text
a} :: CreateAccountCustomizationResponse)

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

instance
  Prelude.NFData
    CreateAccountCustomizationResponse