{-# 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-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)
--
-- 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 Amazonka.Glacier.Types
import qualified Amazonka.Lens as Lens
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
(DeleteVaultNotifications -> DeleteVaultNotifications -> Bool)
-> (DeleteVaultNotifications -> DeleteVaultNotifications -> Bool)
-> Eq DeleteVaultNotifications
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]
(Int -> ReadS DeleteVaultNotifications)
-> ReadS [DeleteVaultNotifications]
-> ReadPrec DeleteVaultNotifications
-> ReadPrec [DeleteVaultNotifications]
-> Read 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
(Int -> DeleteVaultNotifications -> ShowS)
-> (DeleteVaultNotifications -> String)
-> ([DeleteVaultNotifications] -> ShowS)
-> Show DeleteVaultNotifications
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.
 DeleteVaultNotifications -> Rep DeleteVaultNotifications x)
-> (forall x.
    Rep DeleteVaultNotifications x -> DeleteVaultNotifications)
-> Generic DeleteVaultNotifications
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' :: Text -> Text -> DeleteVaultNotifications
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 :: (Text -> f Text)
-> DeleteVaultNotifications -> f DeleteVaultNotifications
deleteVaultNotifications_accountId = (DeleteVaultNotifications -> Text)
-> (DeleteVaultNotifications -> Text -> DeleteVaultNotifications)
-> Lens DeleteVaultNotifications DeleteVaultNotifications Text Text
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 :: (Text -> f Text)
-> DeleteVaultNotifications -> f DeleteVaultNotifications
deleteVaultNotifications_vaultName = (DeleteVaultNotifications -> Text)
-> (DeleteVaultNotifications -> Text -> DeleteVaultNotifications)
-> Lens DeleteVaultNotifications DeleteVaultNotifications Text Text
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 :: DeleteVaultNotifications -> Request DeleteVaultNotifications
request =
    ByteString
-> Request DeleteVaultNotifications
-> Request DeleteVaultNotifications
forall a. ByteString -> Request a -> Request a
Request.glacierVersionHeader (Service -> ByteString
Core._serviceVersion Service
defaultService)
      (Request DeleteVaultNotifications
 -> Request DeleteVaultNotifications)
-> (DeleteVaultNotifications -> Request DeleteVaultNotifications)
-> DeleteVaultNotifications
-> Request DeleteVaultNotifications
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service
-> DeleteVaultNotifications -> Request DeleteVaultNotifications
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteVaultNotifications
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteVaultNotifications)))
response =
    AWSResponse DeleteVaultNotifications
-> Logger
-> Service
-> Proxy DeleteVaultNotifications
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteVaultNotifications)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeleteVaultNotifications
DeleteVaultNotificationsResponse
DeleteVaultNotificationsResponse'

instance Prelude.Hashable DeleteVaultNotifications

instance Prelude.NFData DeleteVaultNotifications

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

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

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

-- | /See:/ 'newDeleteVaultNotificationsResponse' smart constructor.
data DeleteVaultNotificationsResponse = DeleteVaultNotificationsResponse'
  {
  }
  deriving (DeleteVaultNotificationsResponse
-> DeleteVaultNotificationsResponse -> Bool
(DeleteVaultNotificationsResponse
 -> DeleteVaultNotificationsResponse -> Bool)
-> (DeleteVaultNotificationsResponse
    -> DeleteVaultNotificationsResponse -> Bool)
-> Eq DeleteVaultNotificationsResponse
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]
(Int -> ReadS DeleteVaultNotificationsResponse)
-> ReadS [DeleteVaultNotificationsResponse]
-> ReadPrec DeleteVaultNotificationsResponse
-> ReadPrec [DeleteVaultNotificationsResponse]
-> Read 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
(Int -> DeleteVaultNotificationsResponse -> ShowS)
-> (DeleteVaultNotificationsResponse -> String)
-> ([DeleteVaultNotificationsResponse] -> ShowS)
-> Show DeleteVaultNotificationsResponse
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.
 DeleteVaultNotificationsResponse
 -> Rep DeleteVaultNotificationsResponse x)
-> (forall x.
    Rep DeleteVaultNotificationsResponse x
    -> DeleteVaultNotificationsResponse)
-> Generic DeleteVaultNotificationsResponse
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