module Stratosphere.ResourceProperties.S3CorsConfigurationRule where
import Control.Lens
import Data.Aeson
import Data.Aeson.Types
import Data.Text
import GHC.Generics
import Stratosphere.Values
data S3CorsConfigurationRule =
S3CorsConfigurationRule
{ _s3CorsConfigurationRuleAllowedHeaders :: Maybe [Val Text]
, _s3CorsConfigurationRuleAllowedMethods :: [Val Text]
, _s3CorsConfigurationRuleAllowedOrigins :: [Val Text]
, _s3CorsConfigurationRuleExposedHeaders :: Maybe [Val Text]
, _s3CorsConfigurationRuleId :: Maybe (Val Text)
, _s3CorsConfigurationRuleMaxAge :: Maybe (Val Integer')
} deriving (Show, Generic)
instance ToJSON S3CorsConfigurationRule where
toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 24, omitNothingFields = True }
instance FromJSON S3CorsConfigurationRule where
parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 24, omitNothingFields = True }
s3CorsConfigurationRule
:: [Val Text]
-> [Val Text]
-> S3CorsConfigurationRule
s3CorsConfigurationRule allowedMethodsarg allowedOriginsarg =
S3CorsConfigurationRule
{ _s3CorsConfigurationRuleAllowedHeaders = Nothing
, _s3CorsConfigurationRuleAllowedMethods = allowedMethodsarg
, _s3CorsConfigurationRuleAllowedOrigins = allowedOriginsarg
, _s3CorsConfigurationRuleExposedHeaders = Nothing
, _s3CorsConfigurationRuleId = Nothing
, _s3CorsConfigurationRuleMaxAge = Nothing
}
sccrAllowedHeaders :: Lens' S3CorsConfigurationRule (Maybe [Val Text])
sccrAllowedHeaders = lens _s3CorsConfigurationRuleAllowedHeaders (\s a -> s { _s3CorsConfigurationRuleAllowedHeaders = a })
sccrAllowedMethods :: Lens' S3CorsConfigurationRule [Val Text]
sccrAllowedMethods = lens _s3CorsConfigurationRuleAllowedMethods (\s a -> s { _s3CorsConfigurationRuleAllowedMethods = a })
sccrAllowedOrigins :: Lens' S3CorsConfigurationRule [Val Text]
sccrAllowedOrigins = lens _s3CorsConfigurationRuleAllowedOrigins (\s a -> s { _s3CorsConfigurationRuleAllowedOrigins = a })
sccrExposedHeaders :: Lens' S3CorsConfigurationRule (Maybe [Val Text])
sccrExposedHeaders = lens _s3CorsConfigurationRuleExposedHeaders (\s a -> s { _s3CorsConfigurationRuleExposedHeaders = a })
sccrId :: Lens' S3CorsConfigurationRule (Maybe (Val Text))
sccrId = lens _s3CorsConfigurationRuleId (\s a -> s { _s3CorsConfigurationRuleId = a })
sccrMaxAge :: Lens' S3CorsConfigurationRule (Maybe (Val Integer'))
sccrMaxAge = lens _s3CorsConfigurationRuleMaxAge (\s a -> s { _s3CorsConfigurationRuleMaxAge = a })