module Stratosphere.S3.Bucket.LoggingConfigurationProperty (
        module Exports, LoggingConfigurationProperty(..),
        mkLoggingConfigurationProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.S3.Bucket.TargetObjectKeyFormatProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data LoggingConfigurationProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-loggingconfiguration.html>
    LoggingConfigurationProperty {LoggingConfigurationProperty -> ()
haddock_workaround_ :: (),
                                  -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-loggingconfiguration.html#cfn-s3-bucket-loggingconfiguration-destinationbucketname>
                                  LoggingConfigurationProperty -> Maybe (Value Text)
destinationBucketName :: (Prelude.Maybe (Value Prelude.Text)),
                                  -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-loggingconfiguration.html#cfn-s3-bucket-loggingconfiguration-logfileprefix>
                                  LoggingConfigurationProperty -> Maybe (Value Text)
logFilePrefix :: (Prelude.Maybe (Value Prelude.Text)),
                                  -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-loggingconfiguration.html#cfn-s3-bucket-loggingconfiguration-targetobjectkeyformat>
                                  LoggingConfigurationProperty -> Maybe TargetObjectKeyFormatProperty
targetObjectKeyFormat :: (Prelude.Maybe TargetObjectKeyFormatProperty)}
  deriving stock (LoggingConfigurationProperty
-> LoggingConfigurationProperty -> Bool
(LoggingConfigurationProperty
 -> LoggingConfigurationProperty -> Bool)
-> (LoggingConfigurationProperty
    -> LoggingConfigurationProperty -> Bool)
-> Eq LoggingConfigurationProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LoggingConfigurationProperty
-> LoggingConfigurationProperty -> Bool
== :: LoggingConfigurationProperty
-> LoggingConfigurationProperty -> Bool
$c/= :: LoggingConfigurationProperty
-> LoggingConfigurationProperty -> Bool
/= :: LoggingConfigurationProperty
-> LoggingConfigurationProperty -> Bool
Prelude.Eq, Int -> LoggingConfigurationProperty -> ShowS
[LoggingConfigurationProperty] -> ShowS
LoggingConfigurationProperty -> String
(Int -> LoggingConfigurationProperty -> ShowS)
-> (LoggingConfigurationProperty -> String)
-> ([LoggingConfigurationProperty] -> ShowS)
-> Show LoggingConfigurationProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LoggingConfigurationProperty -> ShowS
showsPrec :: Int -> LoggingConfigurationProperty -> ShowS
$cshow :: LoggingConfigurationProperty -> String
show :: LoggingConfigurationProperty -> String
$cshowList :: [LoggingConfigurationProperty] -> ShowS
showList :: [LoggingConfigurationProperty] -> ShowS
Prelude.Show)
mkLoggingConfigurationProperty :: LoggingConfigurationProperty
mkLoggingConfigurationProperty :: LoggingConfigurationProperty
mkLoggingConfigurationProperty
  = LoggingConfigurationProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), destinationBucketName :: Maybe (Value Text)
destinationBucketName = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       logFilePrefix :: Maybe (Value Text)
logFilePrefix = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       targetObjectKeyFormat :: Maybe TargetObjectKeyFormatProperty
targetObjectKeyFormat = Maybe TargetObjectKeyFormatProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties LoggingConfigurationProperty where
  toResourceProperties :: LoggingConfigurationProperty -> ResourceProperties
toResourceProperties LoggingConfigurationProperty {Maybe (Value Text)
Maybe TargetObjectKeyFormatProperty
()
haddock_workaround_ :: LoggingConfigurationProperty -> ()
destinationBucketName :: LoggingConfigurationProperty -> Maybe (Value Text)
logFilePrefix :: LoggingConfigurationProperty -> Maybe (Value Text)
targetObjectKeyFormat :: LoggingConfigurationProperty -> Maybe TargetObjectKeyFormatProperty
haddock_workaround_ :: ()
destinationBucketName :: Maybe (Value Text)
logFilePrefix :: Maybe (Value Text)
targetObjectKeyFormat :: Maybe TargetObjectKeyFormatProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::S3::Bucket.LoggingConfiguration",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                           [Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"DestinationBucketName"
                              (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
destinationBucketName,
                            Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"LogFilePrefix" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
logFilePrefix,
                            Key -> TargetObjectKeyFormatProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"TargetObjectKeyFormat"
                              (TargetObjectKeyFormatProperty -> (Key, Value))
-> Maybe TargetObjectKeyFormatProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TargetObjectKeyFormatProperty
targetObjectKeyFormat])}
instance JSON.ToJSON LoggingConfigurationProperty where
  toJSON :: LoggingConfigurationProperty -> Value
toJSON LoggingConfigurationProperty {Maybe (Value Text)
Maybe TargetObjectKeyFormatProperty
()
haddock_workaround_ :: LoggingConfigurationProperty -> ()
destinationBucketName :: LoggingConfigurationProperty -> Maybe (Value Text)
logFilePrefix :: LoggingConfigurationProperty -> Maybe (Value Text)
targetObjectKeyFormat :: LoggingConfigurationProperty -> Maybe TargetObjectKeyFormatProperty
haddock_workaround_ :: ()
destinationBucketName :: Maybe (Value Text)
logFilePrefix :: Maybe (Value Text)
targetObjectKeyFormat :: Maybe TargetObjectKeyFormatProperty
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
              [Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"DestinationBucketName"
                 (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
destinationBucketName,
               Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"LogFilePrefix" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
logFilePrefix,
               Key -> TargetObjectKeyFormatProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"TargetObjectKeyFormat"
                 (TargetObjectKeyFormatProperty -> (Key, Value))
-> Maybe TargetObjectKeyFormatProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TargetObjectKeyFormatProperty
targetObjectKeyFormat]))
instance Property "DestinationBucketName" LoggingConfigurationProperty where
  type PropertyType "DestinationBucketName" LoggingConfigurationProperty = Value Prelude.Text
  set :: PropertyType "DestinationBucketName" LoggingConfigurationProperty
-> LoggingConfigurationProperty -> LoggingConfigurationProperty
set PropertyType "DestinationBucketName" LoggingConfigurationProperty
newValue LoggingConfigurationProperty {Maybe (Value Text)
Maybe TargetObjectKeyFormatProperty
()
haddock_workaround_ :: LoggingConfigurationProperty -> ()
destinationBucketName :: LoggingConfigurationProperty -> Maybe (Value Text)
logFilePrefix :: LoggingConfigurationProperty -> Maybe (Value Text)
targetObjectKeyFormat :: LoggingConfigurationProperty -> Maybe TargetObjectKeyFormatProperty
haddock_workaround_ :: ()
destinationBucketName :: Maybe (Value Text)
logFilePrefix :: Maybe (Value Text)
targetObjectKeyFormat :: Maybe TargetObjectKeyFormatProperty
..}
    = LoggingConfigurationProperty
        {destinationBucketName :: Maybe (Value Text)
destinationBucketName = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "DestinationBucketName" LoggingConfigurationProperty
Value Text
newValue, Maybe (Value Text)
Maybe TargetObjectKeyFormatProperty
()
haddock_workaround_ :: ()
logFilePrefix :: Maybe (Value Text)
targetObjectKeyFormat :: Maybe TargetObjectKeyFormatProperty
haddock_workaround_ :: ()
logFilePrefix :: Maybe (Value Text)
targetObjectKeyFormat :: Maybe TargetObjectKeyFormatProperty
..}
instance Property "LogFilePrefix" LoggingConfigurationProperty where
  type PropertyType "LogFilePrefix" LoggingConfigurationProperty = Value Prelude.Text
  set :: PropertyType "LogFilePrefix" LoggingConfigurationProperty
-> LoggingConfigurationProperty -> LoggingConfigurationProperty
set PropertyType "LogFilePrefix" LoggingConfigurationProperty
newValue LoggingConfigurationProperty {Maybe (Value Text)
Maybe TargetObjectKeyFormatProperty
()
haddock_workaround_ :: LoggingConfigurationProperty -> ()
destinationBucketName :: LoggingConfigurationProperty -> Maybe (Value Text)
logFilePrefix :: LoggingConfigurationProperty -> Maybe (Value Text)
targetObjectKeyFormat :: LoggingConfigurationProperty -> Maybe TargetObjectKeyFormatProperty
haddock_workaround_ :: ()
destinationBucketName :: Maybe (Value Text)
logFilePrefix :: Maybe (Value Text)
targetObjectKeyFormat :: Maybe TargetObjectKeyFormatProperty
..}
    = LoggingConfigurationProperty
        {logFilePrefix :: Maybe (Value Text)
logFilePrefix = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "LogFilePrefix" LoggingConfigurationProperty
Value Text
newValue, Maybe (Value Text)
Maybe TargetObjectKeyFormatProperty
()
haddock_workaround_ :: ()
destinationBucketName :: Maybe (Value Text)
targetObjectKeyFormat :: Maybe TargetObjectKeyFormatProperty
haddock_workaround_ :: ()
destinationBucketName :: Maybe (Value Text)
targetObjectKeyFormat :: Maybe TargetObjectKeyFormatProperty
..}
instance Property "TargetObjectKeyFormat" LoggingConfigurationProperty where
  type PropertyType "TargetObjectKeyFormat" LoggingConfigurationProperty = TargetObjectKeyFormatProperty
  set :: PropertyType "TargetObjectKeyFormat" LoggingConfigurationProperty
-> LoggingConfigurationProperty -> LoggingConfigurationProperty
set PropertyType "TargetObjectKeyFormat" LoggingConfigurationProperty
newValue LoggingConfigurationProperty {Maybe (Value Text)
Maybe TargetObjectKeyFormatProperty
()
haddock_workaround_ :: LoggingConfigurationProperty -> ()
destinationBucketName :: LoggingConfigurationProperty -> Maybe (Value Text)
logFilePrefix :: LoggingConfigurationProperty -> Maybe (Value Text)
targetObjectKeyFormat :: LoggingConfigurationProperty -> Maybe TargetObjectKeyFormatProperty
haddock_workaround_ :: ()
destinationBucketName :: Maybe (Value Text)
logFilePrefix :: Maybe (Value Text)
targetObjectKeyFormat :: Maybe TargetObjectKeyFormatProperty
..}
    = LoggingConfigurationProperty
        {targetObjectKeyFormat :: Maybe TargetObjectKeyFormatProperty
targetObjectKeyFormat = TargetObjectKeyFormatProperty
-> Maybe TargetObjectKeyFormatProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "TargetObjectKeyFormat" LoggingConfigurationProperty
TargetObjectKeyFormatProperty
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
destinationBucketName :: Maybe (Value Text)
logFilePrefix :: Maybe (Value Text)
haddock_workaround_ :: ()
destinationBucketName :: Maybe (Value Text)
logFilePrefix :: Maybe (Value Text)
..}