{-# 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.DescribeTemplateAlias
(
DescribeTemplateAlias (..),
newDescribeTemplateAlias,
describeTemplateAlias_awsAccountId,
describeTemplateAlias_templateId,
describeTemplateAlias_aliasName,
DescribeTemplateAliasResponse (..),
newDescribeTemplateAliasResponse,
describeTemplateAliasResponse_requestId,
describeTemplateAliasResponse_templateAlias,
describeTemplateAliasResponse_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 DescribeTemplateAlias = DescribeTemplateAlias'
{
DescribeTemplateAlias -> Text
awsAccountId :: Prelude.Text,
DescribeTemplateAlias -> Text
templateId :: Prelude.Text,
DescribeTemplateAlias -> Text
aliasName :: Prelude.Text
}
deriving (DescribeTemplateAlias -> DescribeTemplateAlias -> Bool
(DescribeTemplateAlias -> DescribeTemplateAlias -> Bool)
-> (DescribeTemplateAlias -> DescribeTemplateAlias -> Bool)
-> Eq DescribeTemplateAlias
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTemplateAlias -> DescribeTemplateAlias -> Bool
$c/= :: DescribeTemplateAlias -> DescribeTemplateAlias -> Bool
== :: DescribeTemplateAlias -> DescribeTemplateAlias -> Bool
$c== :: DescribeTemplateAlias -> DescribeTemplateAlias -> Bool
Prelude.Eq, ReadPrec [DescribeTemplateAlias]
ReadPrec DescribeTemplateAlias
Int -> ReadS DescribeTemplateAlias
ReadS [DescribeTemplateAlias]
(Int -> ReadS DescribeTemplateAlias)
-> ReadS [DescribeTemplateAlias]
-> ReadPrec DescribeTemplateAlias
-> ReadPrec [DescribeTemplateAlias]
-> Read DescribeTemplateAlias
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTemplateAlias]
$creadListPrec :: ReadPrec [DescribeTemplateAlias]
readPrec :: ReadPrec DescribeTemplateAlias
$creadPrec :: ReadPrec DescribeTemplateAlias
readList :: ReadS [DescribeTemplateAlias]
$creadList :: ReadS [DescribeTemplateAlias]
readsPrec :: Int -> ReadS DescribeTemplateAlias
$creadsPrec :: Int -> ReadS DescribeTemplateAlias
Prelude.Read, Int -> DescribeTemplateAlias -> ShowS
[DescribeTemplateAlias] -> ShowS
DescribeTemplateAlias -> String
(Int -> DescribeTemplateAlias -> ShowS)
-> (DescribeTemplateAlias -> String)
-> ([DescribeTemplateAlias] -> ShowS)
-> Show DescribeTemplateAlias
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTemplateAlias] -> ShowS
$cshowList :: [DescribeTemplateAlias] -> ShowS
show :: DescribeTemplateAlias -> String
$cshow :: DescribeTemplateAlias -> String
showsPrec :: Int -> DescribeTemplateAlias -> ShowS
$cshowsPrec :: Int -> DescribeTemplateAlias -> ShowS
Prelude.Show, (forall x. DescribeTemplateAlias -> Rep DescribeTemplateAlias x)
-> (forall x. Rep DescribeTemplateAlias x -> DescribeTemplateAlias)
-> Generic DescribeTemplateAlias
forall x. Rep DescribeTemplateAlias x -> DescribeTemplateAlias
forall x. DescribeTemplateAlias -> Rep DescribeTemplateAlias x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeTemplateAlias x -> DescribeTemplateAlias
$cfrom :: forall x. DescribeTemplateAlias -> Rep DescribeTemplateAlias x
Prelude.Generic)
newDescribeTemplateAlias ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DescribeTemplateAlias
newDescribeTemplateAlias :: Text -> Text -> Text -> DescribeTemplateAlias
newDescribeTemplateAlias
Text
pAwsAccountId_
Text
pTemplateId_
Text
pAliasName_ =
DescribeTemplateAlias' :: Text -> Text -> Text -> DescribeTemplateAlias
DescribeTemplateAlias'
{ $sel:awsAccountId:DescribeTemplateAlias' :: Text
awsAccountId =
Text
pAwsAccountId_,
$sel:templateId:DescribeTemplateAlias' :: Text
templateId = Text
pTemplateId_,
$sel:aliasName:DescribeTemplateAlias' :: Text
aliasName = Text
pAliasName_
}
describeTemplateAlias_awsAccountId :: Lens.Lens' DescribeTemplateAlias Prelude.Text
describeTemplateAlias_awsAccountId :: (Text -> f Text)
-> DescribeTemplateAlias -> f DescribeTemplateAlias
describeTemplateAlias_awsAccountId = (DescribeTemplateAlias -> Text)
-> (DescribeTemplateAlias -> Text -> DescribeTemplateAlias)
-> Lens DescribeTemplateAlias DescribeTemplateAlias Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTemplateAlias' {Text
awsAccountId :: Text
$sel:awsAccountId:DescribeTemplateAlias' :: DescribeTemplateAlias -> Text
awsAccountId} -> Text
awsAccountId) (\s :: DescribeTemplateAlias
s@DescribeTemplateAlias' {} Text
a -> DescribeTemplateAlias
s {$sel:awsAccountId:DescribeTemplateAlias' :: Text
awsAccountId = Text
a} :: DescribeTemplateAlias)
describeTemplateAlias_templateId :: Lens.Lens' DescribeTemplateAlias Prelude.Text
describeTemplateAlias_templateId :: (Text -> f Text)
-> DescribeTemplateAlias -> f DescribeTemplateAlias
describeTemplateAlias_templateId = (DescribeTemplateAlias -> Text)
-> (DescribeTemplateAlias -> Text -> DescribeTemplateAlias)
-> Lens DescribeTemplateAlias DescribeTemplateAlias Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTemplateAlias' {Text
templateId :: Text
$sel:templateId:DescribeTemplateAlias' :: DescribeTemplateAlias -> Text
templateId} -> Text
templateId) (\s :: DescribeTemplateAlias
s@DescribeTemplateAlias' {} Text
a -> DescribeTemplateAlias
s {$sel:templateId:DescribeTemplateAlias' :: Text
templateId = Text
a} :: DescribeTemplateAlias)
describeTemplateAlias_aliasName :: Lens.Lens' DescribeTemplateAlias Prelude.Text
describeTemplateAlias_aliasName :: (Text -> f Text)
-> DescribeTemplateAlias -> f DescribeTemplateAlias
describeTemplateAlias_aliasName = (DescribeTemplateAlias -> Text)
-> (DescribeTemplateAlias -> Text -> DescribeTemplateAlias)
-> Lens DescribeTemplateAlias DescribeTemplateAlias Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTemplateAlias' {Text
aliasName :: Text
$sel:aliasName:DescribeTemplateAlias' :: DescribeTemplateAlias -> Text
aliasName} -> Text
aliasName) (\s :: DescribeTemplateAlias
s@DescribeTemplateAlias' {} Text
a -> DescribeTemplateAlias
s {$sel:aliasName:DescribeTemplateAlias' :: Text
aliasName = Text
a} :: DescribeTemplateAlias)
instance Core.AWSRequest DescribeTemplateAlias where
type
AWSResponse DescribeTemplateAlias =
DescribeTemplateAliasResponse
request :: DescribeTemplateAlias -> Request DescribeTemplateAlias
request = Service -> DescribeTemplateAlias -> Request DescribeTemplateAlias
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeTemplateAlias
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeTemplateAlias)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeTemplateAlias))
-> Logger
-> Service
-> Proxy DescribeTemplateAlias
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeTemplateAlias)))
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 TemplateAlias -> Int -> DescribeTemplateAliasResponse
DescribeTemplateAliasResponse'
(Maybe Text
-> Maybe TemplateAlias -> Int -> DescribeTemplateAliasResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe TemplateAlias -> Int -> DescribeTemplateAliasResponse)
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 TemplateAlias -> Int -> DescribeTemplateAliasResponse)
-> Either String (Maybe TemplateAlias)
-> Either String (Int -> DescribeTemplateAliasResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe TemplateAlias)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TemplateAlias")
Either String (Int -> DescribeTemplateAliasResponse)
-> Either String Int -> Either String DescribeTemplateAliasResponse
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 DescribeTemplateAlias
instance Prelude.NFData DescribeTemplateAlias
instance Core.ToHeaders DescribeTemplateAlias where
toHeaders :: DescribeTemplateAlias -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeTemplateAlias -> 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 DescribeTemplateAlias where
toPath :: DescribeTemplateAlias -> ByteString
toPath DescribeTemplateAlias' {Text
aliasName :: Text
templateId :: Text
awsAccountId :: Text
$sel:aliasName:DescribeTemplateAlias' :: DescribeTemplateAlias -> Text
$sel:templateId:DescribeTemplateAlias' :: DescribeTemplateAlias -> Text
$sel:awsAccountId:DescribeTemplateAlias' :: DescribeTemplateAlias -> 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
"/templates/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
templateId,
ByteString
"/aliases/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
aliasName
]
instance Core.ToQuery DescribeTemplateAlias where
toQuery :: DescribeTemplateAlias -> QueryString
toQuery = QueryString -> DescribeTemplateAlias -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeTemplateAliasResponse = DescribeTemplateAliasResponse'
{
DescribeTemplateAliasResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
DescribeTemplateAliasResponse -> Maybe TemplateAlias
templateAlias :: Prelude.Maybe TemplateAlias,
DescribeTemplateAliasResponse -> Int
status :: Prelude.Int
}
deriving (DescribeTemplateAliasResponse
-> DescribeTemplateAliasResponse -> Bool
(DescribeTemplateAliasResponse
-> DescribeTemplateAliasResponse -> Bool)
-> (DescribeTemplateAliasResponse
-> DescribeTemplateAliasResponse -> Bool)
-> Eq DescribeTemplateAliasResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTemplateAliasResponse
-> DescribeTemplateAliasResponse -> Bool
$c/= :: DescribeTemplateAliasResponse
-> DescribeTemplateAliasResponse -> Bool
== :: DescribeTemplateAliasResponse
-> DescribeTemplateAliasResponse -> Bool
$c== :: DescribeTemplateAliasResponse
-> DescribeTemplateAliasResponse -> Bool
Prelude.Eq, ReadPrec [DescribeTemplateAliasResponse]
ReadPrec DescribeTemplateAliasResponse
Int -> ReadS DescribeTemplateAliasResponse
ReadS [DescribeTemplateAliasResponse]
(Int -> ReadS DescribeTemplateAliasResponse)
-> ReadS [DescribeTemplateAliasResponse]
-> ReadPrec DescribeTemplateAliasResponse
-> ReadPrec [DescribeTemplateAliasResponse]
-> Read DescribeTemplateAliasResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTemplateAliasResponse]
$creadListPrec :: ReadPrec [DescribeTemplateAliasResponse]
readPrec :: ReadPrec DescribeTemplateAliasResponse
$creadPrec :: ReadPrec DescribeTemplateAliasResponse
readList :: ReadS [DescribeTemplateAliasResponse]
$creadList :: ReadS [DescribeTemplateAliasResponse]
readsPrec :: Int -> ReadS DescribeTemplateAliasResponse
$creadsPrec :: Int -> ReadS DescribeTemplateAliasResponse
Prelude.Read, Int -> DescribeTemplateAliasResponse -> ShowS
[DescribeTemplateAliasResponse] -> ShowS
DescribeTemplateAliasResponse -> String
(Int -> DescribeTemplateAliasResponse -> ShowS)
-> (DescribeTemplateAliasResponse -> String)
-> ([DescribeTemplateAliasResponse] -> ShowS)
-> Show DescribeTemplateAliasResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTemplateAliasResponse] -> ShowS
$cshowList :: [DescribeTemplateAliasResponse] -> ShowS
show :: DescribeTemplateAliasResponse -> String
$cshow :: DescribeTemplateAliasResponse -> String
showsPrec :: Int -> DescribeTemplateAliasResponse -> ShowS
$cshowsPrec :: Int -> DescribeTemplateAliasResponse -> ShowS
Prelude.Show, (forall x.
DescribeTemplateAliasResponse
-> Rep DescribeTemplateAliasResponse x)
-> (forall x.
Rep DescribeTemplateAliasResponse x
-> DescribeTemplateAliasResponse)
-> Generic DescribeTemplateAliasResponse
forall x.
Rep DescribeTemplateAliasResponse x
-> DescribeTemplateAliasResponse
forall x.
DescribeTemplateAliasResponse
-> Rep DescribeTemplateAliasResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeTemplateAliasResponse x
-> DescribeTemplateAliasResponse
$cfrom :: forall x.
DescribeTemplateAliasResponse
-> Rep DescribeTemplateAliasResponse x
Prelude.Generic)
newDescribeTemplateAliasResponse ::
Prelude.Int ->
DescribeTemplateAliasResponse
newDescribeTemplateAliasResponse :: Int -> DescribeTemplateAliasResponse
newDescribeTemplateAliasResponse Int
pStatus_ =
DescribeTemplateAliasResponse' :: Maybe Text
-> Maybe TemplateAlias -> Int -> DescribeTemplateAliasResponse
DescribeTemplateAliasResponse'
{ $sel:requestId:DescribeTemplateAliasResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:templateAlias:DescribeTemplateAliasResponse' :: Maybe TemplateAlias
templateAlias = Maybe TemplateAlias
forall a. Maybe a
Prelude.Nothing,
$sel:status:DescribeTemplateAliasResponse' :: Int
status = Int
pStatus_
}
describeTemplateAliasResponse_requestId :: Lens.Lens' DescribeTemplateAliasResponse (Prelude.Maybe Prelude.Text)
describeTemplateAliasResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> DescribeTemplateAliasResponse -> f DescribeTemplateAliasResponse
describeTemplateAliasResponse_requestId = (DescribeTemplateAliasResponse -> Maybe Text)
-> (DescribeTemplateAliasResponse
-> Maybe Text -> DescribeTemplateAliasResponse)
-> Lens
DescribeTemplateAliasResponse
DescribeTemplateAliasResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTemplateAliasResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:DescribeTemplateAliasResponse' :: DescribeTemplateAliasResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: DescribeTemplateAliasResponse
s@DescribeTemplateAliasResponse' {} Maybe Text
a -> DescribeTemplateAliasResponse
s {$sel:requestId:DescribeTemplateAliasResponse' :: Maybe Text
requestId = Maybe Text
a} :: DescribeTemplateAliasResponse)
describeTemplateAliasResponse_templateAlias :: Lens.Lens' DescribeTemplateAliasResponse (Prelude.Maybe TemplateAlias)
describeTemplateAliasResponse_templateAlias :: (Maybe TemplateAlias -> f (Maybe TemplateAlias))
-> DescribeTemplateAliasResponse -> f DescribeTemplateAliasResponse
describeTemplateAliasResponse_templateAlias = (DescribeTemplateAliasResponse -> Maybe TemplateAlias)
-> (DescribeTemplateAliasResponse
-> Maybe TemplateAlias -> DescribeTemplateAliasResponse)
-> Lens
DescribeTemplateAliasResponse
DescribeTemplateAliasResponse
(Maybe TemplateAlias)
(Maybe TemplateAlias)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTemplateAliasResponse' {Maybe TemplateAlias
templateAlias :: Maybe TemplateAlias
$sel:templateAlias:DescribeTemplateAliasResponse' :: DescribeTemplateAliasResponse -> Maybe TemplateAlias
templateAlias} -> Maybe TemplateAlias
templateAlias) (\s :: DescribeTemplateAliasResponse
s@DescribeTemplateAliasResponse' {} Maybe TemplateAlias
a -> DescribeTemplateAliasResponse
s {$sel:templateAlias:DescribeTemplateAliasResponse' :: Maybe TemplateAlias
templateAlias = Maybe TemplateAlias
a} :: DescribeTemplateAliasResponse)
describeTemplateAliasResponse_status :: Lens.Lens' DescribeTemplateAliasResponse Prelude.Int
describeTemplateAliasResponse_status :: (Int -> f Int)
-> DescribeTemplateAliasResponse -> f DescribeTemplateAliasResponse
describeTemplateAliasResponse_status = (DescribeTemplateAliasResponse -> Int)
-> (DescribeTemplateAliasResponse
-> Int -> DescribeTemplateAliasResponse)
-> Lens
DescribeTemplateAliasResponse DescribeTemplateAliasResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTemplateAliasResponse' {Int
status :: Int
$sel:status:DescribeTemplateAliasResponse' :: DescribeTemplateAliasResponse -> Int
status} -> Int
status) (\s :: DescribeTemplateAliasResponse
s@DescribeTemplateAliasResponse' {} Int
a -> DescribeTemplateAliasResponse
s {$sel:status:DescribeTemplateAliasResponse' :: Int
status = Int
a} :: DescribeTemplateAliasResponse)
instance Prelude.NFData DescribeTemplateAliasResponse