{-# 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.DeleteBackupVaultLockConfiguration
-- 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 Backup Vault Lock from a backup vault specified by a backup
-- vault name.
--
-- If the Vault Lock configuration is immutable, then you cannot delete
-- Vault Lock using API operations, and you will receive an
-- @InvalidRequestException@ if you attempt to do so. For more information,
-- see
-- <https://docs.aws.amazon.com/aws-backup/latest/devguide/vault-lock.html Vault Lock>
-- in the /Backup Developer Guide/.
module Amazonka.Backup.DeleteBackupVaultLockConfiguration
  ( -- * Creating a Request
    DeleteBackupVaultLockConfiguration (..),
    newDeleteBackupVaultLockConfiguration,

    -- * Request Lenses
    deleteBackupVaultLockConfiguration_backupVaultName,

    -- * Destructuring the Response
    DeleteBackupVaultLockConfigurationResponse (..),
    newDeleteBackupVaultLockConfigurationResponse,
  )
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:/ 'newDeleteBackupVaultLockConfiguration' smart constructor.
data DeleteBackupVaultLockConfiguration = DeleteBackupVaultLockConfiguration'
  { -- | The name of the backup vault from which to delete Backup Vault Lock.
    DeleteBackupVaultLockConfiguration -> Text
backupVaultName :: Prelude.Text
  }
  deriving (DeleteBackupVaultLockConfiguration
-> DeleteBackupVaultLockConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteBackupVaultLockConfiguration
-> DeleteBackupVaultLockConfiguration -> Bool
$c/= :: DeleteBackupVaultLockConfiguration
-> DeleteBackupVaultLockConfiguration -> Bool
== :: DeleteBackupVaultLockConfiguration
-> DeleteBackupVaultLockConfiguration -> Bool
$c== :: DeleteBackupVaultLockConfiguration
-> DeleteBackupVaultLockConfiguration -> Bool
Prelude.Eq, ReadPrec [DeleteBackupVaultLockConfiguration]
ReadPrec DeleteBackupVaultLockConfiguration
Int -> ReadS DeleteBackupVaultLockConfiguration
ReadS [DeleteBackupVaultLockConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteBackupVaultLockConfiguration]
$creadListPrec :: ReadPrec [DeleteBackupVaultLockConfiguration]
readPrec :: ReadPrec DeleteBackupVaultLockConfiguration
$creadPrec :: ReadPrec DeleteBackupVaultLockConfiguration
readList :: ReadS [DeleteBackupVaultLockConfiguration]
$creadList :: ReadS [DeleteBackupVaultLockConfiguration]
readsPrec :: Int -> ReadS DeleteBackupVaultLockConfiguration
$creadsPrec :: Int -> ReadS DeleteBackupVaultLockConfiguration
Prelude.Read, Int -> DeleteBackupVaultLockConfiguration -> ShowS
[DeleteBackupVaultLockConfiguration] -> ShowS
DeleteBackupVaultLockConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBackupVaultLockConfiguration] -> ShowS
$cshowList :: [DeleteBackupVaultLockConfiguration] -> ShowS
show :: DeleteBackupVaultLockConfiguration -> String
$cshow :: DeleteBackupVaultLockConfiguration -> String
showsPrec :: Int -> DeleteBackupVaultLockConfiguration -> ShowS
$cshowsPrec :: Int -> DeleteBackupVaultLockConfiguration -> ShowS
Prelude.Show, forall x.
Rep DeleteBackupVaultLockConfiguration x
-> DeleteBackupVaultLockConfiguration
forall x.
DeleteBackupVaultLockConfiguration
-> Rep DeleteBackupVaultLockConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteBackupVaultLockConfiguration x
-> DeleteBackupVaultLockConfiguration
$cfrom :: forall x.
DeleteBackupVaultLockConfiguration
-> Rep DeleteBackupVaultLockConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DeleteBackupVaultLockConfiguration' 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:
--
-- 'backupVaultName', 'deleteBackupVaultLockConfiguration_backupVaultName' - The name of the backup vault from which to delete Backup Vault Lock.
newDeleteBackupVaultLockConfiguration ::
  -- | 'backupVaultName'
  Prelude.Text ->
  DeleteBackupVaultLockConfiguration
newDeleteBackupVaultLockConfiguration :: Text -> DeleteBackupVaultLockConfiguration
newDeleteBackupVaultLockConfiguration
  Text
pBackupVaultName_ =
    DeleteBackupVaultLockConfiguration'
      { $sel:backupVaultName:DeleteBackupVaultLockConfiguration' :: Text
backupVaultName =
          Text
pBackupVaultName_
      }

-- | The name of the backup vault from which to delete Backup Vault Lock.
deleteBackupVaultLockConfiguration_backupVaultName :: Lens.Lens' DeleteBackupVaultLockConfiguration Prelude.Text
deleteBackupVaultLockConfiguration_backupVaultName :: Lens' DeleteBackupVaultLockConfiguration Text
deleteBackupVaultLockConfiguration_backupVaultName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBackupVaultLockConfiguration' {Text
backupVaultName :: Text
$sel:backupVaultName:DeleteBackupVaultLockConfiguration' :: DeleteBackupVaultLockConfiguration -> Text
backupVaultName} -> Text
backupVaultName) (\s :: DeleteBackupVaultLockConfiguration
s@DeleteBackupVaultLockConfiguration' {} Text
a -> DeleteBackupVaultLockConfiguration
s {$sel:backupVaultName:DeleteBackupVaultLockConfiguration' :: Text
backupVaultName = Text
a} :: DeleteBackupVaultLockConfiguration)

instance
  Core.AWSRequest
    DeleteBackupVaultLockConfiguration
  where
  type
    AWSResponse DeleteBackupVaultLockConfiguration =
      DeleteBackupVaultLockConfigurationResponse
  request :: (Service -> Service)
-> DeleteBackupVaultLockConfiguration
-> Request DeleteBackupVaultLockConfiguration
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 DeleteBackupVaultLockConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteBackupVaultLockConfiguration)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      DeleteBackupVaultLockConfigurationResponse
DeleteBackupVaultLockConfigurationResponse'

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

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

instance
  Data.ToHeaders
    DeleteBackupVaultLockConfiguration
  where
  toHeaders :: DeleteBackupVaultLockConfiguration -> [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
    DeleteBackupVaultLockConfiguration
  where
  toPath :: DeleteBackupVaultLockConfiguration -> ByteString
toPath DeleteBackupVaultLockConfiguration' {Text
backupVaultName :: Text
$sel:backupVaultName:DeleteBackupVaultLockConfiguration' :: DeleteBackupVaultLockConfiguration -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/backup-vaults/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
backupVaultName,
        ByteString
"/vault-lock"
      ]

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

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

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

instance
  Prelude.NFData
    DeleteBackupVaultLockConfigurationResponse
  where
  rnf :: DeleteBackupVaultLockConfigurationResponse -> ()
rnf DeleteBackupVaultLockConfigurationResponse
_ = ()