{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- Module : Network.AWS.Glacier.DeleteVault -- Copyright : (c) 2013-2014 Brendan Hay -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or -- you can obtain it at http://mozilla.org/MPL/2.0/. -- Maintainer : Brendan Hay -- Stability : experimental -- Portability : non-portable (GHC extensions) -- -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | This operation deletes a vault. Amazon Glacier will delete a vault only if -- there are no archives in the vault as of the last inventory and there have -- been no writes to the vault since the last inventory. If either of these -- conditions is not satisfied, the vault deletion fails (that is, the vault is -- not removed) and Amazon Glacier returns an error. You can use 'DescribeVault' -- to return the number of archives in a vault, and you can use to initiate a new inventory retrieval for a vault. The inventory -- contains the archive IDs you use to delete archives using . -- -- This operation is idempotent. -- -- 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 . -- -- For conceptual information and underlying REST API, go to and in the /Amazon Glacier Developer Guide/. -- -- module Network.AWS.Glacier.DeleteVault ( -- * Request DeleteVault -- ** Request constructor , deleteVault -- ** Request lenses , dv1AccountId , dv1VaultName -- * Response , DeleteVaultResponse -- ** Response constructor , deleteVaultResponse ) where import Network.AWS.Data (Object) import Network.AWS.Prelude import Network.AWS.Request.RestJSON import Network.AWS.Glacier.Types import qualified GHC.Exts data DeleteVault = DeleteVault { _dv1AccountId :: Text , _dv1VaultName :: Text } deriving (Eq, Ord, Read, Show) -- | 'DeleteVault' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'dv1AccountId' @::@ 'Text' -- -- * 'dv1VaultName' @::@ 'Text' -- deleteVault :: Text -- ^ 'dv1AccountId' -> Text -- ^ 'dv1VaultName' -> DeleteVault deleteVault p1 p2 = DeleteVault { _dv1AccountId = p1 , _dv1VaultName = p2 } -- | 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 apos'-'apos -- (hyphen), in which case Amazon 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 (apos-apos) in the ID. dv1AccountId :: Lens' DeleteVault Text dv1AccountId = lens _dv1AccountId (\s a -> s { _dv1AccountId = a }) -- | The name of the vault. dv1VaultName :: Lens' DeleteVault Text dv1VaultName = lens _dv1VaultName (\s a -> s { _dv1VaultName = a }) data DeleteVaultResponse = DeleteVaultResponse deriving (Eq, Ord, Read, Show, Generic) -- | 'DeleteVaultResponse' constructor. deleteVaultResponse :: DeleteVaultResponse deleteVaultResponse = DeleteVaultResponse instance ToPath DeleteVault where toPath DeleteVault{..} = mconcat [ "/" , toText _dv1AccountId , "/vaults/" , toText _dv1VaultName ] instance ToQuery DeleteVault where toQuery = const mempty instance ToHeaders DeleteVault instance ToJSON DeleteVault where toJSON = const (toJSON Empty) instance AWSRequest DeleteVault where type Sv DeleteVault = Glacier type Rs DeleteVault = DeleteVaultResponse request = delete response = nullResponse DeleteVaultResponse