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

    -- * Request Lenses
    deleteAssessmentTarget_assessmentTargetArn,

    -- * Destructuring the Response
    DeleteAssessmentTargetResponse (..),
    newDeleteAssessmentTargetResponse,
  )
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:/ 'newDeleteAssessmentTarget' smart constructor.
data DeleteAssessmentTarget = DeleteAssessmentTarget'
  { -- | The ARN that specifies the assessment target that you want to delete.
    DeleteAssessmentTarget -> Text
assessmentTargetArn :: Prelude.Text
  }
  deriving (DeleteAssessmentTarget -> DeleteAssessmentTarget -> Bool
(DeleteAssessmentTarget -> DeleteAssessmentTarget -> Bool)
-> (DeleteAssessmentTarget -> DeleteAssessmentTarget -> Bool)
-> Eq DeleteAssessmentTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAssessmentTarget -> DeleteAssessmentTarget -> Bool
$c/= :: DeleteAssessmentTarget -> DeleteAssessmentTarget -> Bool
== :: DeleteAssessmentTarget -> DeleteAssessmentTarget -> Bool
$c== :: DeleteAssessmentTarget -> DeleteAssessmentTarget -> Bool
Prelude.Eq, ReadPrec [DeleteAssessmentTarget]
ReadPrec DeleteAssessmentTarget
Int -> ReadS DeleteAssessmentTarget
ReadS [DeleteAssessmentTarget]
(Int -> ReadS DeleteAssessmentTarget)
-> ReadS [DeleteAssessmentTarget]
-> ReadPrec DeleteAssessmentTarget
-> ReadPrec [DeleteAssessmentTarget]
-> Read DeleteAssessmentTarget
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAssessmentTarget]
$creadListPrec :: ReadPrec [DeleteAssessmentTarget]
readPrec :: ReadPrec DeleteAssessmentTarget
$creadPrec :: ReadPrec DeleteAssessmentTarget
readList :: ReadS [DeleteAssessmentTarget]
$creadList :: ReadS [DeleteAssessmentTarget]
readsPrec :: Int -> ReadS DeleteAssessmentTarget
$creadsPrec :: Int -> ReadS DeleteAssessmentTarget
Prelude.Read, Int -> DeleteAssessmentTarget -> ShowS
[DeleteAssessmentTarget] -> ShowS
DeleteAssessmentTarget -> String
(Int -> DeleteAssessmentTarget -> ShowS)
-> (DeleteAssessmentTarget -> String)
-> ([DeleteAssessmentTarget] -> ShowS)
-> Show DeleteAssessmentTarget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAssessmentTarget] -> ShowS
$cshowList :: [DeleteAssessmentTarget] -> ShowS
show :: DeleteAssessmentTarget -> String
$cshow :: DeleteAssessmentTarget -> String
showsPrec :: Int -> DeleteAssessmentTarget -> ShowS
$cshowsPrec :: Int -> DeleteAssessmentTarget -> ShowS
Prelude.Show, (forall x. DeleteAssessmentTarget -> Rep DeleteAssessmentTarget x)
-> (forall x.
    Rep DeleteAssessmentTarget x -> DeleteAssessmentTarget)
-> Generic DeleteAssessmentTarget
forall x. Rep DeleteAssessmentTarget x -> DeleteAssessmentTarget
forall x. DeleteAssessmentTarget -> Rep DeleteAssessmentTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAssessmentTarget x -> DeleteAssessmentTarget
$cfrom :: forall x. DeleteAssessmentTarget -> Rep DeleteAssessmentTarget x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAssessmentTarget' 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:
--
-- 'assessmentTargetArn', 'deleteAssessmentTarget_assessmentTargetArn' - The ARN that specifies the assessment target that you want to delete.
newDeleteAssessmentTarget ::
  -- | 'assessmentTargetArn'
  Prelude.Text ->
  DeleteAssessmentTarget
newDeleteAssessmentTarget :: Text -> DeleteAssessmentTarget
newDeleteAssessmentTarget Text
pAssessmentTargetArn_ =
  DeleteAssessmentTarget' :: Text -> DeleteAssessmentTarget
DeleteAssessmentTarget'
    { $sel:assessmentTargetArn:DeleteAssessmentTarget' :: Text
assessmentTargetArn =
        Text
pAssessmentTargetArn_
    }

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

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

instance Prelude.Hashable DeleteAssessmentTarget

instance Prelude.NFData DeleteAssessmentTarget

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

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

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

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

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

instance
  Prelude.NFData
    DeleteAssessmentTargetResponse