{-# 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.IoT.DeleteJobTemplate
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes the specified job template.
module Amazonka.IoT.DeleteJobTemplate
  ( -- * Creating a Request
    DeleteJobTemplate (..),
    newDeleteJobTemplate,

    -- * Request Lenses
    deleteJobTemplate_jobTemplateId,

    -- * Destructuring the Response
    DeleteJobTemplateResponse (..),
    newDeleteJobTemplateResponse,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.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

-- | /See:/ 'newDeleteJobTemplate' smart constructor.
data DeleteJobTemplate = DeleteJobTemplate'
  { -- | The unique identifier of the job template to delete.
    DeleteJobTemplate -> Text
jobTemplateId :: Prelude.Text
  }
  deriving (DeleteJobTemplate -> DeleteJobTemplate -> Bool
(DeleteJobTemplate -> DeleteJobTemplate -> Bool)
-> (DeleteJobTemplate -> DeleteJobTemplate -> Bool)
-> Eq DeleteJobTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteJobTemplate -> DeleteJobTemplate -> Bool
$c/= :: DeleteJobTemplate -> DeleteJobTemplate -> Bool
== :: DeleteJobTemplate -> DeleteJobTemplate -> Bool
$c== :: DeleteJobTemplate -> DeleteJobTemplate -> Bool
Prelude.Eq, ReadPrec [DeleteJobTemplate]
ReadPrec DeleteJobTemplate
Int -> ReadS DeleteJobTemplate
ReadS [DeleteJobTemplate]
(Int -> ReadS DeleteJobTemplate)
-> ReadS [DeleteJobTemplate]
-> ReadPrec DeleteJobTemplate
-> ReadPrec [DeleteJobTemplate]
-> Read DeleteJobTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteJobTemplate]
$creadListPrec :: ReadPrec [DeleteJobTemplate]
readPrec :: ReadPrec DeleteJobTemplate
$creadPrec :: ReadPrec DeleteJobTemplate
readList :: ReadS [DeleteJobTemplate]
$creadList :: ReadS [DeleteJobTemplate]
readsPrec :: Int -> ReadS DeleteJobTemplate
$creadsPrec :: Int -> ReadS DeleteJobTemplate
Prelude.Read, Int -> DeleteJobTemplate -> ShowS
[DeleteJobTemplate] -> ShowS
DeleteJobTemplate -> String
(Int -> DeleteJobTemplate -> ShowS)
-> (DeleteJobTemplate -> String)
-> ([DeleteJobTemplate] -> ShowS)
-> Show DeleteJobTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteJobTemplate] -> ShowS
$cshowList :: [DeleteJobTemplate] -> ShowS
show :: DeleteJobTemplate -> String
$cshow :: DeleteJobTemplate -> String
showsPrec :: Int -> DeleteJobTemplate -> ShowS
$cshowsPrec :: Int -> DeleteJobTemplate -> ShowS
Prelude.Show, (forall x. DeleteJobTemplate -> Rep DeleteJobTemplate x)
-> (forall x. Rep DeleteJobTemplate x -> DeleteJobTemplate)
-> Generic DeleteJobTemplate
forall x. Rep DeleteJobTemplate x -> DeleteJobTemplate
forall x. DeleteJobTemplate -> Rep DeleteJobTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteJobTemplate x -> DeleteJobTemplate
$cfrom :: forall x. DeleteJobTemplate -> Rep DeleteJobTemplate x
Prelude.Generic)

-- |
-- Create a value of 'DeleteJobTemplate' 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:
--
-- 'jobTemplateId', 'deleteJobTemplate_jobTemplateId' - The unique identifier of the job template to delete.
newDeleteJobTemplate ::
  -- | 'jobTemplateId'
  Prelude.Text ->
  DeleteJobTemplate
newDeleteJobTemplate :: Text -> DeleteJobTemplate
newDeleteJobTemplate Text
pJobTemplateId_ =
  DeleteJobTemplate' :: Text -> DeleteJobTemplate
DeleteJobTemplate' {$sel:jobTemplateId:DeleteJobTemplate' :: Text
jobTemplateId = Text
pJobTemplateId_}

-- | The unique identifier of the job template to delete.
deleteJobTemplate_jobTemplateId :: Lens.Lens' DeleteJobTemplate Prelude.Text
deleteJobTemplate_jobTemplateId :: (Text -> f Text) -> DeleteJobTemplate -> f DeleteJobTemplate
deleteJobTemplate_jobTemplateId = (DeleteJobTemplate -> Text)
-> (DeleteJobTemplate -> Text -> DeleteJobTemplate)
-> Lens DeleteJobTemplate DeleteJobTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteJobTemplate' {Text
jobTemplateId :: Text
$sel:jobTemplateId:DeleteJobTemplate' :: DeleteJobTemplate -> Text
jobTemplateId} -> Text
jobTemplateId) (\s :: DeleteJobTemplate
s@DeleteJobTemplate' {} Text
a -> DeleteJobTemplate
s {$sel:jobTemplateId:DeleteJobTemplate' :: Text
jobTemplateId = Text
a} :: DeleteJobTemplate)

instance Core.AWSRequest DeleteJobTemplate where
  type
    AWSResponse DeleteJobTemplate =
      DeleteJobTemplateResponse
  request :: DeleteJobTemplate -> Request DeleteJobTemplate
request = Service -> DeleteJobTemplate -> Request DeleteJobTemplate
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteJobTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteJobTemplate)))
response =
    AWSResponse DeleteJobTemplate
-> Logger
-> Service
-> Proxy DeleteJobTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteJobTemplate)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteJobTemplate
DeleteJobTemplateResponse
DeleteJobTemplateResponse'

instance Prelude.Hashable DeleteJobTemplate

instance Prelude.NFData DeleteJobTemplate

instance Core.ToHeaders DeleteJobTemplate where
  toHeaders :: DeleteJobTemplate -> [Header]
toHeaders = [Header] -> DeleteJobTemplate -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath DeleteJobTemplate where
  toPath :: DeleteJobTemplate -> ByteString
toPath DeleteJobTemplate' {Text
jobTemplateId :: Text
$sel:jobTemplateId:DeleteJobTemplate' :: DeleteJobTemplate -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/job-templates/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
jobTemplateId]

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

-- | /See:/ 'newDeleteJobTemplateResponse' smart constructor.
data DeleteJobTemplateResponse = DeleteJobTemplateResponse'
  {
  }
  deriving (DeleteJobTemplateResponse -> DeleteJobTemplateResponse -> Bool
(DeleteJobTemplateResponse -> DeleteJobTemplateResponse -> Bool)
-> (DeleteJobTemplateResponse -> DeleteJobTemplateResponse -> Bool)
-> Eq DeleteJobTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteJobTemplateResponse -> DeleteJobTemplateResponse -> Bool
$c/= :: DeleteJobTemplateResponse -> DeleteJobTemplateResponse -> Bool
== :: DeleteJobTemplateResponse -> DeleteJobTemplateResponse -> Bool
$c== :: DeleteJobTemplateResponse -> DeleteJobTemplateResponse -> Bool
Prelude.Eq, ReadPrec [DeleteJobTemplateResponse]
ReadPrec DeleteJobTemplateResponse
Int -> ReadS DeleteJobTemplateResponse
ReadS [DeleteJobTemplateResponse]
(Int -> ReadS DeleteJobTemplateResponse)
-> ReadS [DeleteJobTemplateResponse]
-> ReadPrec DeleteJobTemplateResponse
-> ReadPrec [DeleteJobTemplateResponse]
-> Read DeleteJobTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteJobTemplateResponse]
$creadListPrec :: ReadPrec [DeleteJobTemplateResponse]
readPrec :: ReadPrec DeleteJobTemplateResponse
$creadPrec :: ReadPrec DeleteJobTemplateResponse
readList :: ReadS [DeleteJobTemplateResponse]
$creadList :: ReadS [DeleteJobTemplateResponse]
readsPrec :: Int -> ReadS DeleteJobTemplateResponse
$creadsPrec :: Int -> ReadS DeleteJobTemplateResponse
Prelude.Read, Int -> DeleteJobTemplateResponse -> ShowS
[DeleteJobTemplateResponse] -> ShowS
DeleteJobTemplateResponse -> String
(Int -> DeleteJobTemplateResponse -> ShowS)
-> (DeleteJobTemplateResponse -> String)
-> ([DeleteJobTemplateResponse] -> ShowS)
-> Show DeleteJobTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteJobTemplateResponse] -> ShowS
$cshowList :: [DeleteJobTemplateResponse] -> ShowS
show :: DeleteJobTemplateResponse -> String
$cshow :: DeleteJobTemplateResponse -> String
showsPrec :: Int -> DeleteJobTemplateResponse -> ShowS
$cshowsPrec :: Int -> DeleteJobTemplateResponse -> ShowS
Prelude.Show, (forall x.
 DeleteJobTemplateResponse -> Rep DeleteJobTemplateResponse x)
-> (forall x.
    Rep DeleteJobTemplateResponse x -> DeleteJobTemplateResponse)
-> Generic DeleteJobTemplateResponse
forall x.
Rep DeleteJobTemplateResponse x -> DeleteJobTemplateResponse
forall x.
DeleteJobTemplateResponse -> Rep DeleteJobTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteJobTemplateResponse x -> DeleteJobTemplateResponse
$cfrom :: forall x.
DeleteJobTemplateResponse -> Rep DeleteJobTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteJobTemplateResponse' 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.
newDeleteJobTemplateResponse ::
  DeleteJobTemplateResponse
newDeleteJobTemplateResponse :: DeleteJobTemplateResponse
newDeleteJobTemplateResponse =
  DeleteJobTemplateResponse
DeleteJobTemplateResponse'

instance Prelude.NFData DeleteJobTemplateResponse