{-# 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.AuditManager.DeleteAssessmentReport
-- 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 an assessment report from an assessment in Audit Manager.
module Amazonka.AuditManager.DeleteAssessmentReport
  ( -- * Creating a Request
    DeleteAssessmentReport (..),
    newDeleteAssessmentReport,

    -- * Request Lenses
    deleteAssessmentReport_assessmentId,
    deleteAssessmentReport_assessmentReportId,

    -- * Destructuring the Response
    DeleteAssessmentReportResponse (..),
    newDeleteAssessmentReportResponse,

    -- * Response Lenses
    deleteAssessmentReportResponse_httpStatus,
  )
where

import Amazonka.AuditManager.Types
import qualified Amazonka.Core as Core
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:/ 'newDeleteAssessmentReport' smart constructor.
data DeleteAssessmentReport = DeleteAssessmentReport'
  { -- | The identifier for the specified assessment.
    DeleteAssessmentReport -> Text
assessmentId :: Prelude.Text,
    -- | The unique identifier for the assessment report.
    DeleteAssessmentReport -> Text
assessmentReportId :: Prelude.Text
  }
  deriving (DeleteAssessmentReport -> DeleteAssessmentReport -> Bool
(DeleteAssessmentReport -> DeleteAssessmentReport -> Bool)
-> (DeleteAssessmentReport -> DeleteAssessmentReport -> Bool)
-> Eq DeleteAssessmentReport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAssessmentReport -> DeleteAssessmentReport -> Bool
$c/= :: DeleteAssessmentReport -> DeleteAssessmentReport -> Bool
== :: DeleteAssessmentReport -> DeleteAssessmentReport -> Bool
$c== :: DeleteAssessmentReport -> DeleteAssessmentReport -> Bool
Prelude.Eq, ReadPrec [DeleteAssessmentReport]
ReadPrec DeleteAssessmentReport
Int -> ReadS DeleteAssessmentReport
ReadS [DeleteAssessmentReport]
(Int -> ReadS DeleteAssessmentReport)
-> ReadS [DeleteAssessmentReport]
-> ReadPrec DeleteAssessmentReport
-> ReadPrec [DeleteAssessmentReport]
-> Read DeleteAssessmentReport
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAssessmentReport]
$creadListPrec :: ReadPrec [DeleteAssessmentReport]
readPrec :: ReadPrec DeleteAssessmentReport
$creadPrec :: ReadPrec DeleteAssessmentReport
readList :: ReadS [DeleteAssessmentReport]
$creadList :: ReadS [DeleteAssessmentReport]
readsPrec :: Int -> ReadS DeleteAssessmentReport
$creadsPrec :: Int -> ReadS DeleteAssessmentReport
Prelude.Read, Int -> DeleteAssessmentReport -> ShowS
[DeleteAssessmentReport] -> ShowS
DeleteAssessmentReport -> String
(Int -> DeleteAssessmentReport -> ShowS)
-> (DeleteAssessmentReport -> String)
-> ([DeleteAssessmentReport] -> ShowS)
-> Show DeleteAssessmentReport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAssessmentReport] -> ShowS
$cshowList :: [DeleteAssessmentReport] -> ShowS
show :: DeleteAssessmentReport -> String
$cshow :: DeleteAssessmentReport -> String
showsPrec :: Int -> DeleteAssessmentReport -> ShowS
$cshowsPrec :: Int -> DeleteAssessmentReport -> ShowS
Prelude.Show, (forall x. DeleteAssessmentReport -> Rep DeleteAssessmentReport x)
-> (forall x.
    Rep DeleteAssessmentReport x -> DeleteAssessmentReport)
-> Generic DeleteAssessmentReport
forall x. Rep DeleteAssessmentReport x -> DeleteAssessmentReport
forall x. DeleteAssessmentReport -> Rep DeleteAssessmentReport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAssessmentReport x -> DeleteAssessmentReport
$cfrom :: forall x. DeleteAssessmentReport -> Rep DeleteAssessmentReport x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAssessmentReport' 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:
--
-- 'assessmentId', 'deleteAssessmentReport_assessmentId' - The identifier for the specified assessment.
--
-- 'assessmentReportId', 'deleteAssessmentReport_assessmentReportId' - The unique identifier for the assessment report.
newDeleteAssessmentReport ::
  -- | 'assessmentId'
  Prelude.Text ->
  -- | 'assessmentReportId'
  Prelude.Text ->
  DeleteAssessmentReport
newDeleteAssessmentReport :: Text -> Text -> DeleteAssessmentReport
newDeleteAssessmentReport
  Text
pAssessmentId_
  Text
pAssessmentReportId_ =
    DeleteAssessmentReport' :: Text -> Text -> DeleteAssessmentReport
DeleteAssessmentReport'
      { $sel:assessmentId:DeleteAssessmentReport' :: Text
assessmentId =
          Text
pAssessmentId_,
        $sel:assessmentReportId:DeleteAssessmentReport' :: Text
assessmentReportId = Text
pAssessmentReportId_
      }

-- | The identifier for the specified assessment.
deleteAssessmentReport_assessmentId :: Lens.Lens' DeleteAssessmentReport Prelude.Text
deleteAssessmentReport_assessmentId :: (Text -> f Text)
-> DeleteAssessmentReport -> f DeleteAssessmentReport
deleteAssessmentReport_assessmentId = (DeleteAssessmentReport -> Text)
-> (DeleteAssessmentReport -> Text -> DeleteAssessmentReport)
-> Lens DeleteAssessmentReport DeleteAssessmentReport Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAssessmentReport' {Text
assessmentId :: Text
$sel:assessmentId:DeleteAssessmentReport' :: DeleteAssessmentReport -> Text
assessmentId} -> Text
assessmentId) (\s :: DeleteAssessmentReport
s@DeleteAssessmentReport' {} Text
a -> DeleteAssessmentReport
s {$sel:assessmentId:DeleteAssessmentReport' :: Text
assessmentId = Text
a} :: DeleteAssessmentReport)

-- | The unique identifier for the assessment report.
deleteAssessmentReport_assessmentReportId :: Lens.Lens' DeleteAssessmentReport Prelude.Text
deleteAssessmentReport_assessmentReportId :: (Text -> f Text)
-> DeleteAssessmentReport -> f DeleteAssessmentReport
deleteAssessmentReport_assessmentReportId = (DeleteAssessmentReport -> Text)
-> (DeleteAssessmentReport -> Text -> DeleteAssessmentReport)
-> Lens DeleteAssessmentReport DeleteAssessmentReport Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAssessmentReport' {Text
assessmentReportId :: Text
$sel:assessmentReportId:DeleteAssessmentReport' :: DeleteAssessmentReport -> Text
assessmentReportId} -> Text
assessmentReportId) (\s :: DeleteAssessmentReport
s@DeleteAssessmentReport' {} Text
a -> DeleteAssessmentReport
s {$sel:assessmentReportId:DeleteAssessmentReport' :: Text
assessmentReportId = Text
a} :: DeleteAssessmentReport)

instance Core.AWSRequest DeleteAssessmentReport where
  type
    AWSResponse DeleteAssessmentReport =
      DeleteAssessmentReportResponse
  request :: DeleteAssessmentReport -> Request DeleteAssessmentReport
request = Service -> DeleteAssessmentReport -> Request DeleteAssessmentReport
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteAssessmentReport
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteAssessmentReport)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteAssessmentReport))
-> Logger
-> Service
-> Proxy DeleteAssessmentReport
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteAssessmentReport)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteAssessmentReportResponse
DeleteAssessmentReportResponse'
            (Int -> DeleteAssessmentReportResponse)
-> Either String Int
-> Either String DeleteAssessmentReportResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DeleteAssessmentReport

instance Prelude.NFData DeleteAssessmentReport

instance Core.ToHeaders DeleteAssessmentReport where
  toHeaders :: DeleteAssessmentReport -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteAssessmentReport -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath DeleteAssessmentReport where
  toPath :: DeleteAssessmentReport -> ByteString
toPath DeleteAssessmentReport' {Text
assessmentReportId :: Text
assessmentId :: Text
$sel:assessmentReportId:DeleteAssessmentReport' :: DeleteAssessmentReport -> Text
$sel:assessmentId:DeleteAssessmentReport' :: DeleteAssessmentReport -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/assessments/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
assessmentId,
        ByteString
"/reports/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
assessmentReportId
      ]

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

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

-- |
-- Create a value of 'DeleteAssessmentReportResponse' 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', 'deleteAssessmentReportResponse_httpStatus' - The response's http status code.
newDeleteAssessmentReportResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteAssessmentReportResponse
newDeleteAssessmentReportResponse :: Int -> DeleteAssessmentReportResponse
newDeleteAssessmentReportResponse Int
pHttpStatus_ =
  DeleteAssessmentReportResponse' :: Int -> DeleteAssessmentReportResponse
DeleteAssessmentReportResponse'
    { $sel:httpStatus:DeleteAssessmentReportResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance
  Prelude.NFData
    DeleteAssessmentReportResponse