module Stratosphere.ResourceProperties.AccessLoggingPolicy where
import Control.Lens
import Data.Aeson
import Data.Aeson.Types
import Data.Text
import GHC.Generics
import Stratosphere.Values
data AccessLoggingPolicy =
AccessLoggingPolicy
{ _accessLoggingPolicyEmitInterval :: Maybe (Val Integer')
, _accessLoggingPolicyEnabled :: Val Bool'
, _accessLoggingPolicyS3BucketName :: Val Text
, _accessLoggingPolicyS3BucketPrefix :: Maybe (Val Text)
} deriving (Show, Generic)
instance ToJSON AccessLoggingPolicy where
toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 20, omitNothingFields = True }
instance FromJSON AccessLoggingPolicy where
parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 20, omitNothingFields = True }
accessLoggingPolicy
:: Val Bool'
-> Val Text
-> AccessLoggingPolicy
accessLoggingPolicy enabledarg s3BucketNamearg =
AccessLoggingPolicy
{ _accessLoggingPolicyEmitInterval = Nothing
, _accessLoggingPolicyEnabled = enabledarg
, _accessLoggingPolicyS3BucketName = s3BucketNamearg
, _accessLoggingPolicyS3BucketPrefix = Nothing
}
alpEmitInterval :: Lens' AccessLoggingPolicy (Maybe (Val Integer'))
alpEmitInterval = lens _accessLoggingPolicyEmitInterval (\s a -> s { _accessLoggingPolicyEmitInterval = a })
alpEnabled :: Lens' AccessLoggingPolicy (Val Bool')
alpEnabled = lens _accessLoggingPolicyEnabled (\s a -> s { _accessLoggingPolicyEnabled = a })
alpS3BucketName :: Lens' AccessLoggingPolicy (Val Text)
alpS3BucketName = lens _accessLoggingPolicyS3BucketName (\s a -> s { _accessLoggingPolicyS3BucketName = a })
alpS3BucketPrefix :: Lens' AccessLoggingPolicy (Maybe (Val Text))
alpS3BucketPrefix = lens _accessLoggingPolicyS3BucketPrefix (\s a -> s { _accessLoggingPolicyS3BucketPrefix = a })