{-# 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.Inspector.DeleteAssessmentTemplate
-- 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 assessment template that is specified by the ARN of the
-- assessment template.
module Amazonka.Inspector.DeleteAssessmentTemplate
  ( -- * Creating a Request
    DeleteAssessmentTemplate (..),
    newDeleteAssessmentTemplate,

    -- * Request Lenses
    deleteAssessmentTemplate_assessmentTemplateArn,

    -- * Destructuring the Response
    DeleteAssessmentTemplateResponse (..),
    newDeleteAssessmentTemplateResponse,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Inspector.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:/ 'newDeleteAssessmentTemplate' smart constructor.
data DeleteAssessmentTemplate = DeleteAssessmentTemplate'
  { -- | The ARN that specifies the assessment template that you want to delete.
    DeleteAssessmentTemplate -> Text
assessmentTemplateArn :: Prelude.Text
  }
  deriving (DeleteAssessmentTemplate -> DeleteAssessmentTemplate -> Bool
(DeleteAssessmentTemplate -> DeleteAssessmentTemplate -> Bool)
-> (DeleteAssessmentTemplate -> DeleteAssessmentTemplate -> Bool)
-> Eq DeleteAssessmentTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAssessmentTemplate -> DeleteAssessmentTemplate -> Bool
$c/= :: DeleteAssessmentTemplate -> DeleteAssessmentTemplate -> Bool
== :: DeleteAssessmentTemplate -> DeleteAssessmentTemplate -> Bool
$c== :: DeleteAssessmentTemplate -> DeleteAssessmentTemplate -> Bool
Prelude.Eq, ReadPrec [DeleteAssessmentTemplate]
ReadPrec DeleteAssessmentTemplate
Int -> ReadS DeleteAssessmentTemplate
ReadS [DeleteAssessmentTemplate]
(Int -> ReadS DeleteAssessmentTemplate)
-> ReadS [DeleteAssessmentTemplate]
-> ReadPrec DeleteAssessmentTemplate
-> ReadPrec [DeleteAssessmentTemplate]
-> Read DeleteAssessmentTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAssessmentTemplate]
$creadListPrec :: ReadPrec [DeleteAssessmentTemplate]
readPrec :: ReadPrec DeleteAssessmentTemplate
$creadPrec :: ReadPrec DeleteAssessmentTemplate
readList :: ReadS [DeleteAssessmentTemplate]
$creadList :: ReadS [DeleteAssessmentTemplate]
readsPrec :: Int -> ReadS DeleteAssessmentTemplate
$creadsPrec :: Int -> ReadS DeleteAssessmentTemplate
Prelude.Read, Int -> DeleteAssessmentTemplate -> ShowS
[DeleteAssessmentTemplate] -> ShowS
DeleteAssessmentTemplate -> String
(Int -> DeleteAssessmentTemplate -> ShowS)
-> (DeleteAssessmentTemplate -> String)
-> ([DeleteAssessmentTemplate] -> ShowS)
-> Show DeleteAssessmentTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAssessmentTemplate] -> ShowS
$cshowList :: [DeleteAssessmentTemplate] -> ShowS
show :: DeleteAssessmentTemplate -> String
$cshow :: DeleteAssessmentTemplate -> String
showsPrec :: Int -> DeleteAssessmentTemplate -> ShowS
$cshowsPrec :: Int -> DeleteAssessmentTemplate -> ShowS
Prelude.Show, (forall x.
 DeleteAssessmentTemplate -> Rep DeleteAssessmentTemplate x)
-> (forall x.
    Rep DeleteAssessmentTemplate x -> DeleteAssessmentTemplate)
-> Generic DeleteAssessmentTemplate
forall x.
Rep DeleteAssessmentTemplate x -> DeleteAssessmentTemplate
forall x.
DeleteAssessmentTemplate -> Rep DeleteAssessmentTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteAssessmentTemplate x -> DeleteAssessmentTemplate
$cfrom :: forall x.
DeleteAssessmentTemplate -> Rep DeleteAssessmentTemplate x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAssessmentTemplate' 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:
--
-- 'assessmentTemplateArn', 'deleteAssessmentTemplate_assessmentTemplateArn' - The ARN that specifies the assessment template that you want to delete.
newDeleteAssessmentTemplate ::
  -- | 'assessmentTemplateArn'
  Prelude.Text ->
  DeleteAssessmentTemplate
newDeleteAssessmentTemplate :: Text -> DeleteAssessmentTemplate
newDeleteAssessmentTemplate Text
pAssessmentTemplateArn_ =
  DeleteAssessmentTemplate' :: Text -> DeleteAssessmentTemplate
DeleteAssessmentTemplate'
    { $sel:assessmentTemplateArn:DeleteAssessmentTemplate' :: Text
assessmentTemplateArn =
        Text
pAssessmentTemplateArn_
    }

-- | The ARN that specifies the assessment template that you want to delete.
deleteAssessmentTemplate_assessmentTemplateArn :: Lens.Lens' DeleteAssessmentTemplate Prelude.Text
deleteAssessmentTemplate_assessmentTemplateArn :: (Text -> f Text)
-> DeleteAssessmentTemplate -> f DeleteAssessmentTemplate
deleteAssessmentTemplate_assessmentTemplateArn = (DeleteAssessmentTemplate -> Text)
-> (DeleteAssessmentTemplate -> Text -> DeleteAssessmentTemplate)
-> Lens DeleteAssessmentTemplate DeleteAssessmentTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAssessmentTemplate' {Text
assessmentTemplateArn :: Text
$sel:assessmentTemplateArn:DeleteAssessmentTemplate' :: DeleteAssessmentTemplate -> Text
assessmentTemplateArn} -> Text
assessmentTemplateArn) (\s :: DeleteAssessmentTemplate
s@DeleteAssessmentTemplate' {} Text
a -> DeleteAssessmentTemplate
s {$sel:assessmentTemplateArn:DeleteAssessmentTemplate' :: Text
assessmentTemplateArn = Text
a} :: DeleteAssessmentTemplate)

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

instance Prelude.Hashable DeleteAssessmentTemplate

instance Prelude.NFData DeleteAssessmentTemplate

instance Core.ToHeaders DeleteAssessmentTemplate where
  toHeaders :: DeleteAssessmentTemplate -> [Header]
toHeaders =
    [Header] -> DeleteAssessmentTemplate -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"InspectorService.DeleteAssessmentTemplate" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DeleteAssessmentTemplate where
  toJSON :: DeleteAssessmentTemplate -> Value
toJSON DeleteAssessmentTemplate' {Text
assessmentTemplateArn :: Text
$sel:assessmentTemplateArn:DeleteAssessmentTemplate' :: DeleteAssessmentTemplate -> 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
"assessmentTemplateArn"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
assessmentTemplateArn
              )
          ]
      )

instance Core.ToPath DeleteAssessmentTemplate where
  toPath :: DeleteAssessmentTemplate -> ByteString
toPath = ByteString -> DeleteAssessmentTemplate -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

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

instance
  Prelude.NFData
    DeleteAssessmentTemplateResponse