module Network.AWS.S3.GetBucketCors
(
GetBucketCors
, getBucketCors
, gbcBucket
, GetBucketCorsResponse
, getBucketCorsResponse
, gbcrCORSRules
) where
import Network.AWS.Prelude
import Network.AWS.Request.S3
import Network.AWS.S3.Types
import qualified GHC.Exts
newtype GetBucketCors = GetBucketCors
{ _gbcBucket :: Text
} deriving (Eq, Ord, Show, Monoid, IsString)
getBucketCors :: Text
-> GetBucketCors
getBucketCors p1 = GetBucketCors
{ _gbcBucket = p1
}
gbcBucket :: Lens' GetBucketCors Text
gbcBucket = lens _gbcBucket (\s a -> s { _gbcBucket = a })
newtype GetBucketCorsResponse = GetBucketCorsResponse
{ _gbcrCORSRules :: List "CORSRule" CORSRule
} deriving (Eq, Show, Monoid, Semigroup)
getBucketCorsResponse :: GetBucketCorsResponse
getBucketCorsResponse = GetBucketCorsResponse
{ _gbcrCORSRules = mempty
}
gbcrCORSRules :: Lens' GetBucketCorsResponse [CORSRule]
gbcrCORSRules = lens _gbcrCORSRules (\s a -> s { _gbcrCORSRules = a }) . _List
instance ToPath GetBucketCors where
toPath GetBucketCors{..} = mconcat
[ "/"
, toText _gbcBucket
]
instance ToQuery GetBucketCors where
toQuery = const "cors"
instance ToHeaders GetBucketCors
instance ToXMLRoot GetBucketCors where
toXMLRoot = const (namespaced ns "GetBucketCors" [])
instance ToXML GetBucketCors
instance AWSRequest GetBucketCors where
type Sv GetBucketCors = S3
type Rs GetBucketCors = GetBucketCorsResponse
request = get
response = xmlResponse
instance FromXML GetBucketCorsResponse where
parseXML x = GetBucketCorsResponse
<$> parseXML x