{-# 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.DeleteDataSet
(
DeleteDataSet (..),
newDeleteDataSet,
deleteDataSet_awsAccountId,
deleteDataSet_dataSetId,
DeleteDataSetResponse (..),
newDeleteDataSetResponse,
deleteDataSetResponse_requestId,
deleteDataSetResponse_arn,
deleteDataSetResponse_dataSetId,
deleteDataSetResponse_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 DeleteDataSet = DeleteDataSet'
{
DeleteDataSet -> Text
awsAccountId :: Prelude.Text,
DeleteDataSet -> Text
dataSetId :: Prelude.Text
}
deriving (DeleteDataSet -> DeleteDataSet -> Bool
(DeleteDataSet -> DeleteDataSet -> Bool)
-> (DeleteDataSet -> DeleteDataSet -> Bool) -> Eq DeleteDataSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDataSet -> DeleteDataSet -> Bool
$c/= :: DeleteDataSet -> DeleteDataSet -> Bool
== :: DeleteDataSet -> DeleteDataSet -> Bool
$c== :: DeleteDataSet -> DeleteDataSet -> Bool
Prelude.Eq, ReadPrec [DeleteDataSet]
ReadPrec DeleteDataSet
Int -> ReadS DeleteDataSet
ReadS [DeleteDataSet]
(Int -> ReadS DeleteDataSet)
-> ReadS [DeleteDataSet]
-> ReadPrec DeleteDataSet
-> ReadPrec [DeleteDataSet]
-> Read DeleteDataSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDataSet]
$creadListPrec :: ReadPrec [DeleteDataSet]
readPrec :: ReadPrec DeleteDataSet
$creadPrec :: ReadPrec DeleteDataSet
readList :: ReadS [DeleteDataSet]
$creadList :: ReadS [DeleteDataSet]
readsPrec :: Int -> ReadS DeleteDataSet
$creadsPrec :: Int -> ReadS DeleteDataSet
Prelude.Read, Int -> DeleteDataSet -> ShowS
[DeleteDataSet] -> ShowS
DeleteDataSet -> String
(Int -> DeleteDataSet -> ShowS)
-> (DeleteDataSet -> String)
-> ([DeleteDataSet] -> ShowS)
-> Show DeleteDataSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDataSet] -> ShowS
$cshowList :: [DeleteDataSet] -> ShowS
show :: DeleteDataSet -> String
$cshow :: DeleteDataSet -> String
showsPrec :: Int -> DeleteDataSet -> ShowS
$cshowsPrec :: Int -> DeleteDataSet -> ShowS
Prelude.Show, (forall x. DeleteDataSet -> Rep DeleteDataSet x)
-> (forall x. Rep DeleteDataSet x -> DeleteDataSet)
-> Generic DeleteDataSet
forall x. Rep DeleteDataSet x -> DeleteDataSet
forall x. DeleteDataSet -> Rep DeleteDataSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDataSet x -> DeleteDataSet
$cfrom :: forall x. DeleteDataSet -> Rep DeleteDataSet x
Prelude.Generic)
newDeleteDataSet ::
Prelude.Text ->
Prelude.Text ->
DeleteDataSet
newDeleteDataSet :: Text -> Text -> DeleteDataSet
newDeleteDataSet Text
pAwsAccountId_ Text
pDataSetId_ =
DeleteDataSet' :: Text -> Text -> DeleteDataSet
DeleteDataSet'
{ $sel:awsAccountId:DeleteDataSet' :: Text
awsAccountId = Text
pAwsAccountId_,
$sel:dataSetId:DeleteDataSet' :: Text
dataSetId = Text
pDataSetId_
}
deleteDataSet_awsAccountId :: Lens.Lens' DeleteDataSet Prelude.Text
deleteDataSet_awsAccountId :: (Text -> f Text) -> DeleteDataSet -> f DeleteDataSet
deleteDataSet_awsAccountId = (DeleteDataSet -> Text)
-> (DeleteDataSet -> Text -> DeleteDataSet)
-> Lens DeleteDataSet DeleteDataSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDataSet' {Text
awsAccountId :: Text
$sel:awsAccountId:DeleteDataSet' :: DeleteDataSet -> Text
awsAccountId} -> Text
awsAccountId) (\s :: DeleteDataSet
s@DeleteDataSet' {} Text
a -> DeleteDataSet
s {$sel:awsAccountId:DeleteDataSet' :: Text
awsAccountId = Text
a} :: DeleteDataSet)
deleteDataSet_dataSetId :: Lens.Lens' DeleteDataSet Prelude.Text
deleteDataSet_dataSetId :: (Text -> f Text) -> DeleteDataSet -> f DeleteDataSet
deleteDataSet_dataSetId = (DeleteDataSet -> Text)
-> (DeleteDataSet -> Text -> DeleteDataSet)
-> Lens DeleteDataSet DeleteDataSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDataSet' {Text
dataSetId :: Text
$sel:dataSetId:DeleteDataSet' :: DeleteDataSet -> Text
dataSetId} -> Text
dataSetId) (\s :: DeleteDataSet
s@DeleteDataSet' {} Text
a -> DeleteDataSet
s {$sel:dataSetId:DeleteDataSet' :: Text
dataSetId = Text
a} :: DeleteDataSet)
instance Core.AWSRequest DeleteDataSet where
type
AWSResponse DeleteDataSet =
DeleteDataSetResponse
request :: DeleteDataSet -> Request DeleteDataSet
request = Service -> DeleteDataSet -> Request DeleteDataSet
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteDataSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteDataSet)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteDataSet))
-> Logger
-> Service
-> Proxy DeleteDataSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteDataSet)))
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 -> DeleteDataSetResponse
DeleteDataSetResponse'
(Maybe Text
-> Maybe Text -> Maybe Text -> Int -> DeleteDataSetResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Maybe Text -> Int -> DeleteDataSetResponse)
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 -> DeleteDataSetResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> DeleteDataSetResponse)
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 -> DeleteDataSetResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteDataSetResponse)
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
"DataSetId")
Either String (Int -> DeleteDataSetResponse)
-> Either String Int -> Either String DeleteDataSetResponse
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 DeleteDataSet
instance Prelude.NFData DeleteDataSet
instance Core.ToHeaders DeleteDataSet where
toHeaders :: DeleteDataSet -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteDataSet -> 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 DeleteDataSet where
toPath :: DeleteDataSet -> ByteString
toPath DeleteDataSet' {Text
dataSetId :: Text
awsAccountId :: Text
$sel:dataSetId:DeleteDataSet' :: DeleteDataSet -> Text
$sel:awsAccountId:DeleteDataSet' :: DeleteDataSet -> 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
"/data-sets/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
dataSetId
]
instance Core.ToQuery DeleteDataSet where
toQuery :: DeleteDataSet -> QueryString
toQuery = QueryString -> DeleteDataSet -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteDataSetResponse = DeleteDataSetResponse'
{
DeleteDataSetResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
DeleteDataSetResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
DeleteDataSetResponse -> Maybe Text
dataSetId :: Prelude.Maybe Prelude.Text,
DeleteDataSetResponse -> Int
status :: Prelude.Int
}
deriving (DeleteDataSetResponse -> DeleteDataSetResponse -> Bool
(DeleteDataSetResponse -> DeleteDataSetResponse -> Bool)
-> (DeleteDataSetResponse -> DeleteDataSetResponse -> Bool)
-> Eq DeleteDataSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDataSetResponse -> DeleteDataSetResponse -> Bool
$c/= :: DeleteDataSetResponse -> DeleteDataSetResponse -> Bool
== :: DeleteDataSetResponse -> DeleteDataSetResponse -> Bool
$c== :: DeleteDataSetResponse -> DeleteDataSetResponse -> Bool
Prelude.Eq, ReadPrec [DeleteDataSetResponse]
ReadPrec DeleteDataSetResponse
Int -> ReadS DeleteDataSetResponse
ReadS [DeleteDataSetResponse]
(Int -> ReadS DeleteDataSetResponse)
-> ReadS [DeleteDataSetResponse]
-> ReadPrec DeleteDataSetResponse
-> ReadPrec [DeleteDataSetResponse]
-> Read DeleteDataSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDataSetResponse]
$creadListPrec :: ReadPrec [DeleteDataSetResponse]
readPrec :: ReadPrec DeleteDataSetResponse
$creadPrec :: ReadPrec DeleteDataSetResponse
readList :: ReadS [DeleteDataSetResponse]
$creadList :: ReadS [DeleteDataSetResponse]
readsPrec :: Int -> ReadS DeleteDataSetResponse
$creadsPrec :: Int -> ReadS DeleteDataSetResponse
Prelude.Read, Int -> DeleteDataSetResponse -> ShowS
[DeleteDataSetResponse] -> ShowS
DeleteDataSetResponse -> String
(Int -> DeleteDataSetResponse -> ShowS)
-> (DeleteDataSetResponse -> String)
-> ([DeleteDataSetResponse] -> ShowS)
-> Show DeleteDataSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDataSetResponse] -> ShowS
$cshowList :: [DeleteDataSetResponse] -> ShowS
show :: DeleteDataSetResponse -> String
$cshow :: DeleteDataSetResponse -> String
showsPrec :: Int -> DeleteDataSetResponse -> ShowS
$cshowsPrec :: Int -> DeleteDataSetResponse -> ShowS
Prelude.Show, (forall x. DeleteDataSetResponse -> Rep DeleteDataSetResponse x)
-> (forall x. Rep DeleteDataSetResponse x -> DeleteDataSetResponse)
-> Generic DeleteDataSetResponse
forall x. Rep DeleteDataSetResponse x -> DeleteDataSetResponse
forall x. DeleteDataSetResponse -> Rep DeleteDataSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDataSetResponse x -> DeleteDataSetResponse
$cfrom :: forall x. DeleteDataSetResponse -> Rep DeleteDataSetResponse x
Prelude.Generic)
newDeleteDataSetResponse ::
Prelude.Int ->
DeleteDataSetResponse
newDeleteDataSetResponse :: Int -> DeleteDataSetResponse
newDeleteDataSetResponse Int
pStatus_ =
DeleteDataSetResponse' :: Maybe Text
-> Maybe Text -> Maybe Text -> Int -> DeleteDataSetResponse
DeleteDataSetResponse'
{ $sel:requestId:DeleteDataSetResponse' :: Maybe Text
requestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:DeleteDataSetResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dataSetId:DeleteDataSetResponse' :: Maybe Text
dataSetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:DeleteDataSetResponse' :: Int
status = Int
pStatus_
}
deleteDataSetResponse_requestId :: Lens.Lens' DeleteDataSetResponse (Prelude.Maybe Prelude.Text)
deleteDataSetResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> DeleteDataSetResponse -> f DeleteDataSetResponse
deleteDataSetResponse_requestId = (DeleteDataSetResponse -> Maybe Text)
-> (DeleteDataSetResponse -> Maybe Text -> DeleteDataSetResponse)
-> Lens
DeleteDataSetResponse
DeleteDataSetResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDataSetResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:DeleteDataSetResponse' :: DeleteDataSetResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: DeleteDataSetResponse
s@DeleteDataSetResponse' {} Maybe Text
a -> DeleteDataSetResponse
s {$sel:requestId:DeleteDataSetResponse' :: Maybe Text
requestId = Maybe Text
a} :: DeleteDataSetResponse)
deleteDataSetResponse_arn :: Lens.Lens' DeleteDataSetResponse (Prelude.Maybe Prelude.Text)
deleteDataSetResponse_arn :: (Maybe Text -> f (Maybe Text))
-> DeleteDataSetResponse -> f DeleteDataSetResponse
deleteDataSetResponse_arn = (DeleteDataSetResponse -> Maybe Text)
-> (DeleteDataSetResponse -> Maybe Text -> DeleteDataSetResponse)
-> Lens
DeleteDataSetResponse
DeleteDataSetResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDataSetResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:DeleteDataSetResponse' :: DeleteDataSetResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: DeleteDataSetResponse
s@DeleteDataSetResponse' {} Maybe Text
a -> DeleteDataSetResponse
s {$sel:arn:DeleteDataSetResponse' :: Maybe Text
arn = Maybe Text
a} :: DeleteDataSetResponse)
deleteDataSetResponse_dataSetId :: Lens.Lens' DeleteDataSetResponse (Prelude.Maybe Prelude.Text)
deleteDataSetResponse_dataSetId :: (Maybe Text -> f (Maybe Text))
-> DeleteDataSetResponse -> f DeleteDataSetResponse
deleteDataSetResponse_dataSetId = (DeleteDataSetResponse -> Maybe Text)
-> (DeleteDataSetResponse -> Maybe Text -> DeleteDataSetResponse)
-> Lens
DeleteDataSetResponse
DeleteDataSetResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDataSetResponse' {Maybe Text
dataSetId :: Maybe Text
$sel:dataSetId:DeleteDataSetResponse' :: DeleteDataSetResponse -> Maybe Text
dataSetId} -> Maybe Text
dataSetId) (\s :: DeleteDataSetResponse
s@DeleteDataSetResponse' {} Maybe Text
a -> DeleteDataSetResponse
s {$sel:dataSetId:DeleteDataSetResponse' :: Maybe Text
dataSetId = Maybe Text
a} :: DeleteDataSetResponse)
deleteDataSetResponse_status :: Lens.Lens' DeleteDataSetResponse Prelude.Int
deleteDataSetResponse_status :: (Int -> f Int) -> DeleteDataSetResponse -> f DeleteDataSetResponse
deleteDataSetResponse_status = (DeleteDataSetResponse -> Int)
-> (DeleteDataSetResponse -> Int -> DeleteDataSetResponse)
-> Lens DeleteDataSetResponse DeleteDataSetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDataSetResponse' {Int
status :: Int
$sel:status:DeleteDataSetResponse' :: DeleteDataSetResponse -> Int
status} -> Int
status) (\s :: DeleteDataSetResponse
s@DeleteDataSetResponse' {} Int
a -> DeleteDataSetResponse
s {$sel:status:DeleteDataSetResponse' :: Int
status = Int
a} :: DeleteDataSetResponse)
instance Prelude.NFData DeleteDataSetResponse