module Stratosphere.AppMesh.VirtualNode.LoggingProperty (
        module Exports, LoggingProperty(..), mkLoggingProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.AppMesh.VirtualNode.AccessLogProperty as Exports
import Stratosphere.ResourceProperties
data LoggingProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-logging.html>
    LoggingProperty {LoggingProperty -> ()
haddock_workaround_ :: (),
                     -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-logging.html#cfn-appmesh-virtualnode-logging-accesslog>
                     LoggingProperty -> Maybe AccessLogProperty
accessLog :: (Prelude.Maybe AccessLogProperty)}
  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_ = (), accessLog :: Maybe AccessLogProperty
accessLog = Maybe AccessLogProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties LoggingProperty where
  toResourceProperties :: LoggingProperty -> ResourceProperties
toResourceProperties LoggingProperty {Maybe AccessLogProperty
()
haddock_workaround_ :: LoggingProperty -> ()
accessLog :: LoggingProperty -> Maybe AccessLogProperty
haddock_workaround_ :: ()
accessLog :: Maybe AccessLogProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::AppMesh::VirtualNode.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 -> AccessLogProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AccessLog" (AccessLogProperty -> (Key, Value))
-> Maybe AccessLogProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AccessLogProperty
accessLog])}
instance JSON.ToJSON LoggingProperty where
  toJSON :: LoggingProperty -> Value
toJSON LoggingProperty {Maybe AccessLogProperty
()
haddock_workaround_ :: LoggingProperty -> ()
accessLog :: LoggingProperty -> Maybe AccessLogProperty
haddock_workaround_ :: ()
accessLog :: Maybe AccessLogProperty
..}
    = [(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 -> AccessLogProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AccessLog" (AccessLogProperty -> (Key, Value))
-> Maybe AccessLogProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AccessLogProperty
accessLog]))
instance Property "AccessLog" LoggingProperty where
  type PropertyType "AccessLog" LoggingProperty = AccessLogProperty
  set :: PropertyType "AccessLog" LoggingProperty
-> LoggingProperty -> LoggingProperty
set PropertyType "AccessLog" LoggingProperty
newValue LoggingProperty {Maybe AccessLogProperty
()
haddock_workaround_ :: LoggingProperty -> ()
accessLog :: LoggingProperty -> Maybe AccessLogProperty
haddock_workaround_ :: ()
accessLog :: Maybe AccessLogProperty
..}
    = LoggingProperty {accessLog :: Maybe AccessLogProperty
accessLog = AccessLogProperty -> Maybe AccessLogProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AccessLog" LoggingProperty
AccessLogProperty
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}