{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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' {$sel:frameworkName:DeleteFramework' :: Text
frameworkName = Text
pFrameworkName_}

-- | The unique name of a framework.
deleteFramework_frameworkName :: Lens.Lens' DeleteFramework Prelude.Text
deleteFramework_frameworkName :: Lens' DeleteFramework Text
deleteFramework_frameworkName = 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 :: (Service -> Service) -> DeleteFramework -> Request DeleteFramework
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteFramework
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteFramework)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteFrameworkResponse
DeleteFrameworkResponse'

instance Prelude.Hashable DeleteFramework where
  hashWithSalt :: Int -> DeleteFramework -> Int
hashWithSalt Int
_salt DeleteFramework' {Text
frameworkName :: Text
$sel:frameworkName:DeleteFramework' :: DeleteFramework -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
frameworkName

instance Prelude.NFData DeleteFramework where
  rnf :: DeleteFramework -> ()
rnf DeleteFramework' {Text
frameworkName :: Text
$sel:frameworkName:DeleteFramework' :: DeleteFramework -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
frameworkName

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

instance Data.ToPath DeleteFramework where
  toPath :: DeleteFramework -> ByteString
toPath DeleteFramework' {Text
frameworkName :: Text
$sel:frameworkName:DeleteFramework' :: DeleteFramework -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/audit/frameworks/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
frameworkName]

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

-- | /See:/ 'newDeleteFrameworkResponse' smart constructor.
data DeleteFrameworkResponse = DeleteFrameworkResponse'
  {
  }
  deriving (DeleteFrameworkResponse -> DeleteFrameworkResponse -> Bool
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]
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
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. 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 where
  rnf :: DeleteFrameworkResponse -> ()
rnf DeleteFrameworkResponse
_ = ()