module Stratosphere.SecurityHub.ConfigurationPolicy.PolicyProperty (
        module Exports, PolicyProperty(..), mkPolicyProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.SecurityHub.ConfigurationPolicy.SecurityHubPolicyProperty as Exports
import Stratosphere.ResourceProperties
data PolicyProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-securityhub-configurationpolicy-policy.html>
    PolicyProperty {PolicyProperty -> ()
haddock_workaround_ :: (),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-securityhub-configurationpolicy-policy.html#cfn-securityhub-configurationpolicy-policy-securityhub>
                    PolicyProperty -> Maybe SecurityHubPolicyProperty
securityHub :: (Prelude.Maybe SecurityHubPolicyProperty)}
  deriving stock (PolicyProperty -> PolicyProperty -> Bool
(PolicyProperty -> PolicyProperty -> Bool)
-> (PolicyProperty -> PolicyProperty -> Bool) -> Eq PolicyProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PolicyProperty -> PolicyProperty -> Bool
== :: PolicyProperty -> PolicyProperty -> Bool
$c/= :: PolicyProperty -> PolicyProperty -> Bool
/= :: PolicyProperty -> PolicyProperty -> Bool
Prelude.Eq, Int -> PolicyProperty -> ShowS
[PolicyProperty] -> ShowS
PolicyProperty -> String
(Int -> PolicyProperty -> ShowS)
-> (PolicyProperty -> String)
-> ([PolicyProperty] -> ShowS)
-> Show PolicyProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PolicyProperty -> ShowS
showsPrec :: Int -> PolicyProperty -> ShowS
$cshow :: PolicyProperty -> String
show :: PolicyProperty -> String
$cshowList :: [PolicyProperty] -> ShowS
showList :: [PolicyProperty] -> ShowS
Prelude.Show)
mkPolicyProperty :: PolicyProperty
mkPolicyProperty :: PolicyProperty
mkPolicyProperty
  = PolicyProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), securityHub :: Maybe SecurityHubPolicyProperty
securityHub = Maybe SecurityHubPolicyProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties PolicyProperty where
  toResourceProperties :: PolicyProperty -> ResourceProperties
toResourceProperties PolicyProperty {Maybe SecurityHubPolicyProperty
()
haddock_workaround_ :: PolicyProperty -> ()
securityHub :: PolicyProperty -> Maybe SecurityHubPolicyProperty
haddock_workaround_ :: ()
securityHub :: Maybe SecurityHubPolicyProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::SecurityHub::ConfigurationPolicy.Policy",
         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 -> SecurityHubPolicyProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SecurityHub" (SecurityHubPolicyProperty -> (Key, Value))
-> Maybe SecurityHubPolicyProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SecurityHubPolicyProperty
securityHub])}
instance JSON.ToJSON PolicyProperty where
  toJSON :: PolicyProperty -> Value
toJSON PolicyProperty {Maybe SecurityHubPolicyProperty
()
haddock_workaround_ :: PolicyProperty -> ()
securityHub :: PolicyProperty -> Maybe SecurityHubPolicyProperty
haddock_workaround_ :: ()
securityHub :: Maybe SecurityHubPolicyProperty
..}
    = [(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 -> SecurityHubPolicyProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SecurityHub" (SecurityHubPolicyProperty -> (Key, Value))
-> Maybe SecurityHubPolicyProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SecurityHubPolicyProperty
securityHub]))
instance Property "SecurityHub" PolicyProperty where
  type PropertyType "SecurityHub" PolicyProperty = SecurityHubPolicyProperty
  set :: PropertyType "SecurityHub" PolicyProperty
-> PolicyProperty -> PolicyProperty
set PropertyType "SecurityHub" PolicyProperty
newValue PolicyProperty {Maybe SecurityHubPolicyProperty
()
haddock_workaround_ :: PolicyProperty -> ()
securityHub :: PolicyProperty -> Maybe SecurityHubPolicyProperty
haddock_workaround_ :: ()
securityHub :: Maybe SecurityHubPolicyProperty
..}
    = PolicyProperty {securityHub :: Maybe SecurityHubPolicyProperty
securityHub = SecurityHubPolicyProperty -> Maybe SecurityHubPolicyProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "SecurityHub" PolicyProperty
SecurityHubPolicyProperty
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}