{-# 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.DeleteAccountCustomization
-- 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)
--
-- Deletes all Amazon QuickSight customizations in this Amazon Web Services
-- Region for the specified Amazon Web Services account and Amazon
-- QuickSight namespace.
module Amazonka.QuickSight.DeleteAccountCustomization
  ( -- * Creating a Request
    DeleteAccountCustomization (..),
    newDeleteAccountCustomization,

    -- * Request Lenses
    deleteAccountCustomization_namespace,
    deleteAccountCustomization_awsAccountId,

    -- * Destructuring the Response
    DeleteAccountCustomizationResponse (..),
    newDeleteAccountCustomizationResponse,

    -- * Response Lenses
    deleteAccountCustomizationResponse_requestId,
    deleteAccountCustomizationResponse_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:/ 'newDeleteAccountCustomization' smart constructor.
data DeleteAccountCustomization = DeleteAccountCustomization'
  { -- | The Amazon QuickSight namespace that you\'re deleting the customizations
    -- from.
    DeleteAccountCustomization -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text,
    -- | The ID for the Amazon Web Services account that you want to delete
    -- Amazon QuickSight customizations from in this Amazon Web Services
    -- Region.
    DeleteAccountCustomization -> Text
awsAccountId :: Prelude.Text
  }
  deriving (DeleteAccountCustomization -> DeleteAccountCustomization -> Bool
(DeleteAccountCustomization -> DeleteAccountCustomization -> Bool)
-> (DeleteAccountCustomization
    -> DeleteAccountCustomization -> Bool)
-> Eq DeleteAccountCustomization
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAccountCustomization -> DeleteAccountCustomization -> Bool
$c/= :: DeleteAccountCustomization -> DeleteAccountCustomization -> Bool
== :: DeleteAccountCustomization -> DeleteAccountCustomization -> Bool
$c== :: DeleteAccountCustomization -> DeleteAccountCustomization -> Bool
Prelude.Eq, ReadPrec [DeleteAccountCustomization]
ReadPrec DeleteAccountCustomization
Int -> ReadS DeleteAccountCustomization
ReadS [DeleteAccountCustomization]
(Int -> ReadS DeleteAccountCustomization)
-> ReadS [DeleteAccountCustomization]
-> ReadPrec DeleteAccountCustomization
-> ReadPrec [DeleteAccountCustomization]
-> Read DeleteAccountCustomization
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAccountCustomization]
$creadListPrec :: ReadPrec [DeleteAccountCustomization]
readPrec :: ReadPrec DeleteAccountCustomization
$creadPrec :: ReadPrec DeleteAccountCustomization
readList :: ReadS [DeleteAccountCustomization]
$creadList :: ReadS [DeleteAccountCustomization]
readsPrec :: Int -> ReadS DeleteAccountCustomization
$creadsPrec :: Int -> ReadS DeleteAccountCustomization
Prelude.Read, Int -> DeleteAccountCustomization -> ShowS
[DeleteAccountCustomization] -> ShowS
DeleteAccountCustomization -> String
(Int -> DeleteAccountCustomization -> ShowS)
-> (DeleteAccountCustomization -> String)
-> ([DeleteAccountCustomization] -> ShowS)
-> Show DeleteAccountCustomization
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAccountCustomization] -> ShowS
$cshowList :: [DeleteAccountCustomization] -> ShowS
show :: DeleteAccountCustomization -> String
$cshow :: DeleteAccountCustomization -> String
showsPrec :: Int -> DeleteAccountCustomization -> ShowS
$cshowsPrec :: Int -> DeleteAccountCustomization -> ShowS
Prelude.Show, (forall x.
 DeleteAccountCustomization -> Rep DeleteAccountCustomization x)
-> (forall x.
    Rep DeleteAccountCustomization x -> DeleteAccountCustomization)
-> Generic DeleteAccountCustomization
forall x.
Rep DeleteAccountCustomization x -> DeleteAccountCustomization
forall x.
DeleteAccountCustomization -> Rep DeleteAccountCustomization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteAccountCustomization x -> DeleteAccountCustomization
$cfrom :: forall x.
DeleteAccountCustomization -> Rep DeleteAccountCustomization x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAccountCustomization' 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', 'deleteAccountCustomization_namespace' - The Amazon QuickSight namespace that you\'re deleting the customizations
-- from.
--
-- 'awsAccountId', 'deleteAccountCustomization_awsAccountId' - The ID for the Amazon Web Services account that you want to delete
-- Amazon QuickSight customizations from in this Amazon Web Services
-- Region.
newDeleteAccountCustomization ::
  -- | 'awsAccountId'
  Prelude.Text ->
  DeleteAccountCustomization
newDeleteAccountCustomization :: Text -> DeleteAccountCustomization
newDeleteAccountCustomization Text
pAwsAccountId_ =
  DeleteAccountCustomization' :: Maybe Text -> Text -> DeleteAccountCustomization
DeleteAccountCustomization'
    { $sel:namespace:DeleteAccountCustomization' :: Maybe Text
namespace =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:awsAccountId:DeleteAccountCustomization' :: Text
awsAccountId = Text
pAwsAccountId_
    }

-- | The Amazon QuickSight namespace that you\'re deleting the customizations
-- from.
deleteAccountCustomization_namespace :: Lens.Lens' DeleteAccountCustomization (Prelude.Maybe Prelude.Text)
deleteAccountCustomization_namespace :: (Maybe Text -> f (Maybe Text))
-> DeleteAccountCustomization -> f DeleteAccountCustomization
deleteAccountCustomization_namespace = (DeleteAccountCustomization -> Maybe Text)
-> (DeleteAccountCustomization
    -> Maybe Text -> DeleteAccountCustomization)
-> Lens
     DeleteAccountCustomization
     DeleteAccountCustomization
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAccountCustomization' {Maybe Text
namespace :: Maybe Text
$sel:namespace:DeleteAccountCustomization' :: DeleteAccountCustomization -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: DeleteAccountCustomization
s@DeleteAccountCustomization' {} Maybe Text
a -> DeleteAccountCustomization
s {$sel:namespace:DeleteAccountCustomization' :: Maybe Text
namespace = Maybe Text
a} :: DeleteAccountCustomization)

-- | The ID for the Amazon Web Services account that you want to delete
-- Amazon QuickSight customizations from in this Amazon Web Services
-- Region.
deleteAccountCustomization_awsAccountId :: Lens.Lens' DeleteAccountCustomization Prelude.Text
deleteAccountCustomization_awsAccountId :: (Text -> f Text)
-> DeleteAccountCustomization -> f DeleteAccountCustomization
deleteAccountCustomization_awsAccountId = (DeleteAccountCustomization -> Text)
-> (DeleteAccountCustomization
    -> Text -> DeleteAccountCustomization)
-> Lens
     DeleteAccountCustomization DeleteAccountCustomization Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAccountCustomization' {Text
awsAccountId :: Text
$sel:awsAccountId:DeleteAccountCustomization' :: DeleteAccountCustomization -> Text
awsAccountId} -> Text
awsAccountId) (\s :: DeleteAccountCustomization
s@DeleteAccountCustomization' {} Text
a -> DeleteAccountCustomization
s {$sel:awsAccountId:DeleteAccountCustomization' :: Text
awsAccountId = Text
a} :: DeleteAccountCustomization)

instance Core.AWSRequest DeleteAccountCustomization where
  type
    AWSResponse DeleteAccountCustomization =
      DeleteAccountCustomizationResponse
  request :: DeleteAccountCustomization -> Request DeleteAccountCustomization
request = Service
-> DeleteAccountCustomization -> Request DeleteAccountCustomization
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteAccountCustomization
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteAccountCustomization)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DeleteAccountCustomization))
-> Logger
-> Service
-> Proxy DeleteAccountCustomization
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteAccountCustomization)))
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 -> Int -> DeleteAccountCustomizationResponse
DeleteAccountCustomizationResponse'
            (Maybe Text -> Int -> DeleteAccountCustomizationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteAccountCustomizationResponse)
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 (Int -> DeleteAccountCustomizationResponse)
-> Either String Int
-> Either String DeleteAccountCustomizationResponse
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 DeleteAccountCustomization

instance Prelude.NFData DeleteAccountCustomization

instance Core.ToHeaders DeleteAccountCustomization where
  toHeaders :: DeleteAccountCustomization -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteAccountCustomization -> 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.ToPath DeleteAccountCustomization where
  toPath :: DeleteAccountCustomization -> ByteString
toPath DeleteAccountCustomization' {Maybe Text
Text
awsAccountId :: Text
namespace :: Maybe Text
$sel:awsAccountId:DeleteAccountCustomization' :: DeleteAccountCustomization -> Text
$sel:namespace:DeleteAccountCustomization' :: DeleteAccountCustomization -> 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 DeleteAccountCustomization where
  toQuery :: DeleteAccountCustomization -> QueryString
toQuery DeleteAccountCustomization' {Maybe Text
Text
awsAccountId :: Text
namespace :: Maybe Text
$sel:awsAccountId:DeleteAccountCustomization' :: DeleteAccountCustomization -> Text
$sel:namespace:DeleteAccountCustomization' :: DeleteAccountCustomization -> 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:/ 'newDeleteAccountCustomizationResponse' smart constructor.
data DeleteAccountCustomizationResponse = DeleteAccountCustomizationResponse'
  { -- | The Amazon Web Services request ID for this operation.
    DeleteAccountCustomizationResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The HTTP status of the request.
    DeleteAccountCustomizationResponse -> Int
status :: Prelude.Int
  }
  deriving (DeleteAccountCustomizationResponse
-> DeleteAccountCustomizationResponse -> Bool
(DeleteAccountCustomizationResponse
 -> DeleteAccountCustomizationResponse -> Bool)
-> (DeleteAccountCustomizationResponse
    -> DeleteAccountCustomizationResponse -> Bool)
-> Eq DeleteAccountCustomizationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAccountCustomizationResponse
-> DeleteAccountCustomizationResponse -> Bool
$c/= :: DeleteAccountCustomizationResponse
-> DeleteAccountCustomizationResponse -> Bool
== :: DeleteAccountCustomizationResponse
-> DeleteAccountCustomizationResponse -> Bool
$c== :: DeleteAccountCustomizationResponse
-> DeleteAccountCustomizationResponse -> Bool
Prelude.Eq, ReadPrec [DeleteAccountCustomizationResponse]
ReadPrec DeleteAccountCustomizationResponse
Int -> ReadS DeleteAccountCustomizationResponse
ReadS [DeleteAccountCustomizationResponse]
(Int -> ReadS DeleteAccountCustomizationResponse)
-> ReadS [DeleteAccountCustomizationResponse]
-> ReadPrec DeleteAccountCustomizationResponse
-> ReadPrec [DeleteAccountCustomizationResponse]
-> Read DeleteAccountCustomizationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAccountCustomizationResponse]
$creadListPrec :: ReadPrec [DeleteAccountCustomizationResponse]
readPrec :: ReadPrec DeleteAccountCustomizationResponse
$creadPrec :: ReadPrec DeleteAccountCustomizationResponse
readList :: ReadS [DeleteAccountCustomizationResponse]
$creadList :: ReadS [DeleteAccountCustomizationResponse]
readsPrec :: Int -> ReadS DeleteAccountCustomizationResponse
$creadsPrec :: Int -> ReadS DeleteAccountCustomizationResponse
Prelude.Read, Int -> DeleteAccountCustomizationResponse -> ShowS
[DeleteAccountCustomizationResponse] -> ShowS
DeleteAccountCustomizationResponse -> String
(Int -> DeleteAccountCustomizationResponse -> ShowS)
-> (DeleteAccountCustomizationResponse -> String)
-> ([DeleteAccountCustomizationResponse] -> ShowS)
-> Show DeleteAccountCustomizationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAccountCustomizationResponse] -> ShowS
$cshowList :: [DeleteAccountCustomizationResponse] -> ShowS
show :: DeleteAccountCustomizationResponse -> String
$cshow :: DeleteAccountCustomizationResponse -> String
showsPrec :: Int -> DeleteAccountCustomizationResponse -> ShowS
$cshowsPrec :: Int -> DeleteAccountCustomizationResponse -> ShowS
Prelude.Show, (forall x.
 DeleteAccountCustomizationResponse
 -> Rep DeleteAccountCustomizationResponse x)
-> (forall x.
    Rep DeleteAccountCustomizationResponse x
    -> DeleteAccountCustomizationResponse)
-> Generic DeleteAccountCustomizationResponse
forall x.
Rep DeleteAccountCustomizationResponse x
-> DeleteAccountCustomizationResponse
forall x.
DeleteAccountCustomizationResponse
-> Rep DeleteAccountCustomizationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteAccountCustomizationResponse x
-> DeleteAccountCustomizationResponse
$cfrom :: forall x.
DeleteAccountCustomizationResponse
-> Rep DeleteAccountCustomizationResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAccountCustomizationResponse' 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', 'deleteAccountCustomizationResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'status', 'deleteAccountCustomizationResponse_status' - The HTTP status of the request.
newDeleteAccountCustomizationResponse ::
  -- | 'status'
  Prelude.Int ->
  DeleteAccountCustomizationResponse
newDeleteAccountCustomizationResponse :: Int -> DeleteAccountCustomizationResponse
newDeleteAccountCustomizationResponse Int
pStatus_ =
  DeleteAccountCustomizationResponse' :: Maybe Text -> Int -> DeleteAccountCustomizationResponse
DeleteAccountCustomizationResponse'
    { $sel:requestId:DeleteAccountCustomizationResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:DeleteAccountCustomizationResponse' :: Int
status = Int
pStatus_
    }

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

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

instance
  Prelude.NFData
    DeleteAccountCustomizationResponse