module Network.AWS.S3.PutBucketCors
(
PutBucketCors
, putBucketCors
, pbcBucket
, pbcCORSConfiguration
, pbcContentMD5
, PutBucketCorsResponse
, putBucketCorsResponse
) where
import Network.AWS.Prelude
import Network.AWS.Request.S3
import Network.AWS.S3.Types
import qualified GHC.Exts
data PutBucketCors = PutBucketCors
{ _pbcBucket :: Text
, _pbcCORSConfiguration :: Maybe CORSConfiguration
, _pbcContentMD5 :: Maybe Text
} deriving (Eq, Show)
putBucketCors :: Text
-> PutBucketCors
putBucketCors p1 = PutBucketCors
{ _pbcBucket = p1
, _pbcCORSConfiguration = Nothing
, _pbcContentMD5 = Nothing
}
pbcBucket :: Lens' PutBucketCors Text
pbcBucket = lens _pbcBucket (\s a -> s { _pbcBucket = a })
pbcCORSConfiguration :: Lens' PutBucketCors (Maybe CORSConfiguration)
pbcCORSConfiguration =
lens _pbcCORSConfiguration (\s a -> s { _pbcCORSConfiguration = a })
pbcContentMD5 :: Lens' PutBucketCors (Maybe Text)
pbcContentMD5 = lens _pbcContentMD5 (\s a -> s { _pbcContentMD5 = a })
data PutBucketCorsResponse = PutBucketCorsResponse
deriving (Eq, Ord, Show, Generic)
putBucketCorsResponse :: PutBucketCorsResponse
putBucketCorsResponse = PutBucketCorsResponse
instance ToPath PutBucketCors where
toPath PutBucketCors{..} = mconcat
[ "/"
, toText _pbcBucket
]
instance ToQuery PutBucketCors where
toQuery = const "cors"
instance ToHeaders PutBucketCors where
toHeaders PutBucketCors{..} = mconcat
[ "Content-MD5" =: _pbcContentMD5
]
instance ToXMLRoot PutBucketCors where
toXMLRoot PutBucketCors{..} = namespaced ns "PutBucketCors"
[ "CORSConfiguration" =@ _pbcCORSConfiguration
]
instance ToXML PutBucketCors
instance AWSRequest PutBucketCors where
type Sv PutBucketCors = S3
type Rs PutBucketCors = PutBucketCorsResponse
request = put
response = nullResponse PutBucketCorsResponse