{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.S3.PutBucketTagging
(
putBucketTagging
, PutBucketTagging
, pbtContentMD5
, pbtBucket
, pbtTagging
, putBucketTaggingResponse
, PutBucketTaggingResponse
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.S3.Types
import Network.AWS.S3.Types.Product
data PutBucketTagging = PutBucketTagging'
{ _pbtContentMD5 :: !(Maybe Text)
, _pbtBucket :: !BucketName
, _pbtTagging :: !Tagging
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putBucketTagging
:: BucketName
-> Tagging
-> PutBucketTagging
putBucketTagging pBucket_ pTagging_ =
PutBucketTagging'
{_pbtContentMD5 = Nothing, _pbtBucket = pBucket_, _pbtTagging = pTagging_}
pbtContentMD5 :: Lens' PutBucketTagging (Maybe Text)
pbtContentMD5 = lens _pbtContentMD5 (\ s a -> s{_pbtContentMD5 = a})
pbtBucket :: Lens' PutBucketTagging BucketName
pbtBucket = lens _pbtBucket (\ s a -> s{_pbtBucket = a})
pbtTagging :: Lens' PutBucketTagging Tagging
pbtTagging = lens _pbtTagging (\ s a -> s{_pbtTagging = a})
instance AWSRequest PutBucketTagging where
type Rs PutBucketTagging = PutBucketTaggingResponse
request = contentMD5Header . putXML s3
response = receiveNull PutBucketTaggingResponse'
instance Hashable PutBucketTagging where
instance NFData PutBucketTagging where
instance ToElement PutBucketTagging where
toElement
= mkElement
"{http://s3.amazonaws.com/doc/2006-03-01/}Tagging"
.
_pbtTagging
instance ToHeaders PutBucketTagging where
toHeaders PutBucketTagging'{..}
= mconcat ["Content-MD5" =# _pbtContentMD5]
instance ToPath PutBucketTagging where
toPath PutBucketTagging'{..}
= mconcat ["/", toBS _pbtBucket]
instance ToQuery PutBucketTagging where
toQuery = const (mconcat ["tagging"])
data PutBucketTaggingResponse =
PutBucketTaggingResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
putBucketTaggingResponse
:: PutBucketTaggingResponse
putBucketTaggingResponse = PutBucketTaggingResponse'
instance NFData PutBucketTaggingResponse where