{-# 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.MediaConvert.DeleteJobTemplate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Permanently delete a job template you have created.
module Amazonka.MediaConvert.DeleteJobTemplate
  ( -- * Creating a Request
    DeleteJobTemplate (..),
    newDeleteJobTemplate,

    -- * Request Lenses
    deleteJobTemplate_name,

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

    -- * Response Lenses
    deleteJobTemplateResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConvert.Types
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 name of the job template to be deleted.
    DeleteJobTemplate -> Text
name :: Prelude.Text
  }
  deriving (DeleteJobTemplate -> DeleteJobTemplate -> Bool
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]
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
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. 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:
--
-- 'name', 'deleteJobTemplate_name' - The name of the job template to be deleted.
newDeleteJobTemplate ::
  -- | 'name'
  Prelude.Text ->
  DeleteJobTemplate
newDeleteJobTemplate :: Text -> DeleteJobTemplate
newDeleteJobTemplate Text
pName_ =
  DeleteJobTemplate' {$sel:name:DeleteJobTemplate' :: Text
name = Text
pName_}

-- | The name of the job template to be deleted.
deleteJobTemplate_name :: Lens.Lens' DeleteJobTemplate Prelude.Text
deleteJobTemplate_name :: Lens' DeleteJobTemplate Text
deleteJobTemplate_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteJobTemplate' {Text
name :: Text
$sel:name:DeleteJobTemplate' :: DeleteJobTemplate -> Text
name} -> Text
name) (\s :: DeleteJobTemplate
s@DeleteJobTemplate' {} Text
a -> DeleteJobTemplate
s {$sel:name:DeleteJobTemplate' :: Text
name = Text
a} :: DeleteJobTemplate)

instance Core.AWSRequest DeleteJobTemplate where
  type
    AWSResponse DeleteJobTemplate =
      DeleteJobTemplateResponse
  request :: (Service -> Service)
-> DeleteJobTemplate -> Request DeleteJobTemplate
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteJobTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteJobTemplate)))
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 -> DeleteJobTemplateResponse
DeleteJobTemplateResponse'
            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 DeleteJobTemplate where
  hashWithSalt :: Int -> DeleteJobTemplate -> Int
hashWithSalt Int
_salt DeleteJobTemplate' {Text
name :: Text
$sel:name:DeleteJobTemplate' :: DeleteJobTemplate -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

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

instance Data.ToHeaders DeleteJobTemplate where
  toHeaders :: DeleteJobTemplate -> 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.ToPath DeleteJobTemplate where
  toPath :: DeleteJobTemplate -> ByteString
toPath DeleteJobTemplate' {Text
name :: Text
$sel:name:DeleteJobTemplate' :: DeleteJobTemplate -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/2017-08-29/jobTemplates/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
name]

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

-- | /See:/ 'newDeleteJobTemplateResponse' smart constructor.
data DeleteJobTemplateResponse = DeleteJobTemplateResponse'
  { -- | The response's http status code.
    DeleteJobTemplateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeleteJobTemplateResponse -> DeleteJobTemplateResponse -> Bool
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]
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
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.
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.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'deleteJobTemplateResponse_httpStatus' - The response's http status code.
newDeleteJobTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteJobTemplateResponse
newDeleteJobTemplateResponse :: Int -> DeleteJobTemplateResponse
newDeleteJobTemplateResponse Int
pHttpStatus_ =
  DeleteJobTemplateResponse'
    { $sel:httpStatus:DeleteJobTemplateResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
deleteJobTemplateResponse_httpStatus :: Lens.Lens' DeleteJobTemplateResponse Prelude.Int
deleteJobTemplateResponse_httpStatus :: Lens' DeleteJobTemplateResponse Int
deleteJobTemplateResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteJobTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteJobTemplateResponse' :: DeleteJobTemplateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteJobTemplateResponse
s@DeleteJobTemplateResponse' {} Int
a -> DeleteJobTemplateResponse
s {$sel:httpStatus:DeleteJobTemplateResponse' :: Int
httpStatus = Int
a} :: DeleteJobTemplateResponse)

instance Prelude.NFData DeleteJobTemplateResponse where
  rnf :: DeleteJobTemplateResponse -> ()
rnf DeleteJobTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteJobTemplateResponse' :: DeleteJobTemplateResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus