{-# 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.Backup.DeleteReportPlan
-- 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 report plan specified by a report plan name.
module Amazonka.Backup.DeleteReportPlan
  ( -- * Creating a Request
    DeleteReportPlan (..),
    newDeleteReportPlan,

    -- * Request Lenses
    deleteReportPlan_reportPlanName,

    -- * Destructuring the Response
    DeleteReportPlanResponse (..),
    newDeleteReportPlanResponse,
  )
where

import Amazonka.Backup.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:/ 'newDeleteReportPlan' smart constructor.
data DeleteReportPlan = DeleteReportPlan'
  { -- | The unique name of a report plan.
    DeleteReportPlan -> Text
reportPlanName :: Prelude.Text
  }
  deriving (DeleteReportPlan -> DeleteReportPlan -> Bool
(DeleteReportPlan -> DeleteReportPlan -> Bool)
-> (DeleteReportPlan -> DeleteReportPlan -> Bool)
-> Eq DeleteReportPlan
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteReportPlan -> DeleteReportPlan -> Bool
$c/= :: DeleteReportPlan -> DeleteReportPlan -> Bool
== :: DeleteReportPlan -> DeleteReportPlan -> Bool
$c== :: DeleteReportPlan -> DeleteReportPlan -> Bool
Prelude.Eq, ReadPrec [DeleteReportPlan]
ReadPrec DeleteReportPlan
Int -> ReadS DeleteReportPlan
ReadS [DeleteReportPlan]
(Int -> ReadS DeleteReportPlan)
-> ReadS [DeleteReportPlan]
-> ReadPrec DeleteReportPlan
-> ReadPrec [DeleteReportPlan]
-> Read DeleteReportPlan
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteReportPlan]
$creadListPrec :: ReadPrec [DeleteReportPlan]
readPrec :: ReadPrec DeleteReportPlan
$creadPrec :: ReadPrec DeleteReportPlan
readList :: ReadS [DeleteReportPlan]
$creadList :: ReadS [DeleteReportPlan]
readsPrec :: Int -> ReadS DeleteReportPlan
$creadsPrec :: Int -> ReadS DeleteReportPlan
Prelude.Read, Int -> DeleteReportPlan -> ShowS
[DeleteReportPlan] -> ShowS
DeleteReportPlan -> String
(Int -> DeleteReportPlan -> ShowS)
-> (DeleteReportPlan -> String)
-> ([DeleteReportPlan] -> ShowS)
-> Show DeleteReportPlan
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteReportPlan] -> ShowS
$cshowList :: [DeleteReportPlan] -> ShowS
show :: DeleteReportPlan -> String
$cshow :: DeleteReportPlan -> String
showsPrec :: Int -> DeleteReportPlan -> ShowS
$cshowsPrec :: Int -> DeleteReportPlan -> ShowS
Prelude.Show, (forall x. DeleteReportPlan -> Rep DeleteReportPlan x)
-> (forall x. Rep DeleteReportPlan x -> DeleteReportPlan)
-> Generic DeleteReportPlan
forall x. Rep DeleteReportPlan x -> DeleteReportPlan
forall x. DeleteReportPlan -> Rep DeleteReportPlan x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteReportPlan x -> DeleteReportPlan
$cfrom :: forall x. DeleteReportPlan -> Rep DeleteReportPlan x
Prelude.Generic)

-- |
-- Create a value of 'DeleteReportPlan' 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:
--
-- 'reportPlanName', 'deleteReportPlan_reportPlanName' - The unique name of a report plan.
newDeleteReportPlan ::
  -- | 'reportPlanName'
  Prelude.Text ->
  DeleteReportPlan
newDeleteReportPlan :: Text -> DeleteReportPlan
newDeleteReportPlan Text
pReportPlanName_ =
  DeleteReportPlan' :: Text -> DeleteReportPlan
DeleteReportPlan'
    { $sel:reportPlanName:DeleteReportPlan' :: Text
reportPlanName =
        Text
pReportPlanName_
    }

-- | The unique name of a report plan.
deleteReportPlan_reportPlanName :: Lens.Lens' DeleteReportPlan Prelude.Text
deleteReportPlan_reportPlanName :: (Text -> f Text) -> DeleteReportPlan -> f DeleteReportPlan
deleteReportPlan_reportPlanName = (DeleteReportPlan -> Text)
-> (DeleteReportPlan -> Text -> DeleteReportPlan)
-> Lens DeleteReportPlan DeleteReportPlan Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReportPlan' {Text
reportPlanName :: Text
$sel:reportPlanName:DeleteReportPlan' :: DeleteReportPlan -> Text
reportPlanName} -> Text
reportPlanName) (\s :: DeleteReportPlan
s@DeleteReportPlan' {} Text
a -> DeleteReportPlan
s {$sel:reportPlanName:DeleteReportPlan' :: Text
reportPlanName = Text
a} :: DeleteReportPlan)

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

instance Prelude.Hashable DeleteReportPlan

instance Prelude.NFData DeleteReportPlan

instance Core.ToHeaders DeleteReportPlan where
  toHeaders :: DeleteReportPlan -> [Header]
toHeaders =
    [Header] -> DeleteReportPlan -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath DeleteReportPlan where
  toPath :: DeleteReportPlan -> ByteString
toPath DeleteReportPlan' {Text
reportPlanName :: Text
$sel:reportPlanName:DeleteReportPlan' :: DeleteReportPlan -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/audit/report-plans/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
reportPlanName]

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

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

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

instance Prelude.NFData DeleteReportPlanResponse