{-# 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.DescribeNamespace
(
DescribeNamespace (..),
newDescribeNamespace,
describeNamespace_awsAccountId,
describeNamespace_namespace,
DescribeNamespaceResponse (..),
newDescribeNamespaceResponse,
describeNamespaceResponse_requestId,
describeNamespaceResponse_namespace,
describeNamespaceResponse_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 DescribeNamespace = DescribeNamespace'
{
DescribeNamespace -> Text
awsAccountId :: Prelude.Text,
DescribeNamespace -> Text
namespace :: Prelude.Text
}
deriving (DescribeNamespace -> DescribeNamespace -> Bool
(DescribeNamespace -> DescribeNamespace -> Bool)
-> (DescribeNamespace -> DescribeNamespace -> Bool)
-> Eq DescribeNamespace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeNamespace -> DescribeNamespace -> Bool
$c/= :: DescribeNamespace -> DescribeNamespace -> Bool
== :: DescribeNamespace -> DescribeNamespace -> Bool
$c== :: DescribeNamespace -> DescribeNamespace -> Bool
Prelude.Eq, ReadPrec [DescribeNamespace]
ReadPrec DescribeNamespace
Int -> ReadS DescribeNamespace
ReadS [DescribeNamespace]
(Int -> ReadS DescribeNamespace)
-> ReadS [DescribeNamespace]
-> ReadPrec DescribeNamespace
-> ReadPrec [DescribeNamespace]
-> Read DescribeNamespace
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeNamespace]
$creadListPrec :: ReadPrec [DescribeNamespace]
readPrec :: ReadPrec DescribeNamespace
$creadPrec :: ReadPrec DescribeNamespace
readList :: ReadS [DescribeNamespace]
$creadList :: ReadS [DescribeNamespace]
readsPrec :: Int -> ReadS DescribeNamespace
$creadsPrec :: Int -> ReadS DescribeNamespace
Prelude.Read, Int -> DescribeNamespace -> ShowS
[DescribeNamespace] -> ShowS
DescribeNamespace -> String
(Int -> DescribeNamespace -> ShowS)
-> (DescribeNamespace -> String)
-> ([DescribeNamespace] -> ShowS)
-> Show DescribeNamespace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeNamespace] -> ShowS
$cshowList :: [DescribeNamespace] -> ShowS
show :: DescribeNamespace -> String
$cshow :: DescribeNamespace -> String
showsPrec :: Int -> DescribeNamespace -> ShowS
$cshowsPrec :: Int -> DescribeNamespace -> ShowS
Prelude.Show, (forall x. DescribeNamespace -> Rep DescribeNamespace x)
-> (forall x. Rep DescribeNamespace x -> DescribeNamespace)
-> Generic DescribeNamespace
forall x. Rep DescribeNamespace x -> DescribeNamespace
forall x. DescribeNamespace -> Rep DescribeNamespace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeNamespace x -> DescribeNamespace
$cfrom :: forall x. DescribeNamespace -> Rep DescribeNamespace x
Prelude.Generic)
newDescribeNamespace ::
Prelude.Text ->
Prelude.Text ->
DescribeNamespace
newDescribeNamespace :: Text -> Text -> DescribeNamespace
newDescribeNamespace Text
pAwsAccountId_ Text
pNamespace_ =
DescribeNamespace' :: Text -> Text -> DescribeNamespace
DescribeNamespace'
{ $sel:awsAccountId:DescribeNamespace' :: Text
awsAccountId = Text
pAwsAccountId_,
$sel:namespace:DescribeNamespace' :: Text
namespace = Text
pNamespace_
}
describeNamespace_awsAccountId :: Lens.Lens' DescribeNamespace Prelude.Text
describeNamespace_awsAccountId :: (Text -> f Text) -> DescribeNamespace -> f DescribeNamespace
describeNamespace_awsAccountId = (DescribeNamespace -> Text)
-> (DescribeNamespace -> Text -> DescribeNamespace)
-> Lens DescribeNamespace DescribeNamespace Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNamespace' {Text
awsAccountId :: Text
$sel:awsAccountId:DescribeNamespace' :: DescribeNamespace -> Text
awsAccountId} -> Text
awsAccountId) (\s :: DescribeNamespace
s@DescribeNamespace' {} Text
a -> DescribeNamespace
s {$sel:awsAccountId:DescribeNamespace' :: Text
awsAccountId = Text
a} :: DescribeNamespace)
describeNamespace_namespace :: Lens.Lens' DescribeNamespace Prelude.Text
describeNamespace_namespace :: (Text -> f Text) -> DescribeNamespace -> f DescribeNamespace
describeNamespace_namespace = (DescribeNamespace -> Text)
-> (DescribeNamespace -> Text -> DescribeNamespace)
-> Lens DescribeNamespace DescribeNamespace Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNamespace' {Text
namespace :: Text
$sel:namespace:DescribeNamespace' :: DescribeNamespace -> Text
namespace} -> Text
namespace) (\s :: DescribeNamespace
s@DescribeNamespace' {} Text
a -> DescribeNamespace
s {$sel:namespace:DescribeNamespace' :: Text
namespace = Text
a} :: DescribeNamespace)
instance Core.AWSRequest DescribeNamespace where
type
AWSResponse DescribeNamespace =
DescribeNamespaceResponse
request :: DescribeNamespace -> Request DescribeNamespace
request = Service -> DescribeNamespace -> Request DescribeNamespace
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeNamespace
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeNamespace)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeNamespace))
-> Logger
-> Service
-> Proxy DescribeNamespace
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeNamespace)))
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 NamespaceInfoV2 -> Int -> DescribeNamespaceResponse
DescribeNamespaceResponse'
(Maybe Text
-> Maybe NamespaceInfoV2 -> Int -> DescribeNamespaceResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe NamespaceInfoV2 -> Int -> DescribeNamespaceResponse)
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 NamespaceInfoV2 -> Int -> DescribeNamespaceResponse)
-> Either String (Maybe NamespaceInfoV2)
-> Either String (Int -> DescribeNamespaceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe NamespaceInfoV2)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Namespace")
Either String (Int -> DescribeNamespaceResponse)
-> Either String Int -> Either String DescribeNamespaceResponse
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 DescribeNamespace
instance Prelude.NFData DescribeNamespace
instance Core.ToHeaders DescribeNamespace where
toHeaders :: DescribeNamespace -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeNamespace -> 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 DescribeNamespace where
toPath :: DescribeNamespace -> ByteString
toPath DescribeNamespace' {Text
namespace :: Text
awsAccountId :: Text
$sel:namespace:DescribeNamespace' :: DescribeNamespace -> Text
$sel:awsAccountId:DescribeNamespace' :: DescribeNamespace -> 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 DescribeNamespace where
toQuery :: DescribeNamespace -> QueryString
toQuery = QueryString -> DescribeNamespace -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeNamespaceResponse = DescribeNamespaceResponse'
{
DescribeNamespaceResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
DescribeNamespaceResponse -> Maybe NamespaceInfoV2
namespace :: Prelude.Maybe NamespaceInfoV2,
DescribeNamespaceResponse -> Int
status :: Prelude.Int
}
deriving (DescribeNamespaceResponse -> DescribeNamespaceResponse -> Bool
(DescribeNamespaceResponse -> DescribeNamespaceResponse -> Bool)
-> (DescribeNamespaceResponse -> DescribeNamespaceResponse -> Bool)
-> Eq DescribeNamespaceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeNamespaceResponse -> DescribeNamespaceResponse -> Bool
$c/= :: DescribeNamespaceResponse -> DescribeNamespaceResponse -> Bool
== :: DescribeNamespaceResponse -> DescribeNamespaceResponse -> Bool
$c== :: DescribeNamespaceResponse -> DescribeNamespaceResponse -> Bool
Prelude.Eq, ReadPrec [DescribeNamespaceResponse]
ReadPrec DescribeNamespaceResponse
Int -> ReadS DescribeNamespaceResponse
ReadS [DescribeNamespaceResponse]
(Int -> ReadS DescribeNamespaceResponse)
-> ReadS [DescribeNamespaceResponse]
-> ReadPrec DescribeNamespaceResponse
-> ReadPrec [DescribeNamespaceResponse]
-> Read DescribeNamespaceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeNamespaceResponse]
$creadListPrec :: ReadPrec [DescribeNamespaceResponse]
readPrec :: ReadPrec DescribeNamespaceResponse
$creadPrec :: ReadPrec DescribeNamespaceResponse
readList :: ReadS [DescribeNamespaceResponse]
$creadList :: ReadS [DescribeNamespaceResponse]
readsPrec :: Int -> ReadS DescribeNamespaceResponse
$creadsPrec :: Int -> ReadS DescribeNamespaceResponse
Prelude.Read, Int -> DescribeNamespaceResponse -> ShowS
[DescribeNamespaceResponse] -> ShowS
DescribeNamespaceResponse -> String
(Int -> DescribeNamespaceResponse -> ShowS)
-> (DescribeNamespaceResponse -> String)
-> ([DescribeNamespaceResponse] -> ShowS)
-> Show DescribeNamespaceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeNamespaceResponse] -> ShowS
$cshowList :: [DescribeNamespaceResponse] -> ShowS
show :: DescribeNamespaceResponse -> String
$cshow :: DescribeNamespaceResponse -> String
showsPrec :: Int -> DescribeNamespaceResponse -> ShowS
$cshowsPrec :: Int -> DescribeNamespaceResponse -> ShowS
Prelude.Show, (forall x.
DescribeNamespaceResponse -> Rep DescribeNamespaceResponse x)
-> (forall x.
Rep DescribeNamespaceResponse x -> DescribeNamespaceResponse)
-> Generic DescribeNamespaceResponse
forall x.
Rep DescribeNamespaceResponse x -> DescribeNamespaceResponse
forall x.
DescribeNamespaceResponse -> Rep DescribeNamespaceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeNamespaceResponse x -> DescribeNamespaceResponse
$cfrom :: forall x.
DescribeNamespaceResponse -> Rep DescribeNamespaceResponse x
Prelude.Generic)
newDescribeNamespaceResponse ::
Prelude.Int ->
DescribeNamespaceResponse
newDescribeNamespaceResponse :: Int -> DescribeNamespaceResponse
newDescribeNamespaceResponse Int
pStatus_ =
DescribeNamespaceResponse' :: Maybe Text
-> Maybe NamespaceInfoV2 -> Int -> DescribeNamespaceResponse
DescribeNamespaceResponse'
{ $sel:requestId:DescribeNamespaceResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:namespace:DescribeNamespaceResponse' :: Maybe NamespaceInfoV2
namespace = Maybe NamespaceInfoV2
forall a. Maybe a
Prelude.Nothing,
$sel:status:DescribeNamespaceResponse' :: Int
status = Int
pStatus_
}
describeNamespaceResponse_requestId :: Lens.Lens' DescribeNamespaceResponse (Prelude.Maybe Prelude.Text)
describeNamespaceResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> DescribeNamespaceResponse -> f DescribeNamespaceResponse
describeNamespaceResponse_requestId = (DescribeNamespaceResponse -> Maybe Text)
-> (DescribeNamespaceResponse
-> Maybe Text -> DescribeNamespaceResponse)
-> Lens
DescribeNamespaceResponse
DescribeNamespaceResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNamespaceResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:DescribeNamespaceResponse' :: DescribeNamespaceResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: DescribeNamespaceResponse
s@DescribeNamespaceResponse' {} Maybe Text
a -> DescribeNamespaceResponse
s {$sel:requestId:DescribeNamespaceResponse' :: Maybe Text
requestId = Maybe Text
a} :: DescribeNamespaceResponse)
describeNamespaceResponse_namespace :: Lens.Lens' DescribeNamespaceResponse (Prelude.Maybe NamespaceInfoV2)
describeNamespaceResponse_namespace :: (Maybe NamespaceInfoV2 -> f (Maybe NamespaceInfoV2))
-> DescribeNamespaceResponse -> f DescribeNamespaceResponse
describeNamespaceResponse_namespace = (DescribeNamespaceResponse -> Maybe NamespaceInfoV2)
-> (DescribeNamespaceResponse
-> Maybe NamespaceInfoV2 -> DescribeNamespaceResponse)
-> Lens
DescribeNamespaceResponse
DescribeNamespaceResponse
(Maybe NamespaceInfoV2)
(Maybe NamespaceInfoV2)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNamespaceResponse' {Maybe NamespaceInfoV2
namespace :: Maybe NamespaceInfoV2
$sel:namespace:DescribeNamespaceResponse' :: DescribeNamespaceResponse -> Maybe NamespaceInfoV2
namespace} -> Maybe NamespaceInfoV2
namespace) (\s :: DescribeNamespaceResponse
s@DescribeNamespaceResponse' {} Maybe NamespaceInfoV2
a -> DescribeNamespaceResponse
s {$sel:namespace:DescribeNamespaceResponse' :: Maybe NamespaceInfoV2
namespace = Maybe NamespaceInfoV2
a} :: DescribeNamespaceResponse)
describeNamespaceResponse_status :: Lens.Lens' DescribeNamespaceResponse Prelude.Int
describeNamespaceResponse_status :: (Int -> f Int)
-> DescribeNamespaceResponse -> f DescribeNamespaceResponse
describeNamespaceResponse_status = (DescribeNamespaceResponse -> Int)
-> (DescribeNamespaceResponse -> Int -> DescribeNamespaceResponse)
-> Lens DescribeNamespaceResponse DescribeNamespaceResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNamespaceResponse' {Int
status :: Int
$sel:status:DescribeNamespaceResponse' :: DescribeNamespaceResponse -> Int
status} -> Int
status) (\s :: DescribeNamespaceResponse
s@DescribeNamespaceResponse' {} Int
a -> DescribeNamespaceResponse
s {$sel:status:DescribeNamespaceResponse' :: Int
status = Int
a} :: DescribeNamespaceResponse)
instance Prelude.NFData DescribeNamespaceResponse