{-# 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.CreateThemeAlias
(
CreateThemeAlias (..),
newCreateThemeAlias,
createThemeAlias_awsAccountId,
createThemeAlias_themeId,
createThemeAlias_aliasName,
createThemeAlias_themeVersionNumber,
CreateThemeAliasResponse (..),
newCreateThemeAliasResponse,
createThemeAliasResponse_requestId,
createThemeAliasResponse_themeAlias,
createThemeAliasResponse_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 CreateThemeAlias = CreateThemeAlias'
{
CreateThemeAlias -> Text
awsAccountId :: Prelude.Text,
CreateThemeAlias -> Text
themeId :: Prelude.Text,
CreateThemeAlias -> Text
aliasName :: Prelude.Text,
CreateThemeAlias -> Natural
themeVersionNumber :: Prelude.Natural
}
deriving (CreateThemeAlias -> CreateThemeAlias -> Bool
(CreateThemeAlias -> CreateThemeAlias -> Bool)
-> (CreateThemeAlias -> CreateThemeAlias -> Bool)
-> Eq CreateThemeAlias
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateThemeAlias -> CreateThemeAlias -> Bool
$c/= :: CreateThemeAlias -> CreateThemeAlias -> Bool
== :: CreateThemeAlias -> CreateThemeAlias -> Bool
$c== :: CreateThemeAlias -> CreateThemeAlias -> Bool
Prelude.Eq, ReadPrec [CreateThemeAlias]
ReadPrec CreateThemeAlias
Int -> ReadS CreateThemeAlias
ReadS [CreateThemeAlias]
(Int -> ReadS CreateThemeAlias)
-> ReadS [CreateThemeAlias]
-> ReadPrec CreateThemeAlias
-> ReadPrec [CreateThemeAlias]
-> Read CreateThemeAlias
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateThemeAlias]
$creadListPrec :: ReadPrec [CreateThemeAlias]
readPrec :: ReadPrec CreateThemeAlias
$creadPrec :: ReadPrec CreateThemeAlias
readList :: ReadS [CreateThemeAlias]
$creadList :: ReadS [CreateThemeAlias]
readsPrec :: Int -> ReadS CreateThemeAlias
$creadsPrec :: Int -> ReadS CreateThemeAlias
Prelude.Read, Int -> CreateThemeAlias -> ShowS
[CreateThemeAlias] -> ShowS
CreateThemeAlias -> String
(Int -> CreateThemeAlias -> ShowS)
-> (CreateThemeAlias -> String)
-> ([CreateThemeAlias] -> ShowS)
-> Show CreateThemeAlias
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateThemeAlias] -> ShowS
$cshowList :: [CreateThemeAlias] -> ShowS
show :: CreateThemeAlias -> String
$cshow :: CreateThemeAlias -> String
showsPrec :: Int -> CreateThemeAlias -> ShowS
$cshowsPrec :: Int -> CreateThemeAlias -> ShowS
Prelude.Show, (forall x. CreateThemeAlias -> Rep CreateThemeAlias x)
-> (forall x. Rep CreateThemeAlias x -> CreateThemeAlias)
-> Generic CreateThemeAlias
forall x. Rep CreateThemeAlias x -> CreateThemeAlias
forall x. CreateThemeAlias -> Rep CreateThemeAlias x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateThemeAlias x -> CreateThemeAlias
$cfrom :: forall x. CreateThemeAlias -> Rep CreateThemeAlias x
Prelude.Generic)
newCreateThemeAlias ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Natural ->
CreateThemeAlias
newCreateThemeAlias :: Text -> Text -> Text -> Natural -> CreateThemeAlias
newCreateThemeAlias
Text
pAwsAccountId_
Text
pThemeId_
Text
pAliasName_
Natural
pThemeVersionNumber_ =
CreateThemeAlias' :: Text -> Text -> Text -> Natural -> CreateThemeAlias
CreateThemeAlias'
{ $sel:awsAccountId:CreateThemeAlias' :: Text
awsAccountId = Text
pAwsAccountId_,
$sel:themeId:CreateThemeAlias' :: Text
themeId = Text
pThemeId_,
$sel:aliasName:CreateThemeAlias' :: Text
aliasName = Text
pAliasName_,
$sel:themeVersionNumber:CreateThemeAlias' :: Natural
themeVersionNumber = Natural
pThemeVersionNumber_
}
createThemeAlias_awsAccountId :: Lens.Lens' CreateThemeAlias Prelude.Text
createThemeAlias_awsAccountId :: (Text -> f Text) -> CreateThemeAlias -> f CreateThemeAlias
createThemeAlias_awsAccountId = (CreateThemeAlias -> Text)
-> (CreateThemeAlias -> Text -> CreateThemeAlias)
-> Lens CreateThemeAlias CreateThemeAlias Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateThemeAlias' {Text
awsAccountId :: Text
$sel:awsAccountId:CreateThemeAlias' :: CreateThemeAlias -> Text
awsAccountId} -> Text
awsAccountId) (\s :: CreateThemeAlias
s@CreateThemeAlias' {} Text
a -> CreateThemeAlias
s {$sel:awsAccountId:CreateThemeAlias' :: Text
awsAccountId = Text
a} :: CreateThemeAlias)
createThemeAlias_themeId :: Lens.Lens' CreateThemeAlias Prelude.Text
createThemeAlias_themeId :: (Text -> f Text) -> CreateThemeAlias -> f CreateThemeAlias
createThemeAlias_themeId = (CreateThemeAlias -> Text)
-> (CreateThemeAlias -> Text -> CreateThemeAlias)
-> Lens CreateThemeAlias CreateThemeAlias Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateThemeAlias' {Text
themeId :: Text
$sel:themeId:CreateThemeAlias' :: CreateThemeAlias -> Text
themeId} -> Text
themeId) (\s :: CreateThemeAlias
s@CreateThemeAlias' {} Text
a -> CreateThemeAlias
s {$sel:themeId:CreateThemeAlias' :: Text
themeId = Text
a} :: CreateThemeAlias)
createThemeAlias_aliasName :: Lens.Lens' CreateThemeAlias Prelude.Text
createThemeAlias_aliasName :: (Text -> f Text) -> CreateThemeAlias -> f CreateThemeAlias
createThemeAlias_aliasName = (CreateThemeAlias -> Text)
-> (CreateThemeAlias -> Text -> CreateThemeAlias)
-> Lens CreateThemeAlias CreateThemeAlias Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateThemeAlias' {Text
aliasName :: Text
$sel:aliasName:CreateThemeAlias' :: CreateThemeAlias -> Text
aliasName} -> Text
aliasName) (\s :: CreateThemeAlias
s@CreateThemeAlias' {} Text
a -> CreateThemeAlias
s {$sel:aliasName:CreateThemeAlias' :: Text
aliasName = Text
a} :: CreateThemeAlias)
createThemeAlias_themeVersionNumber :: Lens.Lens' CreateThemeAlias Prelude.Natural
createThemeAlias_themeVersionNumber :: (Natural -> f Natural) -> CreateThemeAlias -> f CreateThemeAlias
createThemeAlias_themeVersionNumber = (CreateThemeAlias -> Natural)
-> (CreateThemeAlias -> Natural -> CreateThemeAlias)
-> Lens CreateThemeAlias CreateThemeAlias Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateThemeAlias' {Natural
themeVersionNumber :: Natural
$sel:themeVersionNumber:CreateThemeAlias' :: CreateThemeAlias -> Natural
themeVersionNumber} -> Natural
themeVersionNumber) (\s :: CreateThemeAlias
s@CreateThemeAlias' {} Natural
a -> CreateThemeAlias
s {$sel:themeVersionNumber:CreateThemeAlias' :: Natural
themeVersionNumber = Natural
a} :: CreateThemeAlias)
instance Core.AWSRequest CreateThemeAlias where
type
AWSResponse CreateThemeAlias =
CreateThemeAliasResponse
request :: CreateThemeAlias -> Request CreateThemeAlias
request = Service -> CreateThemeAlias -> Request CreateThemeAlias
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateThemeAlias
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateThemeAlias)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateThemeAlias))
-> Logger
-> Service
-> Proxy CreateThemeAlias
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateThemeAlias)))
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 ThemeAlias -> Int -> CreateThemeAliasResponse
CreateThemeAliasResponse'
(Maybe Text -> Maybe ThemeAlias -> Int -> CreateThemeAliasResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe ThemeAlias -> Int -> CreateThemeAliasResponse)
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 ThemeAlias -> Int -> CreateThemeAliasResponse)
-> Either String (Maybe ThemeAlias)
-> Either String (Int -> CreateThemeAliasResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ThemeAlias)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ThemeAlias")
Either String (Int -> CreateThemeAliasResponse)
-> Either String Int -> Either String CreateThemeAliasResponse
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 CreateThemeAlias
instance Prelude.NFData CreateThemeAlias
instance Core.ToHeaders CreateThemeAlias where
toHeaders :: CreateThemeAlias -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateThemeAlias -> 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.ToJSON CreateThemeAlias where
toJSON :: CreateThemeAlias -> Value
toJSON CreateThemeAlias' {Natural
Text
themeVersionNumber :: Natural
aliasName :: Text
themeId :: Text
awsAccountId :: Text
$sel:themeVersionNumber:CreateThemeAlias' :: CreateThemeAlias -> Natural
$sel:aliasName:CreateThemeAlias' :: CreateThemeAlias -> Text
$sel:themeId:CreateThemeAlias' :: CreateThemeAlias -> Text
$sel:awsAccountId:CreateThemeAlias' :: CreateThemeAlias -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ThemeVersionNumber" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
themeVersionNumber)
]
)
instance Core.ToPath CreateThemeAlias where
toPath :: CreateThemeAlias -> ByteString
toPath CreateThemeAlias' {Natural
Text
themeVersionNumber :: Natural
aliasName :: Text
themeId :: Text
awsAccountId :: Text
$sel:themeVersionNumber:CreateThemeAlias' :: CreateThemeAlias -> Natural
$sel:aliasName:CreateThemeAlias' :: CreateThemeAlias -> Text
$sel:themeId:CreateThemeAlias' :: CreateThemeAlias -> Text
$sel:awsAccountId:CreateThemeAlias' :: CreateThemeAlias -> 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
"/themes/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
themeId,
ByteString
"/aliases/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
aliasName
]
instance Core.ToQuery CreateThemeAlias where
toQuery :: CreateThemeAlias -> QueryString
toQuery = QueryString -> CreateThemeAlias -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateThemeAliasResponse = CreateThemeAliasResponse'
{
CreateThemeAliasResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
CreateThemeAliasResponse -> Maybe ThemeAlias
themeAlias :: Prelude.Maybe ThemeAlias,
CreateThemeAliasResponse -> Int
status :: Prelude.Int
}
deriving (CreateThemeAliasResponse -> CreateThemeAliasResponse -> Bool
(CreateThemeAliasResponse -> CreateThemeAliasResponse -> Bool)
-> (CreateThemeAliasResponse -> CreateThemeAliasResponse -> Bool)
-> Eq CreateThemeAliasResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateThemeAliasResponse -> CreateThemeAliasResponse -> Bool
$c/= :: CreateThemeAliasResponse -> CreateThemeAliasResponse -> Bool
== :: CreateThemeAliasResponse -> CreateThemeAliasResponse -> Bool
$c== :: CreateThemeAliasResponse -> CreateThemeAliasResponse -> Bool
Prelude.Eq, ReadPrec [CreateThemeAliasResponse]
ReadPrec CreateThemeAliasResponse
Int -> ReadS CreateThemeAliasResponse
ReadS [CreateThemeAliasResponse]
(Int -> ReadS CreateThemeAliasResponse)
-> ReadS [CreateThemeAliasResponse]
-> ReadPrec CreateThemeAliasResponse
-> ReadPrec [CreateThemeAliasResponse]
-> Read CreateThemeAliasResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateThemeAliasResponse]
$creadListPrec :: ReadPrec [CreateThemeAliasResponse]
readPrec :: ReadPrec CreateThemeAliasResponse
$creadPrec :: ReadPrec CreateThemeAliasResponse
readList :: ReadS [CreateThemeAliasResponse]
$creadList :: ReadS [CreateThemeAliasResponse]
readsPrec :: Int -> ReadS CreateThemeAliasResponse
$creadsPrec :: Int -> ReadS CreateThemeAliasResponse
Prelude.Read, Int -> CreateThemeAliasResponse -> ShowS
[CreateThemeAliasResponse] -> ShowS
CreateThemeAliasResponse -> String
(Int -> CreateThemeAliasResponse -> ShowS)
-> (CreateThemeAliasResponse -> String)
-> ([CreateThemeAliasResponse] -> ShowS)
-> Show CreateThemeAliasResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateThemeAliasResponse] -> ShowS
$cshowList :: [CreateThemeAliasResponse] -> ShowS
show :: CreateThemeAliasResponse -> String
$cshow :: CreateThemeAliasResponse -> String
showsPrec :: Int -> CreateThemeAliasResponse -> ShowS
$cshowsPrec :: Int -> CreateThemeAliasResponse -> ShowS
Prelude.Show, (forall x.
CreateThemeAliasResponse -> Rep CreateThemeAliasResponse x)
-> (forall x.
Rep CreateThemeAliasResponse x -> CreateThemeAliasResponse)
-> Generic CreateThemeAliasResponse
forall x.
Rep CreateThemeAliasResponse x -> CreateThemeAliasResponse
forall x.
CreateThemeAliasResponse -> Rep CreateThemeAliasResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateThemeAliasResponse x -> CreateThemeAliasResponse
$cfrom :: forall x.
CreateThemeAliasResponse -> Rep CreateThemeAliasResponse x
Prelude.Generic)
newCreateThemeAliasResponse ::
Prelude.Int ->
CreateThemeAliasResponse
newCreateThemeAliasResponse :: Int -> CreateThemeAliasResponse
newCreateThemeAliasResponse Int
pStatus_ =
CreateThemeAliasResponse' :: Maybe Text -> Maybe ThemeAlias -> Int -> CreateThemeAliasResponse
CreateThemeAliasResponse'
{ $sel:requestId:CreateThemeAliasResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:themeAlias:CreateThemeAliasResponse' :: Maybe ThemeAlias
themeAlias = Maybe ThemeAlias
forall a. Maybe a
Prelude.Nothing,
$sel:status:CreateThemeAliasResponse' :: Int
status = Int
pStatus_
}
createThemeAliasResponse_requestId :: Lens.Lens' CreateThemeAliasResponse (Prelude.Maybe Prelude.Text)
createThemeAliasResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> CreateThemeAliasResponse -> f CreateThemeAliasResponse
createThemeAliasResponse_requestId = (CreateThemeAliasResponse -> Maybe Text)
-> (CreateThemeAliasResponse
-> Maybe Text -> CreateThemeAliasResponse)
-> Lens
CreateThemeAliasResponse
CreateThemeAliasResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateThemeAliasResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:CreateThemeAliasResponse' :: CreateThemeAliasResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: CreateThemeAliasResponse
s@CreateThemeAliasResponse' {} Maybe Text
a -> CreateThemeAliasResponse
s {$sel:requestId:CreateThemeAliasResponse' :: Maybe Text
requestId = Maybe Text
a} :: CreateThemeAliasResponse)
createThemeAliasResponse_themeAlias :: Lens.Lens' CreateThemeAliasResponse (Prelude.Maybe ThemeAlias)
createThemeAliasResponse_themeAlias :: (Maybe ThemeAlias -> f (Maybe ThemeAlias))
-> CreateThemeAliasResponse -> f CreateThemeAliasResponse
createThemeAliasResponse_themeAlias = (CreateThemeAliasResponse -> Maybe ThemeAlias)
-> (CreateThemeAliasResponse
-> Maybe ThemeAlias -> CreateThemeAliasResponse)
-> Lens
CreateThemeAliasResponse
CreateThemeAliasResponse
(Maybe ThemeAlias)
(Maybe ThemeAlias)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateThemeAliasResponse' {Maybe ThemeAlias
themeAlias :: Maybe ThemeAlias
$sel:themeAlias:CreateThemeAliasResponse' :: CreateThemeAliasResponse -> Maybe ThemeAlias
themeAlias} -> Maybe ThemeAlias
themeAlias) (\s :: CreateThemeAliasResponse
s@CreateThemeAliasResponse' {} Maybe ThemeAlias
a -> CreateThemeAliasResponse
s {$sel:themeAlias:CreateThemeAliasResponse' :: Maybe ThemeAlias
themeAlias = Maybe ThemeAlias
a} :: CreateThemeAliasResponse)
createThemeAliasResponse_status :: Lens.Lens' CreateThemeAliasResponse Prelude.Int
createThemeAliasResponse_status :: (Int -> f Int)
-> CreateThemeAliasResponse -> f CreateThemeAliasResponse
createThemeAliasResponse_status = (CreateThemeAliasResponse -> Int)
-> (CreateThemeAliasResponse -> Int -> CreateThemeAliasResponse)
-> Lens CreateThemeAliasResponse CreateThemeAliasResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateThemeAliasResponse' {Int
status :: Int
$sel:status:CreateThemeAliasResponse' :: CreateThemeAliasResponse -> Int
status} -> Int
status) (\s :: CreateThemeAliasResponse
s@CreateThemeAliasResponse' {} Int
a -> CreateThemeAliasResponse
s {$sel:status:CreateThemeAliasResponse' :: Int
status = Int
a} :: CreateThemeAliasResponse)
instance Prelude.NFData CreateThemeAliasResponse