{-# 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.DeleteFramework
-- 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 framework specified by a framework name.
module Amazonka.Backup.DeleteFramework
  ( -- * Creating a Request
    DeleteFramework (..),
    newDeleteFramework,

    -- * Request Lenses
    deleteFramework_frameworkName,

    -- * Destructuring the Response
    DeleteFrameworkResponse (..),
    newDeleteFrameworkResponse,
  )
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:/ 'newDeleteFramework' smart constructor.
data DeleteFramework = DeleteFramework'
  { -- | The unique name of a framework.
    DeleteFramework -> Text
frameworkName :: Prelude.Text
  }
  deriving (DeleteFramework -> DeleteFramework -> Bool
(DeleteFramework -> DeleteFramework -> Bool)
-> (DeleteFramework -> DeleteFramework -> Bool)
-> Eq DeleteFramework
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFramework -> DeleteFramework -> Bool
$c/= :: DeleteFramework -> DeleteFramework -> Bool
== :: DeleteFramework -> DeleteFramework -> Bool
$c== :: DeleteFramework -> DeleteFramework -> Bool
Prelude.Eq, ReadPrec [DeleteFramework]
ReadPrec DeleteFramework
Int -> ReadS DeleteFramework
ReadS [DeleteFramework]
(Int -> ReadS DeleteFramework)
-> ReadS [DeleteFramework]
-> ReadPrec DeleteFramework
-> ReadPrec [DeleteFramework]
-> Read DeleteFramework
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFramework]
$creadListPrec :: ReadPrec [DeleteFramework]
readPrec :: ReadPrec DeleteFramework
$creadPrec :: ReadPrec DeleteFramework
readList :: ReadS [DeleteFramework]
$creadList :: ReadS [DeleteFramework]
readsPrec :: Int -> ReadS DeleteFramework
$creadsPrec :: Int -> ReadS DeleteFramework
Prelude.Read, Int -> DeleteFramework -> ShowS
[DeleteFramework] -> ShowS
DeleteFramework -> String
(Int -> DeleteFramework -> ShowS)
-> (DeleteFramework -> String)
-> ([DeleteFramework] -> ShowS)
-> Show DeleteFramework
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFramework] -> ShowS
$cshowList :: [DeleteFramework] -> ShowS
show :: DeleteFramework -> String
$cshow :: DeleteFramework -> String
showsPrec :: Int -> DeleteFramework -> ShowS
$cshowsPrec :: Int -> DeleteFramework -> ShowS
Prelude.Show, (forall x. DeleteFramework -> Rep DeleteFramework x)
-> (forall x. Rep DeleteFramework x -> DeleteFramework)
-> Generic DeleteFramework
forall x. Rep DeleteFramework x -> DeleteFramework
forall x. DeleteFramework -> Rep DeleteFramework x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteFramework x -> DeleteFramework
$cfrom :: forall x. DeleteFramework -> Rep DeleteFramework x
Prelude.Generic)

-- |
-- Create a value of 'DeleteFramework' 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:
--
-- 'frameworkName', 'deleteFramework_frameworkName' - The unique name of a framework.
newDeleteFramework ::
  -- | 'frameworkName'
  Prelude.Text ->
  DeleteFramework
newDeleteFramework :: Text -> DeleteFramework
newDeleteFramework Text
pFrameworkName_ =
  DeleteFramework' :: Text -> DeleteFramework
DeleteFramework' {$sel:frameworkName:DeleteFramework' :: Text
frameworkName = Text
pFrameworkName_}

-- | The unique name of a framework.
deleteFramework_frameworkName :: Lens.Lens' DeleteFramework Prelude.Text
deleteFramework_frameworkName :: (Text -> f Text) -> DeleteFramework -> f DeleteFramework
deleteFramework_frameworkName = (DeleteFramework -> Text)
-> (DeleteFramework -> Text -> DeleteFramework)
-> Lens DeleteFramework DeleteFramework Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFramework' {Text
frameworkName :: Text
$sel:frameworkName:DeleteFramework' :: DeleteFramework -> Text
frameworkName} -> Text
frameworkName) (\s :: DeleteFramework
s@DeleteFramework' {} Text
a -> DeleteFramework
s {$sel:frameworkName:DeleteFramework' :: Text
frameworkName = Text
a} :: DeleteFramework)

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

instance Prelude.Hashable DeleteFramework

instance Prelude.NFData DeleteFramework

instance Core.ToHeaders DeleteFramework where
  toHeaders :: DeleteFramework -> [Header]
toHeaders =
    [Header] -> DeleteFramework -> [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 DeleteFramework where
  toPath :: DeleteFramework -> ByteString
toPath DeleteFramework' {Text
frameworkName :: Text
$sel:frameworkName:DeleteFramework' :: DeleteFramework -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/audit/frameworks/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
frameworkName]

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

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

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

instance Prelude.NFData DeleteFrameworkResponse