{-# 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.DeleteDataSource
(
DeleteDataSource (..),
newDeleteDataSource,
deleteDataSource_awsAccountId,
deleteDataSource_dataSourceId,
DeleteDataSourceResponse (..),
newDeleteDataSourceResponse,
deleteDataSourceResponse_requestId,
deleteDataSourceResponse_arn,
deleteDataSourceResponse_dataSourceId,
deleteDataSourceResponse_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 DeleteDataSource = DeleteDataSource'
{
DeleteDataSource -> Text
awsAccountId :: Prelude.Text,
DeleteDataSource -> Text
dataSourceId :: Prelude.Text
}
deriving (DeleteDataSource -> DeleteDataSource -> Bool
(DeleteDataSource -> DeleteDataSource -> Bool)
-> (DeleteDataSource -> DeleteDataSource -> Bool)
-> Eq DeleteDataSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDataSource -> DeleteDataSource -> Bool
$c/= :: DeleteDataSource -> DeleteDataSource -> Bool
== :: DeleteDataSource -> DeleteDataSource -> Bool
$c== :: DeleteDataSource -> DeleteDataSource -> Bool
Prelude.Eq, ReadPrec [DeleteDataSource]
ReadPrec DeleteDataSource
Int -> ReadS DeleteDataSource
ReadS [DeleteDataSource]
(Int -> ReadS DeleteDataSource)
-> ReadS [DeleteDataSource]
-> ReadPrec DeleteDataSource
-> ReadPrec [DeleteDataSource]
-> Read DeleteDataSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDataSource]
$creadListPrec :: ReadPrec [DeleteDataSource]
readPrec :: ReadPrec DeleteDataSource
$creadPrec :: ReadPrec DeleteDataSource
readList :: ReadS [DeleteDataSource]
$creadList :: ReadS [DeleteDataSource]
readsPrec :: Int -> ReadS DeleteDataSource
$creadsPrec :: Int -> ReadS DeleteDataSource
Prelude.Read, Int -> DeleteDataSource -> ShowS
[DeleteDataSource] -> ShowS
DeleteDataSource -> String
(Int -> DeleteDataSource -> ShowS)
-> (DeleteDataSource -> String)
-> ([DeleteDataSource] -> ShowS)
-> Show DeleteDataSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDataSource] -> ShowS
$cshowList :: [DeleteDataSource] -> ShowS
show :: DeleteDataSource -> String
$cshow :: DeleteDataSource -> String
showsPrec :: Int -> DeleteDataSource -> ShowS
$cshowsPrec :: Int -> DeleteDataSource -> ShowS
Prelude.Show, (forall x. DeleteDataSource -> Rep DeleteDataSource x)
-> (forall x. Rep DeleteDataSource x -> DeleteDataSource)
-> Generic DeleteDataSource
forall x. Rep DeleteDataSource x -> DeleteDataSource
forall x. DeleteDataSource -> Rep DeleteDataSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDataSource x -> DeleteDataSource
$cfrom :: forall x. DeleteDataSource -> Rep DeleteDataSource x
Prelude.Generic)
newDeleteDataSource ::
Prelude.Text ->
Prelude.Text ->
DeleteDataSource
newDeleteDataSource :: Text -> Text -> DeleteDataSource
newDeleteDataSource Text
pAwsAccountId_ Text
pDataSourceId_ =
DeleteDataSource' :: Text -> Text -> DeleteDataSource
DeleteDataSource'
{ $sel:awsAccountId:DeleteDataSource' :: Text
awsAccountId = Text
pAwsAccountId_,
$sel:dataSourceId:DeleteDataSource' :: Text
dataSourceId = Text
pDataSourceId_
}
deleteDataSource_awsAccountId :: Lens.Lens' DeleteDataSource Prelude.Text
deleteDataSource_awsAccountId :: (Text -> f Text) -> DeleteDataSource -> f DeleteDataSource
deleteDataSource_awsAccountId = (DeleteDataSource -> Text)
-> (DeleteDataSource -> Text -> DeleteDataSource)
-> Lens DeleteDataSource DeleteDataSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDataSource' {Text
awsAccountId :: Text
$sel:awsAccountId:DeleteDataSource' :: DeleteDataSource -> Text
awsAccountId} -> Text
awsAccountId) (\s :: DeleteDataSource
s@DeleteDataSource' {} Text
a -> DeleteDataSource
s {$sel:awsAccountId:DeleteDataSource' :: Text
awsAccountId = Text
a} :: DeleteDataSource)
deleteDataSource_dataSourceId :: Lens.Lens' DeleteDataSource Prelude.Text
deleteDataSource_dataSourceId :: (Text -> f Text) -> DeleteDataSource -> f DeleteDataSource
deleteDataSource_dataSourceId = (DeleteDataSource -> Text)
-> (DeleteDataSource -> Text -> DeleteDataSource)
-> Lens DeleteDataSource DeleteDataSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDataSource' {Text
dataSourceId :: Text
$sel:dataSourceId:DeleteDataSource' :: DeleteDataSource -> Text
dataSourceId} -> Text
dataSourceId) (\s :: DeleteDataSource
s@DeleteDataSource' {} Text
a -> DeleteDataSource
s {$sel:dataSourceId:DeleteDataSource' :: Text
dataSourceId = Text
a} :: DeleteDataSource)
instance Core.AWSRequest DeleteDataSource where
type
AWSResponse DeleteDataSource =
DeleteDataSourceResponse
request :: DeleteDataSource -> Request DeleteDataSource
request = Service -> DeleteDataSource -> Request DeleteDataSource
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteDataSource
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteDataSource)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteDataSource))
-> Logger
-> Service
-> Proxy DeleteDataSource
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteDataSource)))
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 -> DeleteDataSourceResponse
DeleteDataSourceResponse'
(Maybe Text
-> Maybe Text -> Maybe Text -> Int -> DeleteDataSourceResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text -> Maybe Text -> Int -> DeleteDataSourceResponse)
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 -> DeleteDataSourceResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> DeleteDataSourceResponse)
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 -> DeleteDataSourceResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteDataSourceResponse)
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
"DataSourceId")
Either String (Int -> DeleteDataSourceResponse)
-> Either String Int -> Either String DeleteDataSourceResponse
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 DeleteDataSource
instance Prelude.NFData DeleteDataSource
instance Core.ToHeaders DeleteDataSource where
toHeaders :: DeleteDataSource -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteDataSource -> 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 DeleteDataSource where
toPath :: DeleteDataSource -> ByteString
toPath DeleteDataSource' {Text
dataSourceId :: Text
awsAccountId :: Text
$sel:dataSourceId:DeleteDataSource' :: DeleteDataSource -> Text
$sel:awsAccountId:DeleteDataSource' :: DeleteDataSource -> 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-sources/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
dataSourceId
]
instance Core.ToQuery DeleteDataSource where
toQuery :: DeleteDataSource -> QueryString
toQuery = QueryString -> DeleteDataSource -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteDataSourceResponse = DeleteDataSourceResponse'
{
DeleteDataSourceResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
DeleteDataSourceResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
DeleteDataSourceResponse -> Maybe Text
dataSourceId :: Prelude.Maybe Prelude.Text,
DeleteDataSourceResponse -> Int
status :: Prelude.Int
}
deriving (DeleteDataSourceResponse -> DeleteDataSourceResponse -> Bool
(DeleteDataSourceResponse -> DeleteDataSourceResponse -> Bool)
-> (DeleteDataSourceResponse -> DeleteDataSourceResponse -> Bool)
-> Eq DeleteDataSourceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDataSourceResponse -> DeleteDataSourceResponse -> Bool
$c/= :: DeleteDataSourceResponse -> DeleteDataSourceResponse -> Bool
== :: DeleteDataSourceResponse -> DeleteDataSourceResponse -> Bool
$c== :: DeleteDataSourceResponse -> DeleteDataSourceResponse -> Bool
Prelude.Eq, ReadPrec [DeleteDataSourceResponse]
ReadPrec DeleteDataSourceResponse
Int -> ReadS DeleteDataSourceResponse
ReadS [DeleteDataSourceResponse]
(Int -> ReadS DeleteDataSourceResponse)
-> ReadS [DeleteDataSourceResponse]
-> ReadPrec DeleteDataSourceResponse
-> ReadPrec [DeleteDataSourceResponse]
-> Read DeleteDataSourceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDataSourceResponse]
$creadListPrec :: ReadPrec [DeleteDataSourceResponse]
readPrec :: ReadPrec DeleteDataSourceResponse
$creadPrec :: ReadPrec DeleteDataSourceResponse
readList :: ReadS [DeleteDataSourceResponse]
$creadList :: ReadS [DeleteDataSourceResponse]
readsPrec :: Int -> ReadS DeleteDataSourceResponse
$creadsPrec :: Int -> ReadS DeleteDataSourceResponse
Prelude.Read, Int -> DeleteDataSourceResponse -> ShowS
[DeleteDataSourceResponse] -> ShowS
DeleteDataSourceResponse -> String
(Int -> DeleteDataSourceResponse -> ShowS)
-> (DeleteDataSourceResponse -> String)
-> ([DeleteDataSourceResponse] -> ShowS)
-> Show DeleteDataSourceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDataSourceResponse] -> ShowS
$cshowList :: [DeleteDataSourceResponse] -> ShowS
show :: DeleteDataSourceResponse -> String
$cshow :: DeleteDataSourceResponse -> String
showsPrec :: Int -> DeleteDataSourceResponse -> ShowS
$cshowsPrec :: Int -> DeleteDataSourceResponse -> ShowS
Prelude.Show, (forall x.
DeleteDataSourceResponse -> Rep DeleteDataSourceResponse x)
-> (forall x.
Rep DeleteDataSourceResponse x -> DeleteDataSourceResponse)
-> Generic DeleteDataSourceResponse
forall x.
Rep DeleteDataSourceResponse x -> DeleteDataSourceResponse
forall x.
DeleteDataSourceResponse -> Rep DeleteDataSourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteDataSourceResponse x -> DeleteDataSourceResponse
$cfrom :: forall x.
DeleteDataSourceResponse -> Rep DeleteDataSourceResponse x
Prelude.Generic)
newDeleteDataSourceResponse ::
Prelude.Int ->
DeleteDataSourceResponse
newDeleteDataSourceResponse :: Int -> DeleteDataSourceResponse
newDeleteDataSourceResponse Int
pStatus_ =
DeleteDataSourceResponse' :: Maybe Text
-> Maybe Text -> Maybe Text -> Int -> DeleteDataSourceResponse
DeleteDataSourceResponse'
{ $sel:requestId:DeleteDataSourceResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:DeleteDataSourceResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dataSourceId:DeleteDataSourceResponse' :: Maybe Text
dataSourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:DeleteDataSourceResponse' :: Int
status = Int
pStatus_
}
deleteDataSourceResponse_requestId :: Lens.Lens' DeleteDataSourceResponse (Prelude.Maybe Prelude.Text)
deleteDataSourceResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> DeleteDataSourceResponse -> f DeleteDataSourceResponse
deleteDataSourceResponse_requestId = (DeleteDataSourceResponse -> Maybe Text)
-> (DeleteDataSourceResponse
-> Maybe Text -> DeleteDataSourceResponse)
-> Lens
DeleteDataSourceResponse
DeleteDataSourceResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDataSourceResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:DeleteDataSourceResponse' :: DeleteDataSourceResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: DeleteDataSourceResponse
s@DeleteDataSourceResponse' {} Maybe Text
a -> DeleteDataSourceResponse
s {$sel:requestId:DeleteDataSourceResponse' :: Maybe Text
requestId = Maybe Text
a} :: DeleteDataSourceResponse)
deleteDataSourceResponse_arn :: Lens.Lens' DeleteDataSourceResponse (Prelude.Maybe Prelude.Text)
deleteDataSourceResponse_arn :: (Maybe Text -> f (Maybe Text))
-> DeleteDataSourceResponse -> f DeleteDataSourceResponse
deleteDataSourceResponse_arn = (DeleteDataSourceResponse -> Maybe Text)
-> (DeleteDataSourceResponse
-> Maybe Text -> DeleteDataSourceResponse)
-> Lens
DeleteDataSourceResponse
DeleteDataSourceResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDataSourceResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:DeleteDataSourceResponse' :: DeleteDataSourceResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: DeleteDataSourceResponse
s@DeleteDataSourceResponse' {} Maybe Text
a -> DeleteDataSourceResponse
s {$sel:arn:DeleteDataSourceResponse' :: Maybe Text
arn = Maybe Text
a} :: DeleteDataSourceResponse)
deleteDataSourceResponse_dataSourceId :: Lens.Lens' DeleteDataSourceResponse (Prelude.Maybe Prelude.Text)
deleteDataSourceResponse_dataSourceId :: (Maybe Text -> f (Maybe Text))
-> DeleteDataSourceResponse -> f DeleteDataSourceResponse
deleteDataSourceResponse_dataSourceId = (DeleteDataSourceResponse -> Maybe Text)
-> (DeleteDataSourceResponse
-> Maybe Text -> DeleteDataSourceResponse)
-> Lens
DeleteDataSourceResponse
DeleteDataSourceResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDataSourceResponse' {Maybe Text
dataSourceId :: Maybe Text
$sel:dataSourceId:DeleteDataSourceResponse' :: DeleteDataSourceResponse -> Maybe Text
dataSourceId} -> Maybe Text
dataSourceId) (\s :: DeleteDataSourceResponse
s@DeleteDataSourceResponse' {} Maybe Text
a -> DeleteDataSourceResponse
s {$sel:dataSourceId:DeleteDataSourceResponse' :: Maybe Text
dataSourceId = Maybe Text
a} :: DeleteDataSourceResponse)
deleteDataSourceResponse_status :: Lens.Lens' DeleteDataSourceResponse Prelude.Int
deleteDataSourceResponse_status :: (Int -> f Int)
-> DeleteDataSourceResponse -> f DeleteDataSourceResponse
deleteDataSourceResponse_status = (DeleteDataSourceResponse -> Int)
-> (DeleteDataSourceResponse -> Int -> DeleteDataSourceResponse)
-> Lens DeleteDataSourceResponse DeleteDataSourceResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDataSourceResponse' {Int
status :: Int
$sel:status:DeleteDataSourceResponse' :: DeleteDataSourceResponse -> Int
status} -> Int
status) (\s :: DeleteDataSourceResponse
s@DeleteDataSourceResponse' {} Int
a -> DeleteDataSourceResponse
s {$sel:status:DeleteDataSourceResponse' :: Int
status = Int
a} :: DeleteDataSourceResponse)
instance Prelude.NFData DeleteDataSourceResponse