module Stratosphere.SecurityLake.Subscriber.SourceProperty (
        module Exports, SourceProperty(..), mkSourceProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.SecurityLake.Subscriber.AwsLogSourceProperty as Exports
import {-# SOURCE #-} Stratosphere.SecurityLake.Subscriber.CustomLogSourceProperty as Exports
import Stratosphere.ResourceProperties
data SourceProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-securitylake-subscriber-source.html>
    SourceProperty {SourceProperty -> ()
haddock_workaround_ :: (),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-securitylake-subscriber-source.html#cfn-securitylake-subscriber-source-awslogsource>
                    SourceProperty -> Maybe AwsLogSourceProperty
awsLogSource :: (Prelude.Maybe AwsLogSourceProperty),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-securitylake-subscriber-source.html#cfn-securitylake-subscriber-source-customlogsource>
                    SourceProperty -> Maybe CustomLogSourceProperty
customLogSource :: (Prelude.Maybe CustomLogSourceProperty)}
  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 :: SourceProperty
mkSourceProperty :: SourceProperty
mkSourceProperty
  = SourceProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), awsLogSource :: Maybe AwsLogSourceProperty
awsLogSource = Maybe AwsLogSourceProperty
forall a. Maybe a
Prelude.Nothing,
       customLogSource :: Maybe CustomLogSourceProperty
customLogSource = Maybe CustomLogSourceProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties SourceProperty where
  toResourceProperties :: SourceProperty -> ResourceProperties
toResourceProperties SourceProperty {Maybe AwsLogSourceProperty
Maybe CustomLogSourceProperty
()
haddock_workaround_ :: SourceProperty -> ()
awsLogSource :: SourceProperty -> Maybe AwsLogSourceProperty
customLogSource :: SourceProperty -> Maybe CustomLogSourceProperty
haddock_workaround_ :: ()
awsLogSource :: Maybe AwsLogSourceProperty
customLogSource :: Maybe CustomLogSourceProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::SecurityLake::Subscriber.Source",
         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 -> AwsLogSourceProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AwsLogSource" (AwsLogSourceProperty -> (Key, Value))
-> Maybe AwsLogSourceProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AwsLogSourceProperty
awsLogSource,
                            Key -> CustomLogSourceProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CustomLogSource" (CustomLogSourceProperty -> (Key, Value))
-> Maybe CustomLogSourceProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CustomLogSourceProperty
customLogSource])}
instance JSON.ToJSON SourceProperty where
  toJSON :: SourceProperty -> Value
toJSON SourceProperty {Maybe AwsLogSourceProperty
Maybe CustomLogSourceProperty
()
haddock_workaround_ :: SourceProperty -> ()
awsLogSource :: SourceProperty -> Maybe AwsLogSourceProperty
customLogSource :: SourceProperty -> Maybe CustomLogSourceProperty
haddock_workaround_ :: ()
awsLogSource :: Maybe AwsLogSourceProperty
customLogSource :: Maybe CustomLogSourceProperty
..}
    = [(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 -> AwsLogSourceProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AwsLogSource" (AwsLogSourceProperty -> (Key, Value))
-> Maybe AwsLogSourceProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AwsLogSourceProperty
awsLogSource,
               Key -> CustomLogSourceProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CustomLogSource" (CustomLogSourceProperty -> (Key, Value))
-> Maybe CustomLogSourceProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CustomLogSourceProperty
customLogSource]))
instance Property "AwsLogSource" SourceProperty where
  type PropertyType "AwsLogSource" SourceProperty = AwsLogSourceProperty
  set :: PropertyType "AwsLogSource" SourceProperty
-> SourceProperty -> SourceProperty
set PropertyType "AwsLogSource" SourceProperty
newValue SourceProperty {Maybe AwsLogSourceProperty
Maybe CustomLogSourceProperty
()
haddock_workaround_ :: SourceProperty -> ()
awsLogSource :: SourceProperty -> Maybe AwsLogSourceProperty
customLogSource :: SourceProperty -> Maybe CustomLogSourceProperty
haddock_workaround_ :: ()
awsLogSource :: Maybe AwsLogSourceProperty
customLogSource :: Maybe CustomLogSourceProperty
..}
    = SourceProperty {awsLogSource :: Maybe AwsLogSourceProperty
awsLogSource = AwsLogSourceProperty -> Maybe AwsLogSourceProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AwsLogSource" SourceProperty
AwsLogSourceProperty
newValue, Maybe CustomLogSourceProperty
()
haddock_workaround_ :: ()
customLogSource :: Maybe CustomLogSourceProperty
haddock_workaround_ :: ()
customLogSource :: Maybe CustomLogSourceProperty
..}
instance Property "CustomLogSource" SourceProperty where
  type PropertyType "CustomLogSource" SourceProperty = CustomLogSourceProperty
  set :: PropertyType "CustomLogSource" SourceProperty
-> SourceProperty -> SourceProperty
set PropertyType "CustomLogSource" SourceProperty
newValue SourceProperty {Maybe AwsLogSourceProperty
Maybe CustomLogSourceProperty
()
haddock_workaround_ :: SourceProperty -> ()
awsLogSource :: SourceProperty -> Maybe AwsLogSourceProperty
customLogSource :: SourceProperty -> Maybe CustomLogSourceProperty
haddock_workaround_ :: ()
awsLogSource :: Maybe AwsLogSourceProperty
customLogSource :: Maybe CustomLogSourceProperty
..}
    = SourceProperty {customLogSource :: Maybe CustomLogSourceProperty
customLogSource = CustomLogSourceProperty -> Maybe CustomLogSourceProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "CustomLogSource" SourceProperty
CustomLogSourceProperty
newValue, Maybe AwsLogSourceProperty
()
haddock_workaround_ :: ()
awsLogSource :: Maybe AwsLogSourceProperty
haddock_workaround_ :: ()
awsLogSource :: Maybe AwsLogSourceProperty
..}