{-# 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.UpdateThemeAlias
(
UpdateThemeAlias (..),
newUpdateThemeAlias,
updateThemeAlias_awsAccountId,
updateThemeAlias_themeId,
updateThemeAlias_aliasName,
updateThemeAlias_themeVersionNumber,
UpdateThemeAliasResponse (..),
newUpdateThemeAliasResponse,
updateThemeAliasResponse_requestId,
updateThemeAliasResponse_themeAlias,
updateThemeAliasResponse_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 UpdateThemeAlias = UpdateThemeAlias'
{
UpdateThemeAlias -> Text
awsAccountId :: Prelude.Text,
UpdateThemeAlias -> Text
themeId :: Prelude.Text,
UpdateThemeAlias -> Text
aliasName :: Prelude.Text,
UpdateThemeAlias -> Natural
themeVersionNumber :: Prelude.Natural
}
deriving (UpdateThemeAlias -> UpdateThemeAlias -> Bool
(UpdateThemeAlias -> UpdateThemeAlias -> Bool)
-> (UpdateThemeAlias -> UpdateThemeAlias -> Bool)
-> Eq UpdateThemeAlias
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateThemeAlias -> UpdateThemeAlias -> Bool
$c/= :: UpdateThemeAlias -> UpdateThemeAlias -> Bool
== :: UpdateThemeAlias -> UpdateThemeAlias -> Bool
$c== :: UpdateThemeAlias -> UpdateThemeAlias -> Bool
Prelude.Eq, ReadPrec [UpdateThemeAlias]
ReadPrec UpdateThemeAlias
Int -> ReadS UpdateThemeAlias
ReadS [UpdateThemeAlias]
(Int -> ReadS UpdateThemeAlias)
-> ReadS [UpdateThemeAlias]
-> ReadPrec UpdateThemeAlias
-> ReadPrec [UpdateThemeAlias]
-> Read UpdateThemeAlias
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateThemeAlias]
$creadListPrec :: ReadPrec [UpdateThemeAlias]
readPrec :: ReadPrec UpdateThemeAlias
$creadPrec :: ReadPrec UpdateThemeAlias
readList :: ReadS [UpdateThemeAlias]
$creadList :: ReadS [UpdateThemeAlias]
readsPrec :: Int -> ReadS UpdateThemeAlias
$creadsPrec :: Int -> ReadS UpdateThemeAlias
Prelude.Read, Int -> UpdateThemeAlias -> ShowS
[UpdateThemeAlias] -> ShowS
UpdateThemeAlias -> String
(Int -> UpdateThemeAlias -> ShowS)
-> (UpdateThemeAlias -> String)
-> ([UpdateThemeAlias] -> ShowS)
-> Show UpdateThemeAlias
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateThemeAlias] -> ShowS
$cshowList :: [UpdateThemeAlias] -> ShowS
show :: UpdateThemeAlias -> String
$cshow :: UpdateThemeAlias -> String
showsPrec :: Int -> UpdateThemeAlias -> ShowS
$cshowsPrec :: Int -> UpdateThemeAlias -> ShowS
Prelude.Show, (forall x. UpdateThemeAlias -> Rep UpdateThemeAlias x)
-> (forall x. Rep UpdateThemeAlias x -> UpdateThemeAlias)
-> Generic UpdateThemeAlias
forall x. Rep UpdateThemeAlias x -> UpdateThemeAlias
forall x. UpdateThemeAlias -> Rep UpdateThemeAlias x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateThemeAlias x -> UpdateThemeAlias
$cfrom :: forall x. UpdateThemeAlias -> Rep UpdateThemeAlias x
Prelude.Generic)
newUpdateThemeAlias ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Natural ->
UpdateThemeAlias
newUpdateThemeAlias :: Text -> Text -> Text -> Natural -> UpdateThemeAlias
newUpdateThemeAlias
Text
pAwsAccountId_
Text
pThemeId_
Text
pAliasName_
Natural
pThemeVersionNumber_ =
UpdateThemeAlias' :: Text -> Text -> Text -> Natural -> UpdateThemeAlias
UpdateThemeAlias'
{ $sel:awsAccountId:UpdateThemeAlias' :: Text
awsAccountId = Text
pAwsAccountId_,
$sel:themeId:UpdateThemeAlias' :: Text
themeId = Text
pThemeId_,
$sel:aliasName:UpdateThemeAlias' :: Text
aliasName = Text
pAliasName_,
$sel:themeVersionNumber:UpdateThemeAlias' :: Natural
themeVersionNumber = Natural
pThemeVersionNumber_
}
updateThemeAlias_awsAccountId :: Lens.Lens' UpdateThemeAlias Prelude.Text
updateThemeAlias_awsAccountId :: (Text -> f Text) -> UpdateThemeAlias -> f UpdateThemeAlias
updateThemeAlias_awsAccountId = (UpdateThemeAlias -> Text)
-> (UpdateThemeAlias -> Text -> UpdateThemeAlias)
-> Lens UpdateThemeAlias UpdateThemeAlias Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThemeAlias' {Text
awsAccountId :: Text
$sel:awsAccountId:UpdateThemeAlias' :: UpdateThemeAlias -> Text
awsAccountId} -> Text
awsAccountId) (\s :: UpdateThemeAlias
s@UpdateThemeAlias' {} Text
a -> UpdateThemeAlias
s {$sel:awsAccountId:UpdateThemeAlias' :: Text
awsAccountId = Text
a} :: UpdateThemeAlias)
updateThemeAlias_themeId :: Lens.Lens' UpdateThemeAlias Prelude.Text
updateThemeAlias_themeId :: (Text -> f Text) -> UpdateThemeAlias -> f UpdateThemeAlias
updateThemeAlias_themeId = (UpdateThemeAlias -> Text)
-> (UpdateThemeAlias -> Text -> UpdateThemeAlias)
-> Lens UpdateThemeAlias UpdateThemeAlias Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThemeAlias' {Text
themeId :: Text
$sel:themeId:UpdateThemeAlias' :: UpdateThemeAlias -> Text
themeId} -> Text
themeId) (\s :: UpdateThemeAlias
s@UpdateThemeAlias' {} Text
a -> UpdateThemeAlias
s {$sel:themeId:UpdateThemeAlias' :: Text
themeId = Text
a} :: UpdateThemeAlias)
updateThemeAlias_aliasName :: Lens.Lens' UpdateThemeAlias Prelude.Text
updateThemeAlias_aliasName :: (Text -> f Text) -> UpdateThemeAlias -> f UpdateThemeAlias
updateThemeAlias_aliasName = (UpdateThemeAlias -> Text)
-> (UpdateThemeAlias -> Text -> UpdateThemeAlias)
-> Lens UpdateThemeAlias UpdateThemeAlias Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThemeAlias' {Text
aliasName :: Text
$sel:aliasName:UpdateThemeAlias' :: UpdateThemeAlias -> Text
aliasName} -> Text
aliasName) (\s :: UpdateThemeAlias
s@UpdateThemeAlias' {} Text
a -> UpdateThemeAlias
s {$sel:aliasName:UpdateThemeAlias' :: Text
aliasName = Text
a} :: UpdateThemeAlias)
updateThemeAlias_themeVersionNumber :: Lens.Lens' UpdateThemeAlias Prelude.Natural
updateThemeAlias_themeVersionNumber :: (Natural -> f Natural) -> UpdateThemeAlias -> f UpdateThemeAlias
updateThemeAlias_themeVersionNumber = (UpdateThemeAlias -> Natural)
-> (UpdateThemeAlias -> Natural -> UpdateThemeAlias)
-> Lens UpdateThemeAlias UpdateThemeAlias Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThemeAlias' {Natural
themeVersionNumber :: Natural
$sel:themeVersionNumber:UpdateThemeAlias' :: UpdateThemeAlias -> Natural
themeVersionNumber} -> Natural
themeVersionNumber) (\s :: UpdateThemeAlias
s@UpdateThemeAlias' {} Natural
a -> UpdateThemeAlias
s {$sel:themeVersionNumber:UpdateThemeAlias' :: Natural
themeVersionNumber = Natural
a} :: UpdateThemeAlias)
instance Core.AWSRequest UpdateThemeAlias where
type
AWSResponse UpdateThemeAlias =
UpdateThemeAliasResponse
request :: UpdateThemeAlias -> Request UpdateThemeAlias
request = Service -> UpdateThemeAlias -> Request UpdateThemeAlias
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateThemeAlias
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateThemeAlias)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateThemeAlias))
-> Logger
-> Service
-> Proxy UpdateThemeAlias
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateThemeAlias)))
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 -> UpdateThemeAliasResponse
UpdateThemeAliasResponse'
(Maybe Text -> Maybe ThemeAlias -> Int -> UpdateThemeAliasResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe ThemeAlias -> Int -> UpdateThemeAliasResponse)
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 -> UpdateThemeAliasResponse)
-> Either String (Maybe ThemeAlias)
-> Either String (Int -> UpdateThemeAliasResponse)
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 -> UpdateThemeAliasResponse)
-> Either String Int -> Either String UpdateThemeAliasResponse
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 UpdateThemeAlias
instance Prelude.NFData UpdateThemeAlias
instance Core.ToHeaders UpdateThemeAlias where
toHeaders :: UpdateThemeAlias -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateThemeAlias -> 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 UpdateThemeAlias where
toJSON :: UpdateThemeAlias -> Value
toJSON UpdateThemeAlias' {Natural
Text
themeVersionNumber :: Natural
aliasName :: Text
themeId :: Text
awsAccountId :: Text
$sel:themeVersionNumber:UpdateThemeAlias' :: UpdateThemeAlias -> Natural
$sel:aliasName:UpdateThemeAlias' :: UpdateThemeAlias -> Text
$sel:themeId:UpdateThemeAlias' :: UpdateThemeAlias -> Text
$sel:awsAccountId:UpdateThemeAlias' :: UpdateThemeAlias -> 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 UpdateThemeAlias where
toPath :: UpdateThemeAlias -> ByteString
toPath UpdateThemeAlias' {Natural
Text
themeVersionNumber :: Natural
aliasName :: Text
themeId :: Text
awsAccountId :: Text
$sel:themeVersionNumber:UpdateThemeAlias' :: UpdateThemeAlias -> Natural
$sel:aliasName:UpdateThemeAlias' :: UpdateThemeAlias -> Text
$sel:themeId:UpdateThemeAlias' :: UpdateThemeAlias -> Text
$sel:awsAccountId:UpdateThemeAlias' :: UpdateThemeAlias -> 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 UpdateThemeAlias where
toQuery :: UpdateThemeAlias -> QueryString
toQuery = QueryString -> UpdateThemeAlias -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateThemeAliasResponse = UpdateThemeAliasResponse'
{
UpdateThemeAliasResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
UpdateThemeAliasResponse -> Maybe ThemeAlias
themeAlias :: Prelude.Maybe ThemeAlias,
UpdateThemeAliasResponse -> Int
status :: Prelude.Int
}
deriving (UpdateThemeAliasResponse -> UpdateThemeAliasResponse -> Bool
(UpdateThemeAliasResponse -> UpdateThemeAliasResponse -> Bool)
-> (UpdateThemeAliasResponse -> UpdateThemeAliasResponse -> Bool)
-> Eq UpdateThemeAliasResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateThemeAliasResponse -> UpdateThemeAliasResponse -> Bool
$c/= :: UpdateThemeAliasResponse -> UpdateThemeAliasResponse -> Bool
== :: UpdateThemeAliasResponse -> UpdateThemeAliasResponse -> Bool
$c== :: UpdateThemeAliasResponse -> UpdateThemeAliasResponse -> Bool
Prelude.Eq, ReadPrec [UpdateThemeAliasResponse]
ReadPrec UpdateThemeAliasResponse
Int -> ReadS UpdateThemeAliasResponse
ReadS [UpdateThemeAliasResponse]
(Int -> ReadS UpdateThemeAliasResponse)
-> ReadS [UpdateThemeAliasResponse]
-> ReadPrec UpdateThemeAliasResponse
-> ReadPrec [UpdateThemeAliasResponse]
-> Read UpdateThemeAliasResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateThemeAliasResponse]
$creadListPrec :: ReadPrec [UpdateThemeAliasResponse]
readPrec :: ReadPrec UpdateThemeAliasResponse
$creadPrec :: ReadPrec UpdateThemeAliasResponse
readList :: ReadS [UpdateThemeAliasResponse]
$creadList :: ReadS [UpdateThemeAliasResponse]
readsPrec :: Int -> ReadS UpdateThemeAliasResponse
$creadsPrec :: Int -> ReadS UpdateThemeAliasResponse
Prelude.Read, Int -> UpdateThemeAliasResponse -> ShowS
[UpdateThemeAliasResponse] -> ShowS
UpdateThemeAliasResponse -> String
(Int -> UpdateThemeAliasResponse -> ShowS)
-> (UpdateThemeAliasResponse -> String)
-> ([UpdateThemeAliasResponse] -> ShowS)
-> Show UpdateThemeAliasResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateThemeAliasResponse] -> ShowS
$cshowList :: [UpdateThemeAliasResponse] -> ShowS
show :: UpdateThemeAliasResponse -> String
$cshow :: UpdateThemeAliasResponse -> String
showsPrec :: Int -> UpdateThemeAliasResponse -> ShowS
$cshowsPrec :: Int -> UpdateThemeAliasResponse -> ShowS
Prelude.Show, (forall x.
UpdateThemeAliasResponse -> Rep UpdateThemeAliasResponse x)
-> (forall x.
Rep UpdateThemeAliasResponse x -> UpdateThemeAliasResponse)
-> Generic UpdateThemeAliasResponse
forall x.
Rep UpdateThemeAliasResponse x -> UpdateThemeAliasResponse
forall x.
UpdateThemeAliasResponse -> Rep UpdateThemeAliasResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateThemeAliasResponse x -> UpdateThemeAliasResponse
$cfrom :: forall x.
UpdateThemeAliasResponse -> Rep UpdateThemeAliasResponse x
Prelude.Generic)
newUpdateThemeAliasResponse ::
Prelude.Int ->
UpdateThemeAliasResponse
newUpdateThemeAliasResponse :: Int -> UpdateThemeAliasResponse
newUpdateThemeAliasResponse Int
pStatus_ =
UpdateThemeAliasResponse' :: Maybe Text -> Maybe ThemeAlias -> Int -> UpdateThemeAliasResponse
UpdateThemeAliasResponse'
{ $sel:requestId:UpdateThemeAliasResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:themeAlias:UpdateThemeAliasResponse' :: Maybe ThemeAlias
themeAlias = Maybe ThemeAlias
forall a. Maybe a
Prelude.Nothing,
$sel:status:UpdateThemeAliasResponse' :: Int
status = Int
pStatus_
}
updateThemeAliasResponse_requestId :: Lens.Lens' UpdateThemeAliasResponse (Prelude.Maybe Prelude.Text)
updateThemeAliasResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> UpdateThemeAliasResponse -> f UpdateThemeAliasResponse
updateThemeAliasResponse_requestId = (UpdateThemeAliasResponse -> Maybe Text)
-> (UpdateThemeAliasResponse
-> Maybe Text -> UpdateThemeAliasResponse)
-> Lens
UpdateThemeAliasResponse
UpdateThemeAliasResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThemeAliasResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:UpdateThemeAliasResponse' :: UpdateThemeAliasResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: UpdateThemeAliasResponse
s@UpdateThemeAliasResponse' {} Maybe Text
a -> UpdateThemeAliasResponse
s {$sel:requestId:UpdateThemeAliasResponse' :: Maybe Text
requestId = Maybe Text
a} :: UpdateThemeAliasResponse)
updateThemeAliasResponse_themeAlias :: Lens.Lens' UpdateThemeAliasResponse (Prelude.Maybe ThemeAlias)
updateThemeAliasResponse_themeAlias :: (Maybe ThemeAlias -> f (Maybe ThemeAlias))
-> UpdateThemeAliasResponse -> f UpdateThemeAliasResponse
updateThemeAliasResponse_themeAlias = (UpdateThemeAliasResponse -> Maybe ThemeAlias)
-> (UpdateThemeAliasResponse
-> Maybe ThemeAlias -> UpdateThemeAliasResponse)
-> Lens
UpdateThemeAliasResponse
UpdateThemeAliasResponse
(Maybe ThemeAlias)
(Maybe ThemeAlias)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThemeAliasResponse' {Maybe ThemeAlias
themeAlias :: Maybe ThemeAlias
$sel:themeAlias:UpdateThemeAliasResponse' :: UpdateThemeAliasResponse -> Maybe ThemeAlias
themeAlias} -> Maybe ThemeAlias
themeAlias) (\s :: UpdateThemeAliasResponse
s@UpdateThemeAliasResponse' {} Maybe ThemeAlias
a -> UpdateThemeAliasResponse
s {$sel:themeAlias:UpdateThemeAliasResponse' :: Maybe ThemeAlias
themeAlias = Maybe ThemeAlias
a} :: UpdateThemeAliasResponse)
updateThemeAliasResponse_status :: Lens.Lens' UpdateThemeAliasResponse Prelude.Int
updateThemeAliasResponse_status :: (Int -> f Int)
-> UpdateThemeAliasResponse -> f UpdateThemeAliasResponse
updateThemeAliasResponse_status = (UpdateThemeAliasResponse -> Int)
-> (UpdateThemeAliasResponse -> Int -> UpdateThemeAliasResponse)
-> Lens UpdateThemeAliasResponse UpdateThemeAliasResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThemeAliasResponse' {Int
status :: Int
$sel:status:UpdateThemeAliasResponse' :: UpdateThemeAliasResponse -> Int
status} -> Int
status) (\s :: UpdateThemeAliasResponse
s@UpdateThemeAliasResponse' {} Int
a -> UpdateThemeAliasResponse
s {$sel:status:UpdateThemeAliasResponse' :: Int
status = Int
a} :: UpdateThemeAliasResponse)
instance Prelude.NFData UpdateThemeAliasResponse