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

    -- * Request Lenses
    deleteAssessmentRun_assessmentRunArn,

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

-- |
-- Create a value of 'DeleteAssessmentRun' 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:
--
-- 'assessmentRunArn', 'deleteAssessmentRun_assessmentRunArn' - The ARN that specifies the assessment run that you want to delete.
newDeleteAssessmentRun ::
  -- | 'assessmentRunArn'
  Prelude.Text ->
  DeleteAssessmentRun
newDeleteAssessmentRun :: Text -> DeleteAssessmentRun
newDeleteAssessmentRun Text
pAssessmentRunArn_ =
  DeleteAssessmentRun' :: Text -> DeleteAssessmentRun
DeleteAssessmentRun'
    { $sel:assessmentRunArn:DeleteAssessmentRun' :: Text
assessmentRunArn =
        Text
pAssessmentRunArn_
    }

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

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

instance Prelude.Hashable DeleteAssessmentRun

instance Prelude.NFData DeleteAssessmentRun

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

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

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

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

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

instance Prelude.NFData DeleteAssessmentRunResponse