module Stratosphere.RUM.AppMonitor.ResourcePolicyProperty (
        ResourcePolicyProperty(..), mkResourcePolicyProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ResourcePolicyProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rum-appmonitor-resourcepolicy.html>
    ResourcePolicyProperty {ResourcePolicyProperty -> ()
haddock_workaround_ :: (),
                            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rum-appmonitor-resourcepolicy.html#cfn-rum-appmonitor-resourcepolicy-policydocument>
                            ResourcePolicyProperty -> Value Text
policyDocument :: (Value Prelude.Text),
                            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rum-appmonitor-resourcepolicy.html#cfn-rum-appmonitor-resourcepolicy-policyrevisionid>
                            ResourcePolicyProperty -> Maybe (Value Text)
policyRevisionId :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (ResourcePolicyProperty -> ResourcePolicyProperty -> Bool
(ResourcePolicyProperty -> ResourcePolicyProperty -> Bool)
-> (ResourcePolicyProperty -> ResourcePolicyProperty -> Bool)
-> Eq ResourcePolicyProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ResourcePolicyProperty -> ResourcePolicyProperty -> Bool
== :: ResourcePolicyProperty -> ResourcePolicyProperty -> Bool
$c/= :: ResourcePolicyProperty -> ResourcePolicyProperty -> Bool
/= :: ResourcePolicyProperty -> ResourcePolicyProperty -> Bool
Prelude.Eq, Int -> ResourcePolicyProperty -> ShowS
[ResourcePolicyProperty] -> ShowS
ResourcePolicyProperty -> String
(Int -> ResourcePolicyProperty -> ShowS)
-> (ResourcePolicyProperty -> String)
-> ([ResourcePolicyProperty] -> ShowS)
-> Show ResourcePolicyProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ResourcePolicyProperty -> ShowS
showsPrec :: Int -> ResourcePolicyProperty -> ShowS
$cshow :: ResourcePolicyProperty -> String
show :: ResourcePolicyProperty -> String
$cshowList :: [ResourcePolicyProperty] -> ShowS
showList :: [ResourcePolicyProperty] -> ShowS
Prelude.Show)
mkResourcePolicyProperty ::
  Value Prelude.Text -> ResourcePolicyProperty
mkResourcePolicyProperty :: Value Text -> ResourcePolicyProperty
mkResourcePolicyProperty Value Text
policyDocument
  = ResourcePolicyProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), policyDocument :: Value Text
policyDocument = Value Text
policyDocument,
       policyRevisionId :: Maybe (Value Text)
policyRevisionId = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ResourcePolicyProperty where
  toResourceProperties :: ResourcePolicyProperty -> ResourceProperties
toResourceProperties ResourcePolicyProperty {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ResourcePolicyProperty -> ()
policyDocument :: ResourcePolicyProperty -> Value Text
policyRevisionId :: ResourcePolicyProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
policyDocument :: Value Text
policyRevisionId :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::RUM::AppMonitor.ResourcePolicy",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"PolicyDocument" 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..= Value Text
policyDocument]
                           ([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
"PolicyRevisionId" (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)
policyRevisionId]))}
instance JSON.ToJSON ResourcePolicyProperty where
  toJSON :: ResourcePolicyProperty -> Value
toJSON ResourcePolicyProperty {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ResourcePolicyProperty -> ()
policyDocument :: ResourcePolicyProperty -> Value Text
policyRevisionId :: ResourcePolicyProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
policyDocument :: Value Text
policyRevisionId :: Maybe (Value Text)
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"PolicyDocument" 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..= Value Text
policyDocument]
              ([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
"PolicyRevisionId" (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)
policyRevisionId])))
instance Property "PolicyDocument" ResourcePolicyProperty where
  type PropertyType "PolicyDocument" ResourcePolicyProperty = Value Prelude.Text
  set :: PropertyType "PolicyDocument" ResourcePolicyProperty
-> ResourcePolicyProperty -> ResourcePolicyProperty
set PropertyType "PolicyDocument" ResourcePolicyProperty
newValue ResourcePolicyProperty {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ResourcePolicyProperty -> ()
policyDocument :: ResourcePolicyProperty -> Value Text
policyRevisionId :: ResourcePolicyProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
policyDocument :: Value Text
policyRevisionId :: Maybe (Value Text)
..}
    = ResourcePolicyProperty {policyDocument :: Value Text
policyDocument = PropertyType "PolicyDocument" ResourcePolicyProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
policyRevisionId :: Maybe (Value Text)
haddock_workaround_ :: ()
policyRevisionId :: Maybe (Value Text)
..}
instance Property "PolicyRevisionId" ResourcePolicyProperty where
  type PropertyType "PolicyRevisionId" ResourcePolicyProperty = Value Prelude.Text
  set :: PropertyType "PolicyRevisionId" ResourcePolicyProperty
-> ResourcePolicyProperty -> ResourcePolicyProperty
set PropertyType "PolicyRevisionId" ResourcePolicyProperty
newValue ResourcePolicyProperty {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ResourcePolicyProperty -> ()
policyDocument :: ResourcePolicyProperty -> Value Text
policyRevisionId :: ResourcePolicyProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
policyDocument :: Value Text
policyRevisionId :: Maybe (Value Text)
..}
    = ResourcePolicyProperty
        {policyRevisionId :: Maybe (Value Text)
policyRevisionId = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "PolicyRevisionId" ResourcePolicyProperty
Value Text
newValue, ()
Value Text
haddock_workaround_ :: ()
policyDocument :: Value Text
haddock_workaround_ :: ()
policyDocument :: Value Text
..}