{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.RobOMaker.DeleteWorldTemplate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a world template.
module Amazonka.RobOMaker.DeleteWorldTemplate
  ( -- * Creating a Request
    DeleteWorldTemplate (..),
    newDeleteWorldTemplate,

    -- * Request Lenses
    deleteWorldTemplate_template,

    -- * Destructuring the Response
    DeleteWorldTemplateResponse (..),
    newDeleteWorldTemplateResponse,

    -- * Response Lenses
    deleteWorldTemplateResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.RobOMaker.Types

-- | /See:/ 'newDeleteWorldTemplate' smart constructor.
data DeleteWorldTemplate = DeleteWorldTemplate'
  { -- | The Amazon Resource Name (arn) of the world template you want to delete.
    DeleteWorldTemplate -> Text
template :: Prelude.Text
  }
  deriving (DeleteWorldTemplate -> DeleteWorldTemplate -> Bool
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]
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
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. 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)

-- |
-- Create a value of 'DeleteWorldTemplate' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'template', 'deleteWorldTemplate_template' - The Amazon Resource Name (arn) of the world template you want to delete.
newDeleteWorldTemplate ::
  -- | 'template'
  Prelude.Text ->
  DeleteWorldTemplate
newDeleteWorldTemplate :: Text -> DeleteWorldTemplate
newDeleteWorldTemplate Text
pTemplate_ =
  DeleteWorldTemplate' {$sel:template:DeleteWorldTemplate' :: Text
template = Text
pTemplate_}

-- | The Amazon Resource Name (arn) of the world template you want to delete.
deleteWorldTemplate_template :: Lens.Lens' DeleteWorldTemplate Prelude.Text
deleteWorldTemplate_template :: Lens' DeleteWorldTemplate Text
deleteWorldTemplate_template = 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 :: (Service -> Service)
-> DeleteWorldTemplate -> Request DeleteWorldTemplate
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteWorldTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteWorldTemplate)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteWorldTemplateResponse
DeleteWorldTemplateResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DeleteWorldTemplate where
  hashWithSalt :: Int -> DeleteWorldTemplate -> Int
hashWithSalt Int
_salt DeleteWorldTemplate' {Text
template :: Text
$sel:template:DeleteWorldTemplate' :: DeleteWorldTemplate -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
template

instance Prelude.NFData DeleteWorldTemplate where
  rnf :: DeleteWorldTemplate -> ()
rnf DeleteWorldTemplate' {Text
template :: Text
$sel:template:DeleteWorldTemplate' :: DeleteWorldTemplate -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
template

instance Data.ToHeaders DeleteWorldTemplate where
  toHeaders :: DeleteWorldTemplate -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DeleteWorldTemplate where
  toJSON :: DeleteWorldTemplate -> Value
toJSON DeleteWorldTemplate' {Text
template :: Text
$sel:template:DeleteWorldTemplate' :: DeleteWorldTemplate -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"template" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
template)]
      )

instance Data.ToPath DeleteWorldTemplate where
  toPath :: DeleteWorldTemplate -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/deleteWorldTemplate"

instance Data.ToQuery DeleteWorldTemplate where
  toQuery :: DeleteWorldTemplate -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDeleteWorldTemplateResponse' smart constructor.
data DeleteWorldTemplateResponse = DeleteWorldTemplateResponse'
  { -- | The response's http status code.
    DeleteWorldTemplateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeleteWorldTemplateResponse -> DeleteWorldTemplateResponse -> Bool
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]
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
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.
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)

-- |
-- Create a value of 'DeleteWorldTemplateResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'deleteWorldTemplateResponse_httpStatus' - The response's http status code.
newDeleteWorldTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteWorldTemplateResponse
newDeleteWorldTemplateResponse :: Int -> DeleteWorldTemplateResponse
newDeleteWorldTemplateResponse Int
pHttpStatus_ =
  DeleteWorldTemplateResponse'
    { $sel:httpStatus:DeleteWorldTemplateResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
deleteWorldTemplateResponse_httpStatus :: Lens.Lens' DeleteWorldTemplateResponse Prelude.Int
deleteWorldTemplateResponse_httpStatus :: Lens' DeleteWorldTemplateResponse Int
deleteWorldTemplateResponse_httpStatus = 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 where
  rnf :: DeleteWorldTemplateResponse -> ()
rnf DeleteWorldTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteWorldTemplateResponse' :: DeleteWorldTemplateResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus