{-# 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.DeleteNamespace
(
DeleteNamespace (..),
newDeleteNamespace,
deleteNamespace_awsAccountId,
deleteNamespace_namespace,
DeleteNamespaceResponse (..),
newDeleteNamespaceResponse,
deleteNamespaceResponse_requestId,
deleteNamespaceResponse_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 DeleteNamespace = DeleteNamespace'
{
DeleteNamespace -> Text
awsAccountId :: Prelude.Text,
DeleteNamespace -> Text
namespace :: Prelude.Text
}
deriving (DeleteNamespace -> DeleteNamespace -> Bool
(DeleteNamespace -> DeleteNamespace -> Bool)
-> (DeleteNamespace -> DeleteNamespace -> Bool)
-> Eq DeleteNamespace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteNamespace -> DeleteNamespace -> Bool
$c/= :: DeleteNamespace -> DeleteNamespace -> Bool
== :: DeleteNamespace -> DeleteNamespace -> Bool
$c== :: DeleteNamespace -> DeleteNamespace -> Bool
Prelude.Eq, ReadPrec [DeleteNamespace]
ReadPrec DeleteNamespace
Int -> ReadS DeleteNamespace
ReadS [DeleteNamespace]
(Int -> ReadS DeleteNamespace)
-> ReadS [DeleteNamespace]
-> ReadPrec DeleteNamespace
-> ReadPrec [DeleteNamespace]
-> Read DeleteNamespace
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteNamespace]
$creadListPrec :: ReadPrec [DeleteNamespace]
readPrec :: ReadPrec DeleteNamespace
$creadPrec :: ReadPrec DeleteNamespace
readList :: ReadS [DeleteNamespace]
$creadList :: ReadS [DeleteNamespace]
readsPrec :: Int -> ReadS DeleteNamespace
$creadsPrec :: Int -> ReadS DeleteNamespace
Prelude.Read, Int -> DeleteNamespace -> ShowS
[DeleteNamespace] -> ShowS
DeleteNamespace -> String
(Int -> DeleteNamespace -> ShowS)
-> (DeleteNamespace -> String)
-> ([DeleteNamespace] -> ShowS)
-> Show DeleteNamespace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteNamespace] -> ShowS
$cshowList :: [DeleteNamespace] -> ShowS
show :: DeleteNamespace -> String
$cshow :: DeleteNamespace -> String
showsPrec :: Int -> DeleteNamespace -> ShowS
$cshowsPrec :: Int -> DeleteNamespace -> ShowS
Prelude.Show, (forall x. DeleteNamespace -> Rep DeleteNamespace x)
-> (forall x. Rep DeleteNamespace x -> DeleteNamespace)
-> Generic DeleteNamespace
forall x. Rep DeleteNamespace x -> DeleteNamespace
forall x. DeleteNamespace -> Rep DeleteNamespace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteNamespace x -> DeleteNamespace
$cfrom :: forall x. DeleteNamespace -> Rep DeleteNamespace x
Prelude.Generic)
newDeleteNamespace ::
Prelude.Text ->
Prelude.Text ->
DeleteNamespace
newDeleteNamespace :: Text -> Text -> DeleteNamespace
newDeleteNamespace Text
pAwsAccountId_ Text
pNamespace_ =
DeleteNamespace' :: Text -> Text -> DeleteNamespace
DeleteNamespace'
{ $sel:awsAccountId:DeleteNamespace' :: Text
awsAccountId = Text
pAwsAccountId_,
$sel:namespace:DeleteNamespace' :: Text
namespace = Text
pNamespace_
}
deleteNamespace_awsAccountId :: Lens.Lens' DeleteNamespace Prelude.Text
deleteNamespace_awsAccountId :: (Text -> f Text) -> DeleteNamespace -> f DeleteNamespace
deleteNamespace_awsAccountId = (DeleteNamespace -> Text)
-> (DeleteNamespace -> Text -> DeleteNamespace)
-> Lens DeleteNamespace DeleteNamespace Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteNamespace' {Text
awsAccountId :: Text
$sel:awsAccountId:DeleteNamespace' :: DeleteNamespace -> Text
awsAccountId} -> Text
awsAccountId) (\s :: DeleteNamespace
s@DeleteNamespace' {} Text
a -> DeleteNamespace
s {$sel:awsAccountId:DeleteNamespace' :: Text
awsAccountId = Text
a} :: DeleteNamespace)
deleteNamespace_namespace :: Lens.Lens' DeleteNamespace Prelude.Text
deleteNamespace_namespace :: (Text -> f Text) -> DeleteNamespace -> f DeleteNamespace
deleteNamespace_namespace = (DeleteNamespace -> Text)
-> (DeleteNamespace -> Text -> DeleteNamespace)
-> Lens DeleteNamespace DeleteNamespace Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteNamespace' {Text
namespace :: Text
$sel:namespace:DeleteNamespace' :: DeleteNamespace -> Text
namespace} -> Text
namespace) (\s :: DeleteNamespace
s@DeleteNamespace' {} Text
a -> DeleteNamespace
s {$sel:namespace:DeleteNamespace' :: Text
namespace = Text
a} :: DeleteNamespace)
instance Core.AWSRequest DeleteNamespace where
type
AWSResponse DeleteNamespace =
DeleteNamespaceResponse
request :: DeleteNamespace -> Request DeleteNamespace
request = Service -> DeleteNamespace -> Request DeleteNamespace
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteNamespace
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteNamespace)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteNamespace))
-> Logger
-> Service
-> Proxy DeleteNamespace
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteNamespace)))
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 -> DeleteNamespaceResponse
DeleteNamespaceResponse'
(Maybe Text -> Int -> DeleteNamespaceResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteNamespaceResponse)
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 -> DeleteNamespaceResponse)
-> Either String Int -> Either String DeleteNamespaceResponse
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 DeleteNamespace
instance Prelude.NFData DeleteNamespace
instance Core.ToHeaders DeleteNamespace where
toHeaders :: DeleteNamespace -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteNamespace -> 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 DeleteNamespace where
toPath :: DeleteNamespace -> ByteString
toPath DeleteNamespace' {Text
namespace :: Text
awsAccountId :: Text
$sel:namespace:DeleteNamespace' :: DeleteNamespace -> Text
$sel:awsAccountId:DeleteNamespace' :: DeleteNamespace -> 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
"/namespaces/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
namespace
]
instance Core.ToQuery DeleteNamespace where
toQuery :: DeleteNamespace -> QueryString
toQuery = QueryString -> DeleteNamespace -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteNamespaceResponse = DeleteNamespaceResponse'
{
DeleteNamespaceResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
DeleteNamespaceResponse -> Int
status :: Prelude.Int
}
deriving (DeleteNamespaceResponse -> DeleteNamespaceResponse -> Bool
(DeleteNamespaceResponse -> DeleteNamespaceResponse -> Bool)
-> (DeleteNamespaceResponse -> DeleteNamespaceResponse -> Bool)
-> Eq DeleteNamespaceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteNamespaceResponse -> DeleteNamespaceResponse -> Bool
$c/= :: DeleteNamespaceResponse -> DeleteNamespaceResponse -> Bool
== :: DeleteNamespaceResponse -> DeleteNamespaceResponse -> Bool
$c== :: DeleteNamespaceResponse -> DeleteNamespaceResponse -> Bool
Prelude.Eq, ReadPrec [DeleteNamespaceResponse]
ReadPrec DeleteNamespaceResponse
Int -> ReadS DeleteNamespaceResponse
ReadS [DeleteNamespaceResponse]
(Int -> ReadS DeleteNamespaceResponse)
-> ReadS [DeleteNamespaceResponse]
-> ReadPrec DeleteNamespaceResponse
-> ReadPrec [DeleteNamespaceResponse]
-> Read DeleteNamespaceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteNamespaceResponse]
$creadListPrec :: ReadPrec [DeleteNamespaceResponse]
readPrec :: ReadPrec DeleteNamespaceResponse
$creadPrec :: ReadPrec DeleteNamespaceResponse
readList :: ReadS [DeleteNamespaceResponse]
$creadList :: ReadS [DeleteNamespaceResponse]
readsPrec :: Int -> ReadS DeleteNamespaceResponse
$creadsPrec :: Int -> ReadS DeleteNamespaceResponse
Prelude.Read, Int -> DeleteNamespaceResponse -> ShowS
[DeleteNamespaceResponse] -> ShowS
DeleteNamespaceResponse -> String
(Int -> DeleteNamespaceResponse -> ShowS)
-> (DeleteNamespaceResponse -> String)
-> ([DeleteNamespaceResponse] -> ShowS)
-> Show DeleteNamespaceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteNamespaceResponse] -> ShowS
$cshowList :: [DeleteNamespaceResponse] -> ShowS
show :: DeleteNamespaceResponse -> String
$cshow :: DeleteNamespaceResponse -> String
showsPrec :: Int -> DeleteNamespaceResponse -> ShowS
$cshowsPrec :: Int -> DeleteNamespaceResponse -> ShowS
Prelude.Show, (forall x.
DeleteNamespaceResponse -> Rep DeleteNamespaceResponse x)
-> (forall x.
Rep DeleteNamespaceResponse x -> DeleteNamespaceResponse)
-> Generic DeleteNamespaceResponse
forall x. Rep DeleteNamespaceResponse x -> DeleteNamespaceResponse
forall x. DeleteNamespaceResponse -> Rep DeleteNamespaceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteNamespaceResponse x -> DeleteNamespaceResponse
$cfrom :: forall x. DeleteNamespaceResponse -> Rep DeleteNamespaceResponse x
Prelude.Generic)
newDeleteNamespaceResponse ::
Prelude.Int ->
DeleteNamespaceResponse
newDeleteNamespaceResponse :: Int -> DeleteNamespaceResponse
newDeleteNamespaceResponse Int
pStatus_ =
DeleteNamespaceResponse' :: Maybe Text -> Int -> DeleteNamespaceResponse
DeleteNamespaceResponse'
{ $sel:requestId:DeleteNamespaceResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:DeleteNamespaceResponse' :: Int
status = Int
pStatus_
}
deleteNamespaceResponse_requestId :: Lens.Lens' DeleteNamespaceResponse (Prelude.Maybe Prelude.Text)
deleteNamespaceResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> DeleteNamespaceResponse -> f DeleteNamespaceResponse
deleteNamespaceResponse_requestId = (DeleteNamespaceResponse -> Maybe Text)
-> (DeleteNamespaceResponse
-> Maybe Text -> DeleteNamespaceResponse)
-> Lens
DeleteNamespaceResponse
DeleteNamespaceResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteNamespaceResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:DeleteNamespaceResponse' :: DeleteNamespaceResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: DeleteNamespaceResponse
s@DeleteNamespaceResponse' {} Maybe Text
a -> DeleteNamespaceResponse
s {$sel:requestId:DeleteNamespaceResponse' :: Maybe Text
requestId = Maybe Text
a} :: DeleteNamespaceResponse)
deleteNamespaceResponse_status :: Lens.Lens' DeleteNamespaceResponse Prelude.Int
deleteNamespaceResponse_status :: (Int -> f Int)
-> DeleteNamespaceResponse -> f DeleteNamespaceResponse
deleteNamespaceResponse_status = (DeleteNamespaceResponse -> Int)
-> (DeleteNamespaceResponse -> Int -> DeleteNamespaceResponse)
-> Lens DeleteNamespaceResponse DeleteNamespaceResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteNamespaceResponse' {Int
status :: Int
$sel:status:DeleteNamespaceResponse' :: DeleteNamespaceResponse -> Int
status} -> Int
status) (\s :: DeleteNamespaceResponse
s@DeleteNamespaceResponse' {} Int
a -> DeleteNamespaceResponse
s {$sel:status:DeleteNamespaceResponse' :: Int
status = Int
a} :: DeleteNamespaceResponse)
instance Prelude.NFData DeleteNamespaceResponse