module Network.AWS.S3.PutBucketNotification
(
PutBucketNotification
, putBucketNotification
, pbnBucket
, pbnContentMD5
, pbnNotificationConfiguration
, PutBucketNotificationResponse
, putBucketNotificationResponse
) where
import Network.AWS.Prelude
import Network.AWS.Request.S3
import Network.AWS.S3.Types
import qualified GHC.Exts
data PutBucketNotification = PutBucketNotification
{ _pbnBucket :: Text
, _pbnContentMD5 :: Maybe Text
, _pbnNotificationConfiguration :: NotificationConfiguration
} deriving (Eq, Show)
putBucketNotification :: Text
-> NotificationConfiguration
-> PutBucketNotification
putBucketNotification p1 p2 = PutBucketNotification
{ _pbnBucket = p1
, _pbnNotificationConfiguration = p2
, _pbnContentMD5 = Nothing
}
pbnBucket :: Lens' PutBucketNotification Text
pbnBucket = lens _pbnBucket (\s a -> s { _pbnBucket = a })
pbnContentMD5 :: Lens' PutBucketNotification (Maybe Text)
pbnContentMD5 = lens _pbnContentMD5 (\s a -> s { _pbnContentMD5 = a })
pbnNotificationConfiguration :: Lens' PutBucketNotification NotificationConfiguration
pbnNotificationConfiguration =
lens _pbnNotificationConfiguration
(\s a -> s { _pbnNotificationConfiguration = a })
data PutBucketNotificationResponse = PutBucketNotificationResponse
deriving (Eq, Ord, Show, Generic)
putBucketNotificationResponse :: PutBucketNotificationResponse
putBucketNotificationResponse = PutBucketNotificationResponse
instance ToPath PutBucketNotification where
toPath PutBucketNotification{..} = mconcat
[ "/"
, toText _pbnBucket
]
instance ToQuery PutBucketNotification where
toQuery = const "notification"
instance ToHeaders PutBucketNotification where
toHeaders PutBucketNotification{..} = mconcat
[ "Content-MD5" =: _pbnContentMD5
]
instance ToXMLRoot PutBucketNotification where
toXMLRoot PutBucketNotification{..} = namespaced ns "PutBucketNotification"
[ "NotificationConfiguration" =@ _pbnNotificationConfiguration
]
instance ToXML PutBucketNotification
instance AWSRequest PutBucketNotification where
type Sv PutBucketNotification = S3
type Rs PutBucketNotification = PutBucketNotificationResponse
request = put
response = nullResponse PutBucketNotificationResponse