{-# 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.Glacier.DeleteVaultNotifications
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- This operation deletes the notification configuration set for a vault.
-- The operation is eventually consistent; that is, it might take some time
-- for Amazon S3 Glacier to completely disable the notifications and you
-- might still receive some notifications for a short time after you send
-- the delete request.
--
-- An AWS account has full permission to perform all operations (actions).
-- However, AWS Identity and Access Management (IAM) users don\'t have any
-- permissions by default. You must grant them explicit permission to
-- perform specific actions. For more information, see
-- <https://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identity and Access Management (IAM)>.
--
-- For conceptual information and underlying REST API, see
-- <https://docs.aws.amazon.com/amazonglacier/latest/dev/configuring-notifications.html Configuring Vault Notifications in Amazon S3 Glacier>
-- and
-- <https://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-notifications-delete.html Delete Vault Notification Configuration>
-- in the Amazon S3 Glacier Developer Guide.
module Amazonka.Glacier.DeleteVaultNotifications
  ( -- * Creating a Request
    DeleteVaultNotifications (..),
    newDeleteVaultNotifications,

    -- * Request Lenses
    deleteVaultNotifications_accountId,
    deleteVaultNotifications_vaultName,

    -- * Destructuring the Response
    DeleteVaultNotificationsResponse (..),
    newDeleteVaultNotificationsResponse,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glacier.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Provides options for deleting a vault notification configuration from an
-- Amazon Glacier vault.
--
-- /See:/ 'newDeleteVaultNotifications' smart constructor.
data DeleteVaultNotifications = DeleteVaultNotifications'
  { -- | The @AccountId@ value is the AWS account ID of the account that owns the
    -- vault. You can either specify an AWS account ID or optionally a single
    -- \'@-@\' (hyphen), in which case Amazon S3 Glacier uses the AWS account
    -- ID associated with the credentials used to sign the request. If you use
    -- an account ID, do not include any hyphens (\'-\') in the ID.
    DeleteVaultNotifications -> Text
accountId :: Prelude.Text,
    -- | The name of the vault.
    DeleteVaultNotifications -> Text
vaultName :: Prelude.Text
  }
  deriving (DeleteVaultNotifications -> DeleteVaultNotifications -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteVaultNotifications -> DeleteVaultNotifications -> Bool
$c/= :: DeleteVaultNotifications -> DeleteVaultNotifications -> Bool
== :: DeleteVaultNotifications -> DeleteVaultNotifications -> Bool
$c== :: DeleteVaultNotifications -> DeleteVaultNotifications -> Bool
Prelude.Eq, ReadPrec [DeleteVaultNotifications]
ReadPrec DeleteVaultNotifications
Int -> ReadS DeleteVaultNotifications
ReadS [DeleteVaultNotifications]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteVaultNotifications]
$creadListPrec :: ReadPrec [DeleteVaultNotifications]
readPrec :: ReadPrec DeleteVaultNotifications
$creadPrec :: ReadPrec DeleteVaultNotifications
readList :: ReadS [DeleteVaultNotifications]
$creadList :: ReadS [DeleteVaultNotifications]
readsPrec :: Int -> ReadS DeleteVaultNotifications
$creadsPrec :: Int -> ReadS DeleteVaultNotifications
Prelude.Read, Int -> DeleteVaultNotifications -> ShowS
[DeleteVaultNotifications] -> ShowS
DeleteVaultNotifications -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteVaultNotifications] -> ShowS
$cshowList :: [DeleteVaultNotifications] -> ShowS
show :: DeleteVaultNotifications -> String
$cshow :: DeleteVaultNotifications -> String
showsPrec :: Int -> DeleteVaultNotifications -> ShowS
$cshowsPrec :: Int -> DeleteVaultNotifications -> ShowS
Prelude.Show, forall x.
Rep DeleteVaultNotifications x -> DeleteVaultNotifications
forall x.
DeleteVaultNotifications -> Rep DeleteVaultNotifications x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteVaultNotifications x -> DeleteVaultNotifications
$cfrom :: forall x.
DeleteVaultNotifications -> Rep DeleteVaultNotifications x
Prelude.Generic)

-- |
-- Create a value of 'DeleteVaultNotifications' 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:
--
-- 'accountId', 'deleteVaultNotifications_accountId' - The @AccountId@ value is the AWS account ID of the account that owns the
-- vault. You can either specify an AWS account ID or optionally a single
-- \'@-@\' (hyphen), in which case Amazon S3 Glacier uses the AWS account
-- ID associated with the credentials used to sign the request. If you use
-- an account ID, do not include any hyphens (\'-\') in the ID.
--
-- 'vaultName', 'deleteVaultNotifications_vaultName' - The name of the vault.
newDeleteVaultNotifications ::
  -- | 'accountId'
  Prelude.Text ->
  -- | 'vaultName'
  Prelude.Text ->
  DeleteVaultNotifications
newDeleteVaultNotifications :: Text -> Text -> DeleteVaultNotifications
newDeleteVaultNotifications Text
pAccountId_ Text
pVaultName_ =
  DeleteVaultNotifications'
    { $sel:accountId:DeleteVaultNotifications' :: Text
accountId = Text
pAccountId_,
      $sel:vaultName:DeleteVaultNotifications' :: Text
vaultName = Text
pVaultName_
    }

-- | The @AccountId@ value is the AWS account ID of the account that owns the
-- vault. You can either specify an AWS account ID or optionally a single
-- \'@-@\' (hyphen), in which case Amazon S3 Glacier uses the AWS account
-- ID associated with the credentials used to sign the request. If you use
-- an account ID, do not include any hyphens (\'-\') in the ID.
deleteVaultNotifications_accountId :: Lens.Lens' DeleteVaultNotifications Prelude.Text
deleteVaultNotifications_accountId :: Lens' DeleteVaultNotifications Text
deleteVaultNotifications_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVaultNotifications' {Text
accountId :: Text
$sel:accountId:DeleteVaultNotifications' :: DeleteVaultNotifications -> Text
accountId} -> Text
accountId) (\s :: DeleteVaultNotifications
s@DeleteVaultNotifications' {} Text
a -> DeleteVaultNotifications
s {$sel:accountId:DeleteVaultNotifications' :: Text
accountId = Text
a} :: DeleteVaultNotifications)

-- | The name of the vault.
deleteVaultNotifications_vaultName :: Lens.Lens' DeleteVaultNotifications Prelude.Text
deleteVaultNotifications_vaultName :: Lens' DeleteVaultNotifications Text
deleteVaultNotifications_vaultName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVaultNotifications' {Text
vaultName :: Text
$sel:vaultName:DeleteVaultNotifications' :: DeleteVaultNotifications -> Text
vaultName} -> Text
vaultName) (\s :: DeleteVaultNotifications
s@DeleteVaultNotifications' {} Text
a -> DeleteVaultNotifications
s {$sel:vaultName:DeleteVaultNotifications' :: Text
vaultName = Text
a} :: DeleteVaultNotifications)

instance Core.AWSRequest DeleteVaultNotifications where
  type
    AWSResponse DeleteVaultNotifications =
      DeleteVaultNotificationsResponse
  request :: (Service -> Service)
-> DeleteVaultNotifications -> Request DeleteVaultNotifications
request Service -> Service
overrides =
    forall a. ByteString -> Request a -> Request a
Request.glacierVersionHeader (Service -> ByteString
Core.version Service
defaultService)
      forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 DeleteVaultNotifications
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteVaultNotifications)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      DeleteVaultNotificationsResponse
DeleteVaultNotificationsResponse'

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

instance Prelude.NFData DeleteVaultNotifications where
  rnf :: DeleteVaultNotifications -> ()
rnf DeleteVaultNotifications' {Text
vaultName :: Text
accountId :: Text
$sel:vaultName:DeleteVaultNotifications' :: DeleteVaultNotifications -> Text
$sel:accountId:DeleteVaultNotifications' :: DeleteVaultNotifications -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
accountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
vaultName

instance Data.ToHeaders DeleteVaultNotifications where
  toHeaders :: DeleteVaultNotifications -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath DeleteVaultNotifications where
  toPath :: DeleteVaultNotifications -> ByteString
toPath DeleteVaultNotifications' {Text
vaultName :: Text
accountId :: Text
$sel:vaultName:DeleteVaultNotifications' :: DeleteVaultNotifications -> Text
$sel:accountId:DeleteVaultNotifications' :: DeleteVaultNotifications -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
accountId,
        ByteString
"/vaults/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
vaultName,
        ByteString
"/notification-configuration"
      ]

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

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

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

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