module Stratosphere.CloudFront.Distribution.LoggingProperty (
        LoggingProperty(..), mkLoggingProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data LoggingProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-logging.html>
    LoggingProperty {LoggingProperty -> ()
haddock_workaround_ :: (),
                     -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-logging.html#cfn-cloudfront-distribution-logging-bucket>
                     LoggingProperty -> Maybe (Value Text)
bucket :: (Prelude.Maybe (Value Prelude.Text)),
                     -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-logging.html#cfn-cloudfront-distribution-logging-includecookies>
                     LoggingProperty -> Maybe (Value Bool)
includeCookies :: (Prelude.Maybe (Value Prelude.Bool)),
                     -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-logging.html#cfn-cloudfront-distribution-logging-prefix>
                     LoggingProperty -> Maybe (Value Text)
prefix :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (LoggingProperty -> LoggingProperty -> Bool
(LoggingProperty -> LoggingProperty -> Bool)
-> (LoggingProperty -> LoggingProperty -> Bool)
-> Eq LoggingProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LoggingProperty -> LoggingProperty -> Bool
== :: LoggingProperty -> LoggingProperty -> Bool
$c/= :: LoggingProperty -> LoggingProperty -> Bool
/= :: LoggingProperty -> LoggingProperty -> Bool
Prelude.Eq, Int -> LoggingProperty -> ShowS
[LoggingProperty] -> ShowS
LoggingProperty -> String
(Int -> LoggingProperty -> ShowS)
-> (LoggingProperty -> String)
-> ([LoggingProperty] -> ShowS)
-> Show LoggingProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LoggingProperty -> ShowS
showsPrec :: Int -> LoggingProperty -> ShowS
$cshow :: LoggingProperty -> String
show :: LoggingProperty -> String
$cshowList :: [LoggingProperty] -> ShowS
showList :: [LoggingProperty] -> ShowS
Prelude.Show)
mkLoggingProperty :: LoggingProperty
mkLoggingProperty :: LoggingProperty
mkLoggingProperty
  = LoggingProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), bucket :: Maybe (Value Text)
bucket = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       includeCookies :: Maybe (Value Bool)
includeCookies = Maybe (Value Bool)
forall a. Maybe a
Prelude.Nothing, prefix :: Maybe (Value Text)
prefix = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties LoggingProperty where
  toResourceProperties :: LoggingProperty -> ResourceProperties
toResourceProperties LoggingProperty {Maybe (Value Bool)
Maybe (Value Text)
()
haddock_workaround_ :: LoggingProperty -> ()
bucket :: LoggingProperty -> Maybe (Value Text)
includeCookies :: LoggingProperty -> Maybe (Value Bool)
prefix :: LoggingProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
bucket :: Maybe (Value Text)
includeCookies :: Maybe (Value Bool)
prefix :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::CloudFront::Distribution.Logging",
         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
"Bucket" (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)
bucket,
                            Key -> Value Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"IncludeCookies" (Value Bool -> (Key, Value))
-> Maybe (Value Bool) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Bool)
includeCookies,
                            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
"Prefix" (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)
prefix])}
instance JSON.ToJSON LoggingProperty where
  toJSON :: LoggingProperty -> Value
toJSON LoggingProperty {Maybe (Value Bool)
Maybe (Value Text)
()
haddock_workaround_ :: LoggingProperty -> ()
bucket :: LoggingProperty -> Maybe (Value Text)
includeCookies :: LoggingProperty -> Maybe (Value Bool)
prefix :: LoggingProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
bucket :: Maybe (Value Text)
includeCookies :: Maybe (Value Bool)
prefix :: Maybe (Value Text)
..}
    = [(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
"Bucket" (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)
bucket,
               Key -> Value Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"IncludeCookies" (Value Bool -> (Key, Value))
-> Maybe (Value Bool) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Bool)
includeCookies,
               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
"Prefix" (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)
prefix]))
instance Property "Bucket" LoggingProperty where
  type PropertyType "Bucket" LoggingProperty = Value Prelude.Text
  set :: PropertyType "Bucket" LoggingProperty
-> LoggingProperty -> LoggingProperty
set PropertyType "Bucket" LoggingProperty
newValue LoggingProperty {Maybe (Value Bool)
Maybe (Value Text)
()
haddock_workaround_ :: LoggingProperty -> ()
bucket :: LoggingProperty -> Maybe (Value Text)
includeCookies :: LoggingProperty -> Maybe (Value Bool)
prefix :: LoggingProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
bucket :: Maybe (Value Text)
includeCookies :: Maybe (Value Bool)
prefix :: Maybe (Value Text)
..}
    = LoggingProperty {bucket :: Maybe (Value Text)
bucket = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Bucket" LoggingProperty
Value Text
newValue, Maybe (Value Bool)
Maybe (Value Text)
()
haddock_workaround_ :: ()
includeCookies :: Maybe (Value Bool)
prefix :: Maybe (Value Text)
haddock_workaround_ :: ()
includeCookies :: Maybe (Value Bool)
prefix :: Maybe (Value Text)
..}
instance Property "IncludeCookies" LoggingProperty where
  type PropertyType "IncludeCookies" LoggingProperty = Value Prelude.Bool
  set :: PropertyType "IncludeCookies" LoggingProperty
-> LoggingProperty -> LoggingProperty
set PropertyType "IncludeCookies" LoggingProperty
newValue LoggingProperty {Maybe (Value Bool)
Maybe (Value Text)
()
haddock_workaround_ :: LoggingProperty -> ()
bucket :: LoggingProperty -> Maybe (Value Text)
includeCookies :: LoggingProperty -> Maybe (Value Bool)
prefix :: LoggingProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
bucket :: Maybe (Value Text)
includeCookies :: Maybe (Value Bool)
prefix :: Maybe (Value Text)
..}
    = LoggingProperty {includeCookies :: Maybe (Value Bool)
includeCookies = Value Bool -> Maybe (Value Bool)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "IncludeCookies" LoggingProperty
Value Bool
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
bucket :: Maybe (Value Text)
prefix :: Maybe (Value Text)
haddock_workaround_ :: ()
bucket :: Maybe (Value Text)
prefix :: Maybe (Value Text)
..}
instance Property "Prefix" LoggingProperty where
  type PropertyType "Prefix" LoggingProperty = Value Prelude.Text
  set :: PropertyType "Prefix" LoggingProperty
-> LoggingProperty -> LoggingProperty
set PropertyType "Prefix" LoggingProperty
newValue LoggingProperty {Maybe (Value Bool)
Maybe (Value Text)
()
haddock_workaround_ :: LoggingProperty -> ()
bucket :: LoggingProperty -> Maybe (Value Text)
includeCookies :: LoggingProperty -> Maybe (Value Bool)
prefix :: LoggingProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
bucket :: Maybe (Value Text)
includeCookies :: Maybe (Value Bool)
prefix :: Maybe (Value Text)
..}
    = LoggingProperty {prefix :: Maybe (Value Text)
prefix = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Prefix" LoggingProperty
Value Text
newValue, Maybe (Value Bool)
Maybe (Value Text)
()
haddock_workaround_ :: ()
bucket :: Maybe (Value Text)
includeCookies :: Maybe (Value Bool)
haddock_workaround_ :: ()
bucket :: Maybe (Value Text)
includeCookies :: Maybe (Value Bool)
..}