{-# 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 #-}
module Amazonka.QuickSight.DeleteFolder
(
DeleteFolder (..),
newDeleteFolder,
deleteFolder_awsAccountId,
deleteFolder_folderId,
DeleteFolderResponse (..),
newDeleteFolderResponse,
deleteFolderResponse_requestId,
deleteFolderResponse_arn,
deleteFolderResponse_folderId,
deleteFolderResponse_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
data DeleteFolder = DeleteFolder'
{
DeleteFolder -> Text
awsAccountId :: Prelude.Text,
DeleteFolder -> Text
folderId :: Prelude.Text
}
deriving (DeleteFolder -> DeleteFolder -> Bool
(DeleteFolder -> DeleteFolder -> Bool)
-> (DeleteFolder -> DeleteFolder -> Bool) -> Eq DeleteFolder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFolder -> DeleteFolder -> Bool
$c/= :: DeleteFolder -> DeleteFolder -> Bool
== :: DeleteFolder -> DeleteFolder -> Bool
$c== :: DeleteFolder -> DeleteFolder -> Bool
Prelude.Eq, ReadPrec [DeleteFolder]
ReadPrec DeleteFolder
Int -> ReadS DeleteFolder
ReadS [DeleteFolder]
(Int -> ReadS DeleteFolder)
-> ReadS [DeleteFolder]
-> ReadPrec DeleteFolder
-> ReadPrec [DeleteFolder]
-> Read DeleteFolder
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFolder]
$creadListPrec :: ReadPrec [DeleteFolder]
readPrec :: ReadPrec DeleteFolder
$creadPrec :: ReadPrec DeleteFolder
readList :: ReadS [DeleteFolder]
$creadList :: ReadS [DeleteFolder]
readsPrec :: Int -> ReadS DeleteFolder
$creadsPrec :: Int -> ReadS DeleteFolder
Prelude.Read, Int -> DeleteFolder -> ShowS
[DeleteFolder] -> ShowS
DeleteFolder -> String
(Int -> DeleteFolder -> ShowS)
-> (DeleteFolder -> String)
-> ([DeleteFolder] -> ShowS)
-> Show DeleteFolder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFolder] -> ShowS
$cshowList :: [DeleteFolder] -> ShowS
show :: DeleteFolder -> String
$cshow :: DeleteFolder -> String
showsPrec :: Int -> DeleteFolder -> ShowS
$cshowsPrec :: Int -> DeleteFolder -> ShowS
Prelude.Show, (forall x. DeleteFolder -> Rep DeleteFolder x)
-> (forall x. Rep DeleteFolder x -> DeleteFolder)
-> Generic DeleteFolder
forall x. Rep DeleteFolder x -> DeleteFolder
forall x. DeleteFolder -> Rep DeleteFolder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteFolder x -> DeleteFolder
$cfrom :: forall x. DeleteFolder -> Rep DeleteFolder x
Prelude.Generic)
newDeleteFolder ::
Prelude.Text ->
Prelude.Text ->
DeleteFolder
newDeleteFolder :: Text -> Text -> DeleteFolder
newDeleteFolder Text
pAwsAccountId_ Text
pFolderId_ =
DeleteFolder' :: Text -> Text -> DeleteFolder
DeleteFolder'
{ $sel:awsAccountId:DeleteFolder' :: Text
awsAccountId = Text
pAwsAccountId_,
$sel:folderId:DeleteFolder' :: Text
folderId = Text
pFolderId_
}
deleteFolder_awsAccountId :: Lens.Lens' DeleteFolder Prelude.Text
deleteFolder_awsAccountId :: (Text -> f Text) -> DeleteFolder -> f DeleteFolder
deleteFolder_awsAccountId = (DeleteFolder -> Text)
-> (DeleteFolder -> Text -> DeleteFolder)
-> Lens DeleteFolder DeleteFolder Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFolder' {Text
awsAccountId :: Text
$sel:awsAccountId:DeleteFolder' :: DeleteFolder -> Text
awsAccountId} -> Text
awsAccountId) (\s :: DeleteFolder
s@DeleteFolder' {} Text
a -> DeleteFolder
s {$sel:awsAccountId:DeleteFolder' :: Text
awsAccountId = Text
a} :: DeleteFolder)
deleteFolder_folderId :: Lens.Lens' DeleteFolder Prelude.Text
deleteFolder_folderId :: (Text -> f Text) -> DeleteFolder -> f DeleteFolder
deleteFolder_folderId = (DeleteFolder -> Text)
-> (DeleteFolder -> Text -> DeleteFolder)
-> Lens DeleteFolder DeleteFolder Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFolder' {Text
folderId :: Text
$sel:folderId:DeleteFolder' :: DeleteFolder -> Text
folderId} -> Text
folderId) (\s :: DeleteFolder
s@DeleteFolder' {} Text
a -> DeleteFolder
s {$sel:folderId:DeleteFolder' :: Text
folderId = Text
a} :: DeleteFolder)
instance Core.AWSRequest DeleteFolder where
type AWSResponse DeleteFolder = DeleteFolderResponse
request :: DeleteFolder -> Request DeleteFolder
request = Service -> DeleteFolder -> Request DeleteFolder
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteFolder
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteFolder)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteFolder))
-> Logger
-> Service
-> Proxy DeleteFolder
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteFolder)))
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 Text -> Maybe Text -> Int -> DeleteFolderResponse
DeleteFolderResponse'
(Maybe Text
-> Maybe Text -> Maybe Text -> Int -> DeleteFolderResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Maybe Text -> Int -> DeleteFolderResponse)
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 Text -> Maybe Text -> Int -> DeleteFolderResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> DeleteFolderResponse)
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 -> Int -> DeleteFolderResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteFolderResponse)
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
"FolderId")
Either String (Int -> DeleteFolderResponse)
-> Either String Int -> Either String DeleteFolderResponse
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 DeleteFolder
instance Prelude.NFData DeleteFolder
instance Core.ToHeaders DeleteFolder where
toHeaders :: DeleteFolder -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteFolder -> 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 DeleteFolder where
toPath :: DeleteFolder -> ByteString
toPath DeleteFolder' {Text
folderId :: Text
awsAccountId :: Text
$sel:folderId:DeleteFolder' :: DeleteFolder -> Text
$sel:awsAccountId:DeleteFolder' :: DeleteFolder -> 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
"/folders/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
folderId
]
instance Core.ToQuery DeleteFolder where
toQuery :: DeleteFolder -> QueryString
toQuery = QueryString -> DeleteFolder -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteFolderResponse = DeleteFolderResponse'
{
DeleteFolderResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
DeleteFolderResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
DeleteFolderResponse -> Maybe Text
folderId :: Prelude.Maybe Prelude.Text,
DeleteFolderResponse -> Int
status :: Prelude.Int
}
deriving (DeleteFolderResponse -> DeleteFolderResponse -> Bool
(DeleteFolderResponse -> DeleteFolderResponse -> Bool)
-> (DeleteFolderResponse -> DeleteFolderResponse -> Bool)
-> Eq DeleteFolderResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFolderResponse -> DeleteFolderResponse -> Bool
$c/= :: DeleteFolderResponse -> DeleteFolderResponse -> Bool
== :: DeleteFolderResponse -> DeleteFolderResponse -> Bool
$c== :: DeleteFolderResponse -> DeleteFolderResponse -> Bool
Prelude.Eq, ReadPrec [DeleteFolderResponse]
ReadPrec DeleteFolderResponse
Int -> ReadS DeleteFolderResponse
ReadS [DeleteFolderResponse]
(Int -> ReadS DeleteFolderResponse)
-> ReadS [DeleteFolderResponse]
-> ReadPrec DeleteFolderResponse
-> ReadPrec [DeleteFolderResponse]
-> Read DeleteFolderResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFolderResponse]
$creadListPrec :: ReadPrec [DeleteFolderResponse]
readPrec :: ReadPrec DeleteFolderResponse
$creadPrec :: ReadPrec DeleteFolderResponse
readList :: ReadS [DeleteFolderResponse]
$creadList :: ReadS [DeleteFolderResponse]
readsPrec :: Int -> ReadS DeleteFolderResponse
$creadsPrec :: Int -> ReadS DeleteFolderResponse
Prelude.Read, Int -> DeleteFolderResponse -> ShowS
[DeleteFolderResponse] -> ShowS
DeleteFolderResponse -> String
(Int -> DeleteFolderResponse -> ShowS)
-> (DeleteFolderResponse -> String)
-> ([DeleteFolderResponse] -> ShowS)
-> Show DeleteFolderResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFolderResponse] -> ShowS
$cshowList :: [DeleteFolderResponse] -> ShowS
show :: DeleteFolderResponse -> String
$cshow :: DeleteFolderResponse -> String
showsPrec :: Int -> DeleteFolderResponse -> ShowS
$cshowsPrec :: Int -> DeleteFolderResponse -> ShowS
Prelude.Show, (forall x. DeleteFolderResponse -> Rep DeleteFolderResponse x)
-> (forall x. Rep DeleteFolderResponse x -> DeleteFolderResponse)
-> Generic DeleteFolderResponse
forall x. Rep DeleteFolderResponse x -> DeleteFolderResponse
forall x. DeleteFolderResponse -> Rep DeleteFolderResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteFolderResponse x -> DeleteFolderResponse
$cfrom :: forall x. DeleteFolderResponse -> Rep DeleteFolderResponse x
Prelude.Generic)
newDeleteFolderResponse ::
Prelude.Int ->
DeleteFolderResponse
newDeleteFolderResponse :: Int -> DeleteFolderResponse
newDeleteFolderResponse Int
pStatus_ =
DeleteFolderResponse' :: Maybe Text
-> Maybe Text -> Maybe Text -> Int -> DeleteFolderResponse
DeleteFolderResponse'
{ $sel:requestId:DeleteFolderResponse' :: Maybe Text
requestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:DeleteFolderResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:folderId:DeleteFolderResponse' :: Maybe Text
folderId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:DeleteFolderResponse' :: Int
status = Int
pStatus_
}
deleteFolderResponse_requestId :: Lens.Lens' DeleteFolderResponse (Prelude.Maybe Prelude.Text)
deleteFolderResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> DeleteFolderResponse -> f DeleteFolderResponse
deleteFolderResponse_requestId = (DeleteFolderResponse -> Maybe Text)
-> (DeleteFolderResponse -> Maybe Text -> DeleteFolderResponse)
-> Lens
DeleteFolderResponse DeleteFolderResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFolderResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:DeleteFolderResponse' :: DeleteFolderResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: DeleteFolderResponse
s@DeleteFolderResponse' {} Maybe Text
a -> DeleteFolderResponse
s {$sel:requestId:DeleteFolderResponse' :: Maybe Text
requestId = Maybe Text
a} :: DeleteFolderResponse)
deleteFolderResponse_arn :: Lens.Lens' DeleteFolderResponse (Prelude.Maybe Prelude.Text)
deleteFolderResponse_arn :: (Maybe Text -> f (Maybe Text))
-> DeleteFolderResponse -> f DeleteFolderResponse
deleteFolderResponse_arn = (DeleteFolderResponse -> Maybe Text)
-> (DeleteFolderResponse -> Maybe Text -> DeleteFolderResponse)
-> Lens
DeleteFolderResponse DeleteFolderResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFolderResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:DeleteFolderResponse' :: DeleteFolderResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: DeleteFolderResponse
s@DeleteFolderResponse' {} Maybe Text
a -> DeleteFolderResponse
s {$sel:arn:DeleteFolderResponse' :: Maybe Text
arn = Maybe Text
a} :: DeleteFolderResponse)
deleteFolderResponse_folderId :: Lens.Lens' DeleteFolderResponse (Prelude.Maybe Prelude.Text)
deleteFolderResponse_folderId :: (Maybe Text -> f (Maybe Text))
-> DeleteFolderResponse -> f DeleteFolderResponse
deleteFolderResponse_folderId = (DeleteFolderResponse -> Maybe Text)
-> (DeleteFolderResponse -> Maybe Text -> DeleteFolderResponse)
-> Lens
DeleteFolderResponse DeleteFolderResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFolderResponse' {Maybe Text
folderId :: Maybe Text
$sel:folderId:DeleteFolderResponse' :: DeleteFolderResponse -> Maybe Text
folderId} -> Maybe Text
folderId) (\s :: DeleteFolderResponse
s@DeleteFolderResponse' {} Maybe Text
a -> DeleteFolderResponse
s {$sel:folderId:DeleteFolderResponse' :: Maybe Text
folderId = Maybe Text
a} :: DeleteFolderResponse)
deleteFolderResponse_status :: Lens.Lens' DeleteFolderResponse Prelude.Int
deleteFolderResponse_status :: (Int -> f Int) -> DeleteFolderResponse -> f DeleteFolderResponse
deleteFolderResponse_status = (DeleteFolderResponse -> Int)
-> (DeleteFolderResponse -> Int -> DeleteFolderResponse)
-> Lens DeleteFolderResponse DeleteFolderResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFolderResponse' {Int
status :: Int
$sel:status:DeleteFolderResponse' :: DeleteFolderResponse -> Int
status} -> Int
status) (\s :: DeleteFolderResponse
s@DeleteFolderResponse' {} Int
a -> DeleteFolderResponse
s {$sel:status:DeleteFolderResponse' :: Int
status = Int
a} :: DeleteFolderResponse)
instance Prelude.NFData DeleteFolderResponse