{-# 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.FIS.DeleteExperimentTemplate
(
DeleteExperimentTemplate (..),
newDeleteExperimentTemplate,
deleteExperimentTemplate_id,
DeleteExperimentTemplateResponse (..),
newDeleteExperimentTemplateResponse,
deleteExperimentTemplateResponse_experimentTemplate,
deleteExperimentTemplateResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.FIS.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteExperimentTemplate = DeleteExperimentTemplate'
{
DeleteExperimentTemplate -> Text
id :: Prelude.Text
}
deriving (DeleteExperimentTemplate -> DeleteExperimentTemplate -> Bool
(DeleteExperimentTemplate -> DeleteExperimentTemplate -> Bool)
-> (DeleteExperimentTemplate -> DeleteExperimentTemplate -> Bool)
-> Eq DeleteExperimentTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteExperimentTemplate -> DeleteExperimentTemplate -> Bool
$c/= :: DeleteExperimentTemplate -> DeleteExperimentTemplate -> Bool
== :: DeleteExperimentTemplate -> DeleteExperimentTemplate -> Bool
$c== :: DeleteExperimentTemplate -> DeleteExperimentTemplate -> Bool
Prelude.Eq, ReadPrec [DeleteExperimentTemplate]
ReadPrec DeleteExperimentTemplate
Int -> ReadS DeleteExperimentTemplate
ReadS [DeleteExperimentTemplate]
(Int -> ReadS DeleteExperimentTemplate)
-> ReadS [DeleteExperimentTemplate]
-> ReadPrec DeleteExperimentTemplate
-> ReadPrec [DeleteExperimentTemplate]
-> Read DeleteExperimentTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteExperimentTemplate]
$creadListPrec :: ReadPrec [DeleteExperimentTemplate]
readPrec :: ReadPrec DeleteExperimentTemplate
$creadPrec :: ReadPrec DeleteExperimentTemplate
readList :: ReadS [DeleteExperimentTemplate]
$creadList :: ReadS [DeleteExperimentTemplate]
readsPrec :: Int -> ReadS DeleteExperimentTemplate
$creadsPrec :: Int -> ReadS DeleteExperimentTemplate
Prelude.Read, Int -> DeleteExperimentTemplate -> ShowS
[DeleteExperimentTemplate] -> ShowS
DeleteExperimentTemplate -> String
(Int -> DeleteExperimentTemplate -> ShowS)
-> (DeleteExperimentTemplate -> String)
-> ([DeleteExperimentTemplate] -> ShowS)
-> Show DeleteExperimentTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteExperimentTemplate] -> ShowS
$cshowList :: [DeleteExperimentTemplate] -> ShowS
show :: DeleteExperimentTemplate -> String
$cshow :: DeleteExperimentTemplate -> String
showsPrec :: Int -> DeleteExperimentTemplate -> ShowS
$cshowsPrec :: Int -> DeleteExperimentTemplate -> ShowS
Prelude.Show, (forall x.
DeleteExperimentTemplate -> Rep DeleteExperimentTemplate x)
-> (forall x.
Rep DeleteExperimentTemplate x -> DeleteExperimentTemplate)
-> Generic DeleteExperimentTemplate
forall x.
Rep DeleteExperimentTemplate x -> DeleteExperimentTemplate
forall x.
DeleteExperimentTemplate -> Rep DeleteExperimentTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteExperimentTemplate x -> DeleteExperimentTemplate
$cfrom :: forall x.
DeleteExperimentTemplate -> Rep DeleteExperimentTemplate x
Prelude.Generic)
newDeleteExperimentTemplate ::
Prelude.Text ->
DeleteExperimentTemplate
newDeleteExperimentTemplate :: Text -> DeleteExperimentTemplate
newDeleteExperimentTemplate Text
pId_ =
DeleteExperimentTemplate' :: Text -> DeleteExperimentTemplate
DeleteExperimentTemplate' {$sel:id:DeleteExperimentTemplate' :: Text
id = Text
pId_}
deleteExperimentTemplate_id :: Lens.Lens' DeleteExperimentTemplate Prelude.Text
deleteExperimentTemplate_id :: (Text -> f Text)
-> DeleteExperimentTemplate -> f DeleteExperimentTemplate
deleteExperimentTemplate_id = (DeleteExperimentTemplate -> Text)
-> (DeleteExperimentTemplate -> Text -> DeleteExperimentTemplate)
-> Lens DeleteExperimentTemplate DeleteExperimentTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteExperimentTemplate' {Text
id :: Text
$sel:id:DeleteExperimentTemplate' :: DeleteExperimentTemplate -> Text
id} -> Text
id) (\s :: DeleteExperimentTemplate
s@DeleteExperimentTemplate' {} Text
a -> DeleteExperimentTemplate
s {$sel:id:DeleteExperimentTemplate' :: Text
id = Text
a} :: DeleteExperimentTemplate)
instance Core.AWSRequest DeleteExperimentTemplate where
type
AWSResponse DeleteExperimentTemplate =
DeleteExperimentTemplateResponse
request :: DeleteExperimentTemplate -> Request DeleteExperimentTemplate
request = Service
-> DeleteExperimentTemplate -> Request DeleteExperimentTemplate
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteExperimentTemplate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteExperimentTemplate)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteExperimentTemplate))
-> Logger
-> Service
-> Proxy DeleteExperimentTemplate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteExperimentTemplate)))
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 ExperimentTemplate -> Int -> DeleteExperimentTemplateResponse
DeleteExperimentTemplateResponse'
(Maybe ExperimentTemplate
-> Int -> DeleteExperimentTemplateResponse)
-> Either String (Maybe ExperimentTemplate)
-> Either String (Int -> DeleteExperimentTemplateResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ExperimentTemplate)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"experimentTemplate")
Either String (Int -> DeleteExperimentTemplateResponse)
-> Either String Int
-> Either String DeleteExperimentTemplateResponse
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 DeleteExperimentTemplate
instance Prelude.NFData DeleteExperimentTemplate
instance Core.ToHeaders DeleteExperimentTemplate where
toHeaders :: DeleteExperimentTemplate -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteExperimentTemplate -> 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.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath DeleteExperimentTemplate where
toPath :: DeleteExperimentTemplate -> ByteString
toPath DeleteExperimentTemplate' {Text
id :: Text
$sel:id:DeleteExperimentTemplate' :: DeleteExperimentTemplate -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/experimentTemplates/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id]
instance Core.ToQuery DeleteExperimentTemplate where
toQuery :: DeleteExperimentTemplate -> QueryString
toQuery = QueryString -> DeleteExperimentTemplate -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteExperimentTemplateResponse = DeleteExperimentTemplateResponse'
{
DeleteExperimentTemplateResponse -> Maybe ExperimentTemplate
experimentTemplate :: Prelude.Maybe ExperimentTemplate,
DeleteExperimentTemplateResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteExperimentTemplateResponse
-> DeleteExperimentTemplateResponse -> Bool
(DeleteExperimentTemplateResponse
-> DeleteExperimentTemplateResponse -> Bool)
-> (DeleteExperimentTemplateResponse
-> DeleteExperimentTemplateResponse -> Bool)
-> Eq DeleteExperimentTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteExperimentTemplateResponse
-> DeleteExperimentTemplateResponse -> Bool
$c/= :: DeleteExperimentTemplateResponse
-> DeleteExperimentTemplateResponse -> Bool
== :: DeleteExperimentTemplateResponse
-> DeleteExperimentTemplateResponse -> Bool
$c== :: DeleteExperimentTemplateResponse
-> DeleteExperimentTemplateResponse -> Bool
Prelude.Eq, ReadPrec [DeleteExperimentTemplateResponse]
ReadPrec DeleteExperimentTemplateResponse
Int -> ReadS DeleteExperimentTemplateResponse
ReadS [DeleteExperimentTemplateResponse]
(Int -> ReadS DeleteExperimentTemplateResponse)
-> ReadS [DeleteExperimentTemplateResponse]
-> ReadPrec DeleteExperimentTemplateResponse
-> ReadPrec [DeleteExperimentTemplateResponse]
-> Read DeleteExperimentTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteExperimentTemplateResponse]
$creadListPrec :: ReadPrec [DeleteExperimentTemplateResponse]
readPrec :: ReadPrec DeleteExperimentTemplateResponse
$creadPrec :: ReadPrec DeleteExperimentTemplateResponse
readList :: ReadS [DeleteExperimentTemplateResponse]
$creadList :: ReadS [DeleteExperimentTemplateResponse]
readsPrec :: Int -> ReadS DeleteExperimentTemplateResponse
$creadsPrec :: Int -> ReadS DeleteExperimentTemplateResponse
Prelude.Read, Int -> DeleteExperimentTemplateResponse -> ShowS
[DeleteExperimentTemplateResponse] -> ShowS
DeleteExperimentTemplateResponse -> String
(Int -> DeleteExperimentTemplateResponse -> ShowS)
-> (DeleteExperimentTemplateResponse -> String)
-> ([DeleteExperimentTemplateResponse] -> ShowS)
-> Show DeleteExperimentTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteExperimentTemplateResponse] -> ShowS
$cshowList :: [DeleteExperimentTemplateResponse] -> ShowS
show :: DeleteExperimentTemplateResponse -> String
$cshow :: DeleteExperimentTemplateResponse -> String
showsPrec :: Int -> DeleteExperimentTemplateResponse -> ShowS
$cshowsPrec :: Int -> DeleteExperimentTemplateResponse -> ShowS
Prelude.Show, (forall x.
DeleteExperimentTemplateResponse
-> Rep DeleteExperimentTemplateResponse x)
-> (forall x.
Rep DeleteExperimentTemplateResponse x
-> DeleteExperimentTemplateResponse)
-> Generic DeleteExperimentTemplateResponse
forall x.
Rep DeleteExperimentTemplateResponse x
-> DeleteExperimentTemplateResponse
forall x.
DeleteExperimentTemplateResponse
-> Rep DeleteExperimentTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteExperimentTemplateResponse x
-> DeleteExperimentTemplateResponse
$cfrom :: forall x.
DeleteExperimentTemplateResponse
-> Rep DeleteExperimentTemplateResponse x
Prelude.Generic)
newDeleteExperimentTemplateResponse ::
Prelude.Int ->
DeleteExperimentTemplateResponse
newDeleteExperimentTemplateResponse :: Int -> DeleteExperimentTemplateResponse
newDeleteExperimentTemplateResponse Int
pHttpStatus_ =
DeleteExperimentTemplateResponse' :: Maybe ExperimentTemplate -> Int -> DeleteExperimentTemplateResponse
DeleteExperimentTemplateResponse'
{ $sel:experimentTemplate:DeleteExperimentTemplateResponse' :: Maybe ExperimentTemplate
experimentTemplate =
Maybe ExperimentTemplate
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteExperimentTemplateResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteExperimentTemplateResponse_experimentTemplate :: Lens.Lens' DeleteExperimentTemplateResponse (Prelude.Maybe ExperimentTemplate)
deleteExperimentTemplateResponse_experimentTemplate :: (Maybe ExperimentTemplate -> f (Maybe ExperimentTemplate))
-> DeleteExperimentTemplateResponse
-> f DeleteExperimentTemplateResponse
deleteExperimentTemplateResponse_experimentTemplate = (DeleteExperimentTemplateResponse -> Maybe ExperimentTemplate)
-> (DeleteExperimentTemplateResponse
-> Maybe ExperimentTemplate -> DeleteExperimentTemplateResponse)
-> Lens
DeleteExperimentTemplateResponse
DeleteExperimentTemplateResponse
(Maybe ExperimentTemplate)
(Maybe ExperimentTemplate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteExperimentTemplateResponse' {Maybe ExperimentTemplate
experimentTemplate :: Maybe ExperimentTemplate
$sel:experimentTemplate:DeleteExperimentTemplateResponse' :: DeleteExperimentTemplateResponse -> Maybe ExperimentTemplate
experimentTemplate} -> Maybe ExperimentTemplate
experimentTemplate) (\s :: DeleteExperimentTemplateResponse
s@DeleteExperimentTemplateResponse' {} Maybe ExperimentTemplate
a -> DeleteExperimentTemplateResponse
s {$sel:experimentTemplate:DeleteExperimentTemplateResponse' :: Maybe ExperimentTemplate
experimentTemplate = Maybe ExperimentTemplate
a} :: DeleteExperimentTemplateResponse)
deleteExperimentTemplateResponse_httpStatus :: Lens.Lens' DeleteExperimentTemplateResponse Prelude.Int
deleteExperimentTemplateResponse_httpStatus :: (Int -> f Int)
-> DeleteExperimentTemplateResponse
-> f DeleteExperimentTemplateResponse
deleteExperimentTemplateResponse_httpStatus = (DeleteExperimentTemplateResponse -> Int)
-> (DeleteExperimentTemplateResponse
-> Int -> DeleteExperimentTemplateResponse)
-> Lens
DeleteExperimentTemplateResponse
DeleteExperimentTemplateResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteExperimentTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteExperimentTemplateResponse' :: DeleteExperimentTemplateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteExperimentTemplateResponse
s@DeleteExperimentTemplateResponse' {} Int
a -> DeleteExperimentTemplateResponse
s {$sel:httpStatus:DeleteExperimentTemplateResponse' :: Int
httpStatus = Int
a} :: DeleteExperimentTemplateResponse)
instance
Prelude.NFData
DeleteExperimentTemplateResponse