{-# 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.PutBucketWebsite
(
putBucketWebsite
, PutBucketWebsite
, pbwContentMD5
, pbwBucket
, pbwWebsiteConfiguration
, putBucketWebsiteResponse
, PutBucketWebsiteResponse
) 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 PutBucketWebsite = PutBucketWebsite'
{ _pbwContentMD5 :: !(Maybe Text)
, _pbwBucket :: !BucketName
, _pbwWebsiteConfiguration :: !WebsiteConfiguration
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putBucketWebsite
:: BucketName
-> WebsiteConfiguration
-> PutBucketWebsite
putBucketWebsite pBucket_ pWebsiteConfiguration_ =
PutBucketWebsite'
{ _pbwContentMD5 = Nothing
, _pbwBucket = pBucket_
, _pbwWebsiteConfiguration = pWebsiteConfiguration_
}
pbwContentMD5 :: Lens' PutBucketWebsite (Maybe Text)
pbwContentMD5 = lens _pbwContentMD5 (\ s a -> s{_pbwContentMD5 = a})
pbwBucket :: Lens' PutBucketWebsite BucketName
pbwBucket = lens _pbwBucket (\ s a -> s{_pbwBucket = a})
pbwWebsiteConfiguration :: Lens' PutBucketWebsite WebsiteConfiguration
pbwWebsiteConfiguration = lens _pbwWebsiteConfiguration (\ s a -> s{_pbwWebsiteConfiguration = a})
instance AWSRequest PutBucketWebsite where
type Rs PutBucketWebsite = PutBucketWebsiteResponse
request = putXML s3
response = receiveNull PutBucketWebsiteResponse'
instance Hashable PutBucketWebsite where
instance NFData PutBucketWebsite where
instance ToElement PutBucketWebsite where
toElement
= mkElement
"{http://s3.amazonaws.com/doc/2006-03-01/}WebsiteConfiguration"
.
_pbwWebsiteConfiguration
instance ToHeaders PutBucketWebsite where
toHeaders PutBucketWebsite'{..}
= mconcat ["Content-MD5" =# _pbwContentMD5]
instance ToPath PutBucketWebsite where
toPath PutBucketWebsite'{..}
= mconcat ["/", toBS _pbwBucket]
instance ToQuery PutBucketWebsite where
toQuery = const (mconcat ["website"])
data PutBucketWebsiteResponse =
PutBucketWebsiteResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
putBucketWebsiteResponse
:: PutBucketWebsiteResponse
putBucketWebsiteResponse = PutBucketWebsiteResponse'
instance NFData PutBucketWebsiteResponse where