module Stratosphere.Config.ConfigRule.SourceProperty (
        module Exports, SourceProperty(..), mkSourceProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.Config.ConfigRule.CustomPolicyDetailsProperty as Exports
import {-# SOURCE #-} Stratosphere.Config.ConfigRule.SourceDetailProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data SourceProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-config-configrule-source.html>
    SourceProperty {SourceProperty -> ()
haddock_workaround_ :: (),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-config-configrule-source.html#cfn-config-configrule-source-custompolicydetails>
                    SourceProperty -> Maybe CustomPolicyDetailsProperty
customPolicyDetails :: (Prelude.Maybe CustomPolicyDetailsProperty),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-config-configrule-source.html#cfn-config-configrule-source-owner>
                    SourceProperty -> Value Text
owner :: (Value Prelude.Text),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-config-configrule-source.html#cfn-config-configrule-source-sourcedetails>
                    SourceProperty -> Maybe [SourceDetailProperty]
sourceDetails :: (Prelude.Maybe [SourceDetailProperty]),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-config-configrule-source.html#cfn-config-configrule-source-sourceidentifier>
                    SourceProperty -> Maybe (Value Text)
sourceIdentifier :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (SourceProperty -> SourceProperty -> Bool
(SourceProperty -> SourceProperty -> Bool)
-> (SourceProperty -> SourceProperty -> Bool) -> Eq SourceProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SourceProperty -> SourceProperty -> Bool
== :: SourceProperty -> SourceProperty -> Bool
$c/= :: SourceProperty -> SourceProperty -> Bool
/= :: SourceProperty -> SourceProperty -> Bool
Prelude.Eq, Int -> SourceProperty -> ShowS
[SourceProperty] -> ShowS
SourceProperty -> String
(Int -> SourceProperty -> ShowS)
-> (SourceProperty -> String)
-> ([SourceProperty] -> ShowS)
-> Show SourceProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SourceProperty -> ShowS
showsPrec :: Int -> SourceProperty -> ShowS
$cshow :: SourceProperty -> String
show :: SourceProperty -> String
$cshowList :: [SourceProperty] -> ShowS
showList :: [SourceProperty] -> ShowS
Prelude.Show)
mkSourceProperty :: Value Prelude.Text -> SourceProperty
mkSourceProperty :: Value Text -> SourceProperty
mkSourceProperty Value Text
owner
  = SourceProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), owner :: Value Text
owner = Value Text
owner,
       customPolicyDetails :: Maybe CustomPolicyDetailsProperty
customPolicyDetails = Maybe CustomPolicyDetailsProperty
forall a. Maybe a
Prelude.Nothing,
       sourceDetails :: Maybe [SourceDetailProperty]
sourceDetails = Maybe [SourceDetailProperty]
forall a. Maybe a
Prelude.Nothing,
       sourceIdentifier :: Maybe (Value Text)
sourceIdentifier = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties SourceProperty where
  toResourceProperties :: SourceProperty -> ResourceProperties
toResourceProperties SourceProperty {Maybe [SourceDetailProperty]
Maybe (Value Text)
Maybe CustomPolicyDetailsProperty
()
Value Text
haddock_workaround_ :: SourceProperty -> ()
customPolicyDetails :: SourceProperty -> Maybe CustomPolicyDetailsProperty
owner :: SourceProperty -> Value Text
sourceDetails :: SourceProperty -> Maybe [SourceDetailProperty]
sourceIdentifier :: SourceProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
customPolicyDetails :: Maybe CustomPolicyDetailsProperty
owner :: Value Text
sourceDetails :: Maybe [SourceDetailProperty]
sourceIdentifier :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Config::ConfigRule.Source",
         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
"Owner" 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
owner]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> CustomPolicyDetailsProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CustomPolicyDetails" (CustomPolicyDetailsProperty -> (Key, Value))
-> Maybe CustomPolicyDetailsProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CustomPolicyDetailsProperty
customPolicyDetails,
                               Key -> [SourceDetailProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SourceDetails" ([SourceDetailProperty] -> (Key, Value))
-> Maybe [SourceDetailProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SourceDetailProperty]
sourceDetails,
                               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
"SourceIdentifier" (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)
sourceIdentifier]))}
instance JSON.ToJSON SourceProperty where
  toJSON :: SourceProperty -> Value
toJSON SourceProperty {Maybe [SourceDetailProperty]
Maybe (Value Text)
Maybe CustomPolicyDetailsProperty
()
Value Text
haddock_workaround_ :: SourceProperty -> ()
customPolicyDetails :: SourceProperty -> Maybe CustomPolicyDetailsProperty
owner :: SourceProperty -> Value Text
sourceDetails :: SourceProperty -> Maybe [SourceDetailProperty]
sourceIdentifier :: SourceProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
customPolicyDetails :: Maybe CustomPolicyDetailsProperty
owner :: Value Text
sourceDetails :: Maybe [SourceDetailProperty]
sourceIdentifier :: 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
"Owner" 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
owner]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> CustomPolicyDetailsProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CustomPolicyDetails" (CustomPolicyDetailsProperty -> (Key, Value))
-> Maybe CustomPolicyDetailsProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CustomPolicyDetailsProperty
customPolicyDetails,
                  Key -> [SourceDetailProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SourceDetails" ([SourceDetailProperty] -> (Key, Value))
-> Maybe [SourceDetailProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SourceDetailProperty]
sourceDetails,
                  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
"SourceIdentifier" (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)
sourceIdentifier])))
instance Property "CustomPolicyDetails" SourceProperty where
  type PropertyType "CustomPolicyDetails" SourceProperty = CustomPolicyDetailsProperty
  set :: PropertyType "CustomPolicyDetails" SourceProperty
-> SourceProperty -> SourceProperty
set PropertyType "CustomPolicyDetails" SourceProperty
newValue SourceProperty {Maybe [SourceDetailProperty]
Maybe (Value Text)
Maybe CustomPolicyDetailsProperty
()
Value Text
haddock_workaround_ :: SourceProperty -> ()
customPolicyDetails :: SourceProperty -> Maybe CustomPolicyDetailsProperty
owner :: SourceProperty -> Value Text
sourceDetails :: SourceProperty -> Maybe [SourceDetailProperty]
sourceIdentifier :: SourceProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
customPolicyDetails :: Maybe CustomPolicyDetailsProperty
owner :: Value Text
sourceDetails :: Maybe [SourceDetailProperty]
sourceIdentifier :: Maybe (Value Text)
..}
    = SourceProperty {customPolicyDetails :: Maybe CustomPolicyDetailsProperty
customPolicyDetails = CustomPolicyDetailsProperty -> Maybe CustomPolicyDetailsProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "CustomPolicyDetails" SourceProperty
CustomPolicyDetailsProperty
newValue, Maybe [SourceDetailProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
owner :: Value Text
sourceDetails :: Maybe [SourceDetailProperty]
sourceIdentifier :: Maybe (Value Text)
haddock_workaround_ :: ()
owner :: Value Text
sourceDetails :: Maybe [SourceDetailProperty]
sourceIdentifier :: Maybe (Value Text)
..}
instance Property "Owner" SourceProperty where
  type PropertyType "Owner" SourceProperty = Value Prelude.Text
  set :: PropertyType "Owner" SourceProperty
-> SourceProperty -> SourceProperty
set PropertyType "Owner" SourceProperty
newValue SourceProperty {Maybe [SourceDetailProperty]
Maybe (Value Text)
Maybe CustomPolicyDetailsProperty
()
Value Text
haddock_workaround_ :: SourceProperty -> ()
customPolicyDetails :: SourceProperty -> Maybe CustomPolicyDetailsProperty
owner :: SourceProperty -> Value Text
sourceDetails :: SourceProperty -> Maybe [SourceDetailProperty]
sourceIdentifier :: SourceProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
customPolicyDetails :: Maybe CustomPolicyDetailsProperty
owner :: Value Text
sourceDetails :: Maybe [SourceDetailProperty]
sourceIdentifier :: Maybe (Value Text)
..}
    = SourceProperty {owner :: Value Text
owner = PropertyType "Owner" SourceProperty
Value Text
newValue, Maybe [SourceDetailProperty]
Maybe (Value Text)
Maybe CustomPolicyDetailsProperty
()
haddock_workaround_ :: ()
customPolicyDetails :: Maybe CustomPolicyDetailsProperty
sourceDetails :: Maybe [SourceDetailProperty]
sourceIdentifier :: Maybe (Value Text)
haddock_workaround_ :: ()
customPolicyDetails :: Maybe CustomPolicyDetailsProperty
sourceDetails :: Maybe [SourceDetailProperty]
sourceIdentifier :: Maybe (Value Text)
..}
instance Property "SourceDetails" SourceProperty where
  type PropertyType "SourceDetails" SourceProperty = [SourceDetailProperty]
  set :: PropertyType "SourceDetails" SourceProperty
-> SourceProperty -> SourceProperty
set PropertyType "SourceDetails" SourceProperty
newValue SourceProperty {Maybe [SourceDetailProperty]
Maybe (Value Text)
Maybe CustomPolicyDetailsProperty
()
Value Text
haddock_workaround_ :: SourceProperty -> ()
customPolicyDetails :: SourceProperty -> Maybe CustomPolicyDetailsProperty
owner :: SourceProperty -> Value Text
sourceDetails :: SourceProperty -> Maybe [SourceDetailProperty]
sourceIdentifier :: SourceProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
customPolicyDetails :: Maybe CustomPolicyDetailsProperty
owner :: Value Text
sourceDetails :: Maybe [SourceDetailProperty]
sourceIdentifier :: Maybe (Value Text)
..}
    = SourceProperty {sourceDetails :: Maybe [SourceDetailProperty]
sourceDetails = [SourceDetailProperty] -> Maybe [SourceDetailProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [SourceDetailProperty]
PropertyType "SourceDetails" SourceProperty
newValue, Maybe (Value Text)
Maybe CustomPolicyDetailsProperty
()
Value Text
haddock_workaround_ :: ()
customPolicyDetails :: Maybe CustomPolicyDetailsProperty
owner :: Value Text
sourceIdentifier :: Maybe (Value Text)
haddock_workaround_ :: ()
customPolicyDetails :: Maybe CustomPolicyDetailsProperty
owner :: Value Text
sourceIdentifier :: Maybe (Value Text)
..}
instance Property "SourceIdentifier" SourceProperty where
  type PropertyType "SourceIdentifier" SourceProperty = Value Prelude.Text
  set :: PropertyType "SourceIdentifier" SourceProperty
-> SourceProperty -> SourceProperty
set PropertyType "SourceIdentifier" SourceProperty
newValue SourceProperty {Maybe [SourceDetailProperty]
Maybe (Value Text)
Maybe CustomPolicyDetailsProperty
()
Value Text
haddock_workaround_ :: SourceProperty -> ()
customPolicyDetails :: SourceProperty -> Maybe CustomPolicyDetailsProperty
owner :: SourceProperty -> Value Text
sourceDetails :: SourceProperty -> Maybe [SourceDetailProperty]
sourceIdentifier :: SourceProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
customPolicyDetails :: Maybe CustomPolicyDetailsProperty
owner :: Value Text
sourceDetails :: Maybe [SourceDetailProperty]
sourceIdentifier :: Maybe (Value Text)
..}
    = SourceProperty {sourceIdentifier :: Maybe (Value Text)
sourceIdentifier = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "SourceIdentifier" SourceProperty
Value Text
newValue, Maybe [SourceDetailProperty]
Maybe CustomPolicyDetailsProperty
()
Value Text
haddock_workaround_ :: ()
customPolicyDetails :: Maybe CustomPolicyDetailsProperty
owner :: Value Text
sourceDetails :: Maybe [SourceDetailProperty]
haddock_workaround_ :: ()
customPolicyDetails :: Maybe CustomPolicyDetailsProperty
owner :: Value Text
sourceDetails :: Maybe [SourceDetailProperty]
..}