{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Resource.Storage.Buckets.Delete
(
BucketsDeleteResource
, bucketsDelete
, BucketsDelete
, bdIfMetagenerationMatch
, bdBucket
, bdIfMetagenerationNotMatch
) where
import Network.Google.Prelude
import Network.Google.Storage.Types
type BucketsDeleteResource =
"storage" :>
"v1" :>
"b" :>
Capture "bucket" Text :>
QueryParam "ifMetagenerationMatch" (Textual Int64) :>
QueryParam "ifMetagenerationNotMatch" (Textual Int64)
:> QueryParam "alt" AltJSON :> Delete '[JSON] ()
-- | Permanently deletes an empty bucket.
--
-- /See:/ 'bucketsDelete' smart constructor.
data BucketsDelete = BucketsDelete'
{ _bdIfMetagenerationMatch :: !(Maybe (Textual Int64))
, _bdBucket :: !Text
, _bdIfMetagenerationNotMatch :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'BucketsDelete' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'bdIfMetagenerationMatch'
--
-- * 'bdBucket'
--
-- * 'bdIfMetagenerationNotMatch'
bucketsDelete
:: Text -- ^ 'bdBucket'
-> BucketsDelete
bucketsDelete pBdBucket_ =
BucketsDelete'
{ _bdIfMetagenerationMatch = Nothing
, _bdBucket = pBdBucket_
, _bdIfMetagenerationNotMatch = Nothing
}
-- | If set, only deletes the bucket if its metageneration matches this
-- value.
bdIfMetagenerationMatch :: Lens' BucketsDelete (Maybe Int64)
bdIfMetagenerationMatch
= lens _bdIfMetagenerationMatch
(\ s a -> s{_bdIfMetagenerationMatch = a})
. mapping _Coerce
-- | Name of a bucket.
bdBucket :: Lens' BucketsDelete Text
bdBucket = lens _bdBucket (\ s a -> s{_bdBucket = a})
-- | If set, only deletes the bucket if its metageneration does not match
-- this value.
bdIfMetagenerationNotMatch :: Lens' BucketsDelete (Maybe Int64)
bdIfMetagenerationNotMatch
= lens _bdIfMetagenerationNotMatch
(\ s a -> s{_bdIfMetagenerationNotMatch = a})
. mapping _Coerce
instance GoogleRequest BucketsDelete where
type Rs BucketsDelete = ()
type Scopes BucketsDelete =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/devstorage.read_write"]
requestClient BucketsDelete'{..}
= go _bdBucket _bdIfMetagenerationMatch
_bdIfMetagenerationNotMatch
(Just AltJSON)
storageService
where go
= buildClient (Proxy :: Proxy BucketsDeleteResource)
mempty