{-# 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.DeleteTemplate
(
DeleteTemplate (..),
newDeleteTemplate,
deleteTemplate_versionNumber,
deleteTemplate_awsAccountId,
deleteTemplate_templateId,
DeleteTemplateResponse (..),
newDeleteTemplateResponse,
deleteTemplateResponse_requestId,
deleteTemplateResponse_arn,
deleteTemplateResponse_templateId,
deleteTemplateResponse_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 DeleteTemplate = DeleteTemplate'
{
DeleteTemplate -> Maybe Natural
versionNumber :: Prelude.Maybe Prelude.Natural,
DeleteTemplate -> Text
awsAccountId :: Prelude.Text,
DeleteTemplate -> Text
templateId :: Prelude.Text
}
deriving (DeleteTemplate -> DeleteTemplate -> Bool
(DeleteTemplate -> DeleteTemplate -> Bool)
-> (DeleteTemplate -> DeleteTemplate -> Bool) -> Eq DeleteTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTemplate -> DeleteTemplate -> Bool
$c/= :: DeleteTemplate -> DeleteTemplate -> Bool
== :: DeleteTemplate -> DeleteTemplate -> Bool
$c== :: DeleteTemplate -> DeleteTemplate -> Bool
Prelude.Eq, ReadPrec [DeleteTemplate]
ReadPrec DeleteTemplate
Int -> ReadS DeleteTemplate
ReadS [DeleteTemplate]
(Int -> ReadS DeleteTemplate)
-> ReadS [DeleteTemplate]
-> ReadPrec DeleteTemplate
-> ReadPrec [DeleteTemplate]
-> Read DeleteTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTemplate]
$creadListPrec :: ReadPrec [DeleteTemplate]
readPrec :: ReadPrec DeleteTemplate
$creadPrec :: ReadPrec DeleteTemplate
readList :: ReadS [DeleteTemplate]
$creadList :: ReadS [DeleteTemplate]
readsPrec :: Int -> ReadS DeleteTemplate
$creadsPrec :: Int -> ReadS DeleteTemplate
Prelude.Read, Int -> DeleteTemplate -> ShowS
[DeleteTemplate] -> ShowS
DeleteTemplate -> String
(Int -> DeleteTemplate -> ShowS)
-> (DeleteTemplate -> String)
-> ([DeleteTemplate] -> ShowS)
-> Show DeleteTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTemplate] -> ShowS
$cshowList :: [DeleteTemplate] -> ShowS
show :: DeleteTemplate -> String
$cshow :: DeleteTemplate -> String
showsPrec :: Int -> DeleteTemplate -> ShowS
$cshowsPrec :: Int -> DeleteTemplate -> ShowS
Prelude.Show, (forall x. DeleteTemplate -> Rep DeleteTemplate x)
-> (forall x. Rep DeleteTemplate x -> DeleteTemplate)
-> Generic DeleteTemplate
forall x. Rep DeleteTemplate x -> DeleteTemplate
forall x. DeleteTemplate -> Rep DeleteTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTemplate x -> DeleteTemplate
$cfrom :: forall x. DeleteTemplate -> Rep DeleteTemplate x
Prelude.Generic)
newDeleteTemplate ::
Prelude.Text ->
Prelude.Text ->
DeleteTemplate
newDeleteTemplate :: Text -> Text -> DeleteTemplate
newDeleteTemplate Text
pAwsAccountId_ Text
pTemplateId_ =
DeleteTemplate' :: Maybe Natural -> Text -> Text -> DeleteTemplate
DeleteTemplate'
{ $sel:versionNumber:DeleteTemplate' :: Maybe Natural
versionNumber = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:awsAccountId:DeleteTemplate' :: Text
awsAccountId = Text
pAwsAccountId_,
$sel:templateId:DeleteTemplate' :: Text
templateId = Text
pTemplateId_
}
deleteTemplate_versionNumber :: Lens.Lens' DeleteTemplate (Prelude.Maybe Prelude.Natural)
deleteTemplate_versionNumber :: (Maybe Natural -> f (Maybe Natural))
-> DeleteTemplate -> f DeleteTemplate
deleteTemplate_versionNumber = (DeleteTemplate -> Maybe Natural)
-> (DeleteTemplate -> Maybe Natural -> DeleteTemplate)
-> Lens
DeleteTemplate DeleteTemplate (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTemplate' {Maybe Natural
versionNumber :: Maybe Natural
$sel:versionNumber:DeleteTemplate' :: DeleteTemplate -> Maybe Natural
versionNumber} -> Maybe Natural
versionNumber) (\s :: DeleteTemplate
s@DeleteTemplate' {} Maybe Natural
a -> DeleteTemplate
s {$sel:versionNumber:DeleteTemplate' :: Maybe Natural
versionNumber = Maybe Natural
a} :: DeleteTemplate)
deleteTemplate_awsAccountId :: Lens.Lens' DeleteTemplate Prelude.Text
deleteTemplate_awsAccountId :: (Text -> f Text) -> DeleteTemplate -> f DeleteTemplate
deleteTemplate_awsAccountId = (DeleteTemplate -> Text)
-> (DeleteTemplate -> Text -> DeleteTemplate)
-> Lens DeleteTemplate DeleteTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTemplate' {Text
awsAccountId :: Text
$sel:awsAccountId:DeleteTemplate' :: DeleteTemplate -> Text
awsAccountId} -> Text
awsAccountId) (\s :: DeleteTemplate
s@DeleteTemplate' {} Text
a -> DeleteTemplate
s {$sel:awsAccountId:DeleteTemplate' :: Text
awsAccountId = Text
a} :: DeleteTemplate)
deleteTemplate_templateId :: Lens.Lens' DeleteTemplate Prelude.Text
deleteTemplate_templateId :: (Text -> f Text) -> DeleteTemplate -> f DeleteTemplate
deleteTemplate_templateId = (DeleteTemplate -> Text)
-> (DeleteTemplate -> Text -> DeleteTemplate)
-> Lens DeleteTemplate DeleteTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTemplate' {Text
templateId :: Text
$sel:templateId:DeleteTemplate' :: DeleteTemplate -> Text
templateId} -> Text
templateId) (\s :: DeleteTemplate
s@DeleteTemplate' {} Text
a -> DeleteTemplate
s {$sel:templateId:DeleteTemplate' :: Text
templateId = Text
a} :: DeleteTemplate)
instance Core.AWSRequest DeleteTemplate where
type
AWSResponse DeleteTemplate =
DeleteTemplateResponse
request :: DeleteTemplate -> Request DeleteTemplate
request = Service -> DeleteTemplate -> Request DeleteTemplate
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteTemplate
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteTemplate)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteTemplate))
-> Logger
-> Service
-> Proxy DeleteTemplate
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteTemplate)))
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 Text -> Maybe Text -> Int -> DeleteTemplateResponse
DeleteTemplateResponse'
(Maybe Text
-> Maybe Text -> Maybe Text -> Int -> DeleteTemplateResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Maybe Text -> Int -> DeleteTemplateResponse)
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 Text -> Maybe Text -> Int -> DeleteTemplateResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> DeleteTemplateResponse)
forall (f :: * -> *) a b. Applicative f => 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
"Arn")
Either String (Maybe Text -> Int -> DeleteTemplateResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteTemplateResponse)
forall (f :: * -> *) a b. Applicative f => 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
"TemplateId")
Either String (Int -> DeleteTemplateResponse)
-> Either String Int -> Either String DeleteTemplateResponse
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 DeleteTemplate
instance Prelude.NFData DeleteTemplate
instance Core.ToHeaders DeleteTemplate where
toHeaders :: DeleteTemplate -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteTemplate -> 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 DeleteTemplate where
toPath :: DeleteTemplate -> ByteString
toPath DeleteTemplate' {Maybe Natural
Text
templateId :: Text
awsAccountId :: Text
versionNumber :: Maybe Natural
$sel:templateId:DeleteTemplate' :: DeleteTemplate -> Text
$sel:awsAccountId:DeleteTemplate' :: DeleteTemplate -> Text
$sel:versionNumber:DeleteTemplate' :: DeleteTemplate -> Maybe Natural
..} =
[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
]
instance Core.ToQuery DeleteTemplate where
toQuery :: DeleteTemplate -> QueryString
toQuery DeleteTemplate' {Maybe Natural
Text
templateId :: Text
awsAccountId :: Text
versionNumber :: Maybe Natural
$sel:templateId:DeleteTemplate' :: DeleteTemplate -> Text
$sel:awsAccountId:DeleteTemplate' :: DeleteTemplate -> Text
$sel:versionNumber:DeleteTemplate' :: DeleteTemplate -> Maybe Natural
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"version-number" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
versionNumber]
data DeleteTemplateResponse = DeleteTemplateResponse'
{
DeleteTemplateResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
DeleteTemplateResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
DeleteTemplateResponse -> Maybe Text
templateId :: Prelude.Maybe Prelude.Text,
DeleteTemplateResponse -> Int
status :: Prelude.Int
}
deriving (DeleteTemplateResponse -> DeleteTemplateResponse -> Bool
(DeleteTemplateResponse -> DeleteTemplateResponse -> Bool)
-> (DeleteTemplateResponse -> DeleteTemplateResponse -> Bool)
-> Eq DeleteTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTemplateResponse -> DeleteTemplateResponse -> Bool
$c/= :: DeleteTemplateResponse -> DeleteTemplateResponse -> Bool
== :: DeleteTemplateResponse -> DeleteTemplateResponse -> Bool
$c== :: DeleteTemplateResponse -> DeleteTemplateResponse -> Bool
Prelude.Eq, ReadPrec [DeleteTemplateResponse]
ReadPrec DeleteTemplateResponse
Int -> ReadS DeleteTemplateResponse
ReadS [DeleteTemplateResponse]
(Int -> ReadS DeleteTemplateResponse)
-> ReadS [DeleteTemplateResponse]
-> ReadPrec DeleteTemplateResponse
-> ReadPrec [DeleteTemplateResponse]
-> Read DeleteTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTemplateResponse]
$creadListPrec :: ReadPrec [DeleteTemplateResponse]
readPrec :: ReadPrec DeleteTemplateResponse
$creadPrec :: ReadPrec DeleteTemplateResponse
readList :: ReadS [DeleteTemplateResponse]
$creadList :: ReadS [DeleteTemplateResponse]
readsPrec :: Int -> ReadS DeleteTemplateResponse
$creadsPrec :: Int -> ReadS DeleteTemplateResponse
Prelude.Read, Int -> DeleteTemplateResponse -> ShowS
[DeleteTemplateResponse] -> ShowS
DeleteTemplateResponse -> String
(Int -> DeleteTemplateResponse -> ShowS)
-> (DeleteTemplateResponse -> String)
-> ([DeleteTemplateResponse] -> ShowS)
-> Show DeleteTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTemplateResponse] -> ShowS
$cshowList :: [DeleteTemplateResponse] -> ShowS
show :: DeleteTemplateResponse -> String
$cshow :: DeleteTemplateResponse -> String
showsPrec :: Int -> DeleteTemplateResponse -> ShowS
$cshowsPrec :: Int -> DeleteTemplateResponse -> ShowS
Prelude.Show, (forall x. DeleteTemplateResponse -> Rep DeleteTemplateResponse x)
-> (forall x.
Rep DeleteTemplateResponse x -> DeleteTemplateResponse)
-> Generic DeleteTemplateResponse
forall x. Rep DeleteTemplateResponse x -> DeleteTemplateResponse
forall x. DeleteTemplateResponse -> Rep DeleteTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTemplateResponse x -> DeleteTemplateResponse
$cfrom :: forall x. DeleteTemplateResponse -> Rep DeleteTemplateResponse x
Prelude.Generic)
newDeleteTemplateResponse ::
Prelude.Int ->
DeleteTemplateResponse
newDeleteTemplateResponse :: Int -> DeleteTemplateResponse
newDeleteTemplateResponse Int
pStatus_ =
DeleteTemplateResponse' :: Maybe Text
-> Maybe Text -> Maybe Text -> Int -> DeleteTemplateResponse
DeleteTemplateResponse'
{ $sel:requestId:DeleteTemplateResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:DeleteTemplateResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:templateId:DeleteTemplateResponse' :: Maybe Text
templateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:DeleteTemplateResponse' :: Int
status = Int
pStatus_
}
deleteTemplateResponse_requestId :: Lens.Lens' DeleteTemplateResponse (Prelude.Maybe Prelude.Text)
deleteTemplateResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> DeleteTemplateResponse -> f DeleteTemplateResponse
deleteTemplateResponse_requestId = (DeleteTemplateResponse -> Maybe Text)
-> (DeleteTemplateResponse -> Maybe Text -> DeleteTemplateResponse)
-> Lens
DeleteTemplateResponse
DeleteTemplateResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTemplateResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:DeleteTemplateResponse' :: DeleteTemplateResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: DeleteTemplateResponse
s@DeleteTemplateResponse' {} Maybe Text
a -> DeleteTemplateResponse
s {$sel:requestId:DeleteTemplateResponse' :: Maybe Text
requestId = Maybe Text
a} :: DeleteTemplateResponse)
deleteTemplateResponse_arn :: Lens.Lens' DeleteTemplateResponse (Prelude.Maybe Prelude.Text)
deleteTemplateResponse_arn :: (Maybe Text -> f (Maybe Text))
-> DeleteTemplateResponse -> f DeleteTemplateResponse
deleteTemplateResponse_arn = (DeleteTemplateResponse -> Maybe Text)
-> (DeleteTemplateResponse -> Maybe Text -> DeleteTemplateResponse)
-> Lens
DeleteTemplateResponse
DeleteTemplateResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTemplateResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:DeleteTemplateResponse' :: DeleteTemplateResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: DeleteTemplateResponse
s@DeleteTemplateResponse' {} Maybe Text
a -> DeleteTemplateResponse
s {$sel:arn:DeleteTemplateResponse' :: Maybe Text
arn = Maybe Text
a} :: DeleteTemplateResponse)
deleteTemplateResponse_templateId :: Lens.Lens' DeleteTemplateResponse (Prelude.Maybe Prelude.Text)
deleteTemplateResponse_templateId :: (Maybe Text -> f (Maybe Text))
-> DeleteTemplateResponse -> f DeleteTemplateResponse
deleteTemplateResponse_templateId = (DeleteTemplateResponse -> Maybe Text)
-> (DeleteTemplateResponse -> Maybe Text -> DeleteTemplateResponse)
-> Lens
DeleteTemplateResponse
DeleteTemplateResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTemplateResponse' {Maybe Text
templateId :: Maybe Text
$sel:templateId:DeleteTemplateResponse' :: DeleteTemplateResponse -> Maybe Text
templateId} -> Maybe Text
templateId) (\s :: DeleteTemplateResponse
s@DeleteTemplateResponse' {} Maybe Text
a -> DeleteTemplateResponse
s {$sel:templateId:DeleteTemplateResponse' :: Maybe Text
templateId = Maybe Text
a} :: DeleteTemplateResponse)
deleteTemplateResponse_status :: Lens.Lens' DeleteTemplateResponse Prelude.Int
deleteTemplateResponse_status :: (Int -> f Int)
-> DeleteTemplateResponse -> f DeleteTemplateResponse
deleteTemplateResponse_status = (DeleteTemplateResponse -> Int)
-> (DeleteTemplateResponse -> Int -> DeleteTemplateResponse)
-> Lens DeleteTemplateResponse DeleteTemplateResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTemplateResponse' {Int
status :: Int
$sel:status:DeleteTemplateResponse' :: DeleteTemplateResponse -> Int
status} -> Int
status) (\s :: DeleteTemplateResponse
s@DeleteTemplateResponse' {} Int
a -> DeleteTemplateResponse
s {$sel:status:DeleteTemplateResponse' :: Int
status = Int
a} :: DeleteTemplateResponse)
instance Prelude.NFData DeleteTemplateResponse