{-# 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.RobOMaker.DeleteWorldTemplate
(
DeleteWorldTemplate (..),
newDeleteWorldTemplate,
deleteWorldTemplate_template,
DeleteWorldTemplateResponse (..),
newDeleteWorldTemplateResponse,
deleteWorldTemplateResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.RobOMaker.Types
data DeleteWorldTemplate = DeleteWorldTemplate'
{
DeleteWorldTemplate -> Text
template :: Prelude.Text
}
deriving (DeleteWorldTemplate -> DeleteWorldTemplate -> Bool
(DeleteWorldTemplate -> DeleteWorldTemplate -> Bool)
-> (DeleteWorldTemplate -> DeleteWorldTemplate -> Bool)
-> Eq DeleteWorldTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteWorldTemplate -> DeleteWorldTemplate -> Bool
$c/= :: DeleteWorldTemplate -> DeleteWorldTemplate -> Bool
== :: DeleteWorldTemplate -> DeleteWorldTemplate -> Bool
$c== :: DeleteWorldTemplate -> DeleteWorldTemplate -> Bool
Prelude.Eq, ReadPrec [DeleteWorldTemplate]
ReadPrec DeleteWorldTemplate
Int -> ReadS DeleteWorldTemplate
ReadS [DeleteWorldTemplate]
(Int -> ReadS DeleteWorldTemplate)
-> ReadS [DeleteWorldTemplate]
-> ReadPrec DeleteWorldTemplate
-> ReadPrec [DeleteWorldTemplate]
-> Read DeleteWorldTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteWorldTemplate]
$creadListPrec :: ReadPrec [DeleteWorldTemplate]
readPrec :: ReadPrec DeleteWorldTemplate
$creadPrec :: ReadPrec DeleteWorldTemplate
readList :: ReadS [DeleteWorldTemplate]
$creadList :: ReadS [DeleteWorldTemplate]
readsPrec :: Int -> ReadS DeleteWorldTemplate
$creadsPrec :: Int -> ReadS DeleteWorldTemplate
Prelude.Read, Int -> DeleteWorldTemplate -> ShowS
[DeleteWorldTemplate] -> ShowS
DeleteWorldTemplate -> String
(Int -> DeleteWorldTemplate -> ShowS)
-> (DeleteWorldTemplate -> String)
-> ([DeleteWorldTemplate] -> ShowS)
-> Show DeleteWorldTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteWorldTemplate] -> ShowS
$cshowList :: [DeleteWorldTemplate] -> ShowS
show :: DeleteWorldTemplate -> String
$cshow :: DeleteWorldTemplate -> String
showsPrec :: Int -> DeleteWorldTemplate -> ShowS
$cshowsPrec :: Int -> DeleteWorldTemplate -> ShowS
Prelude.Show, (forall x. DeleteWorldTemplate -> Rep DeleteWorldTemplate x)
-> (forall x. Rep DeleteWorldTemplate x -> DeleteWorldTemplate)
-> Generic DeleteWorldTemplate
forall x. Rep DeleteWorldTemplate x -> DeleteWorldTemplate
forall x. DeleteWorldTemplate -> Rep DeleteWorldTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteWorldTemplate x -> DeleteWorldTemplate
$cfrom :: forall x. DeleteWorldTemplate -> Rep DeleteWorldTemplate x
Prelude.Generic)
newDeleteWorldTemplate ::
Prelude.Text ->
DeleteWorldTemplate
newDeleteWorldTemplate :: Text -> DeleteWorldTemplate
newDeleteWorldTemplate Text
pTemplate_ =
DeleteWorldTemplate' :: Text -> DeleteWorldTemplate
DeleteWorldTemplate' {$sel:template:DeleteWorldTemplate' :: Text
template = Text
pTemplate_}
deleteWorldTemplate_template :: Lens.Lens' DeleteWorldTemplate Prelude.Text
deleteWorldTemplate_template :: (Text -> f Text) -> DeleteWorldTemplate -> f DeleteWorldTemplate
deleteWorldTemplate_template = (DeleteWorldTemplate -> Text)
-> (DeleteWorldTemplate -> Text -> DeleteWorldTemplate)
-> Lens DeleteWorldTemplate DeleteWorldTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteWorldTemplate' {Text
template :: Text
$sel:template:DeleteWorldTemplate' :: DeleteWorldTemplate -> Text
template} -> Text
template) (\s :: DeleteWorldTemplate
s@DeleteWorldTemplate' {} Text
a -> DeleteWorldTemplate
s {$sel:template:DeleteWorldTemplate' :: Text
template = Text
a} :: DeleteWorldTemplate)
instance Core.AWSRequest DeleteWorldTemplate where
type
AWSResponse DeleteWorldTemplate =
DeleteWorldTemplateResponse
request :: DeleteWorldTemplate -> Request DeleteWorldTemplate
request = Service -> DeleteWorldTemplate -> Request DeleteWorldTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteWorldTemplate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteWorldTemplate)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteWorldTemplate))
-> Logger
-> Service
-> Proxy DeleteWorldTemplate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteWorldTemplate)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteWorldTemplateResponse
DeleteWorldTemplateResponse'
(Int -> DeleteWorldTemplateResponse)
-> Either String Int -> Either String DeleteWorldTemplateResponse
forall (f :: * -> *) a b. Functor 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 DeleteWorldTemplate
instance Prelude.NFData DeleteWorldTemplate
instance Core.ToHeaders DeleteWorldTemplate where
toHeaders :: DeleteWorldTemplate -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteWorldTemplate -> 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.ToJSON DeleteWorldTemplate where
toJSON :: DeleteWorldTemplate -> Value
toJSON DeleteWorldTemplate' {Text
template :: Text
$sel:template:DeleteWorldTemplate' :: DeleteWorldTemplate -> 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
"template" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
template)]
)
instance Core.ToPath DeleteWorldTemplate where
toPath :: DeleteWorldTemplate -> ByteString
toPath = ByteString -> DeleteWorldTemplate -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/deleteWorldTemplate"
instance Core.ToQuery DeleteWorldTemplate where
toQuery :: DeleteWorldTemplate -> QueryString
toQuery = QueryString -> DeleteWorldTemplate -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteWorldTemplateResponse = DeleteWorldTemplateResponse'
{
DeleteWorldTemplateResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteWorldTemplateResponse -> DeleteWorldTemplateResponse -> Bool
(DeleteWorldTemplateResponse
-> DeleteWorldTemplateResponse -> Bool)
-> (DeleteWorldTemplateResponse
-> DeleteWorldTemplateResponse -> Bool)
-> Eq DeleteWorldTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteWorldTemplateResponse -> DeleteWorldTemplateResponse -> Bool
$c/= :: DeleteWorldTemplateResponse -> DeleteWorldTemplateResponse -> Bool
== :: DeleteWorldTemplateResponse -> DeleteWorldTemplateResponse -> Bool
$c== :: DeleteWorldTemplateResponse -> DeleteWorldTemplateResponse -> Bool
Prelude.Eq, ReadPrec [DeleteWorldTemplateResponse]
ReadPrec DeleteWorldTemplateResponse
Int -> ReadS DeleteWorldTemplateResponse
ReadS [DeleteWorldTemplateResponse]
(Int -> ReadS DeleteWorldTemplateResponse)
-> ReadS [DeleteWorldTemplateResponse]
-> ReadPrec DeleteWorldTemplateResponse
-> ReadPrec [DeleteWorldTemplateResponse]
-> Read DeleteWorldTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteWorldTemplateResponse]
$creadListPrec :: ReadPrec [DeleteWorldTemplateResponse]
readPrec :: ReadPrec DeleteWorldTemplateResponse
$creadPrec :: ReadPrec DeleteWorldTemplateResponse
readList :: ReadS [DeleteWorldTemplateResponse]
$creadList :: ReadS [DeleteWorldTemplateResponse]
readsPrec :: Int -> ReadS DeleteWorldTemplateResponse
$creadsPrec :: Int -> ReadS DeleteWorldTemplateResponse
Prelude.Read, Int -> DeleteWorldTemplateResponse -> ShowS
[DeleteWorldTemplateResponse] -> ShowS
DeleteWorldTemplateResponse -> String
(Int -> DeleteWorldTemplateResponse -> ShowS)
-> (DeleteWorldTemplateResponse -> String)
-> ([DeleteWorldTemplateResponse] -> ShowS)
-> Show DeleteWorldTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteWorldTemplateResponse] -> ShowS
$cshowList :: [DeleteWorldTemplateResponse] -> ShowS
show :: DeleteWorldTemplateResponse -> String
$cshow :: DeleteWorldTemplateResponse -> String
showsPrec :: Int -> DeleteWorldTemplateResponse -> ShowS
$cshowsPrec :: Int -> DeleteWorldTemplateResponse -> ShowS
Prelude.Show, (forall x.
DeleteWorldTemplateResponse -> Rep DeleteWorldTemplateResponse x)
-> (forall x.
Rep DeleteWorldTemplateResponse x -> DeleteWorldTemplateResponse)
-> Generic DeleteWorldTemplateResponse
forall x.
Rep DeleteWorldTemplateResponse x -> DeleteWorldTemplateResponse
forall x.
DeleteWorldTemplateResponse -> Rep DeleteWorldTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteWorldTemplateResponse x -> DeleteWorldTemplateResponse
$cfrom :: forall x.
DeleteWorldTemplateResponse -> Rep DeleteWorldTemplateResponse x
Prelude.Generic)
newDeleteWorldTemplateResponse ::
Prelude.Int ->
DeleteWorldTemplateResponse
newDeleteWorldTemplateResponse :: Int -> DeleteWorldTemplateResponse
newDeleteWorldTemplateResponse Int
pHttpStatus_ =
DeleteWorldTemplateResponse' :: Int -> DeleteWorldTemplateResponse
DeleteWorldTemplateResponse'
{ $sel:httpStatus:DeleteWorldTemplateResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteWorldTemplateResponse_httpStatus :: Lens.Lens' DeleteWorldTemplateResponse Prelude.Int
deleteWorldTemplateResponse_httpStatus :: (Int -> f Int)
-> DeleteWorldTemplateResponse -> f DeleteWorldTemplateResponse
deleteWorldTemplateResponse_httpStatus = (DeleteWorldTemplateResponse -> Int)
-> (DeleteWorldTemplateResponse
-> Int -> DeleteWorldTemplateResponse)
-> Lens
DeleteWorldTemplateResponse DeleteWorldTemplateResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteWorldTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteWorldTemplateResponse' :: DeleteWorldTemplateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteWorldTemplateResponse
s@DeleteWorldTemplateResponse' {} Int
a -> DeleteWorldTemplateResponse
s {$sel:httpStatus:DeleteWorldTemplateResponse' :: Int
httpStatus = Int
a} :: DeleteWorldTemplateResponse)
instance Prelude.NFData DeleteWorldTemplateResponse