module Stratosphere.GuardDuty.PublishingDestination (
        module Exports, PublishingDestination(..), mkPublishingDestination
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.GuardDuty.PublishingDestination.CFNDestinationPropertiesProperty as Exports
import {-# SOURCE #-} Stratosphere.GuardDuty.PublishingDestination.TagItemProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data PublishingDestination
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-guardduty-publishingdestination.html>
    PublishingDestination {PublishingDestination -> ()
haddock_workaround_ :: (),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-guardduty-publishingdestination.html#cfn-guardduty-publishingdestination-destinationproperties>
                           PublishingDestination -> CFNDestinationPropertiesProperty
destinationProperties :: CFNDestinationPropertiesProperty,
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-guardduty-publishingdestination.html#cfn-guardduty-publishingdestination-destinationtype>
                           PublishingDestination -> Value Text
destinationType :: (Value Prelude.Text),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-guardduty-publishingdestination.html#cfn-guardduty-publishingdestination-detectorid>
                           PublishingDestination -> Value Text
detectorId :: (Value Prelude.Text),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-guardduty-publishingdestination.html#cfn-guardduty-publishingdestination-tags>
                           PublishingDestination -> Maybe [TagItemProperty]
tags :: (Prelude.Maybe [TagItemProperty])}
  deriving stock (PublishingDestination -> PublishingDestination -> Bool
(PublishingDestination -> PublishingDestination -> Bool)
-> (PublishingDestination -> PublishingDestination -> Bool)
-> Eq PublishingDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PublishingDestination -> PublishingDestination -> Bool
== :: PublishingDestination -> PublishingDestination -> Bool
$c/= :: PublishingDestination -> PublishingDestination -> Bool
/= :: PublishingDestination -> PublishingDestination -> Bool
Prelude.Eq, Int -> PublishingDestination -> ShowS
[PublishingDestination] -> ShowS
PublishingDestination -> String
(Int -> PublishingDestination -> ShowS)
-> (PublishingDestination -> String)
-> ([PublishingDestination] -> ShowS)
-> Show PublishingDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PublishingDestination -> ShowS
showsPrec :: Int -> PublishingDestination -> ShowS
$cshow :: PublishingDestination -> String
show :: PublishingDestination -> String
$cshowList :: [PublishingDestination] -> ShowS
showList :: [PublishingDestination] -> ShowS
Prelude.Show)
mkPublishingDestination ::
  CFNDestinationPropertiesProperty
  -> Value Prelude.Text
     -> Value Prelude.Text -> PublishingDestination
mkPublishingDestination :: CFNDestinationPropertiesProperty
-> Value Text -> Value Text -> PublishingDestination
mkPublishingDestination
  CFNDestinationPropertiesProperty
destinationProperties
  Value Text
destinationType
  Value Text
detectorId
  = PublishingDestination
      {haddock_workaround_ :: ()
haddock_workaround_ = (),
       destinationProperties :: CFNDestinationPropertiesProperty
destinationProperties = CFNDestinationPropertiesProperty
destinationProperties,
       destinationType :: Value Text
destinationType = Value Text
destinationType, detectorId :: Value Text
detectorId = Value Text
detectorId,
       tags :: Maybe [TagItemProperty]
tags = Maybe [TagItemProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties PublishingDestination where
  toResourceProperties :: PublishingDestination -> ResourceProperties
toResourceProperties PublishingDestination {Maybe [TagItemProperty]
()
Value Text
CFNDestinationPropertiesProperty
haddock_workaround_ :: PublishingDestination -> ()
destinationProperties :: PublishingDestination -> CFNDestinationPropertiesProperty
destinationType :: PublishingDestination -> Value Text
detectorId :: PublishingDestination -> Value Text
tags :: PublishingDestination -> Maybe [TagItemProperty]
haddock_workaround_ :: ()
destinationProperties :: CFNDestinationPropertiesProperty
destinationType :: Value Text
detectorId :: Value Text
tags :: Maybe [TagItemProperty]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::GuardDuty::PublishingDestination",
         supportsTags :: Bool
supportsTags = Bool
Prelude.True,
         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
"DestinationProperties" Key -> CFNDestinationPropertiesProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= CFNDestinationPropertiesProperty
destinationProperties,
                            Key
"DestinationType" 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
destinationType,
                            Key
"DetectorId" 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
detectorId]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [TagItemProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([TagItemProperty] -> (Key, Value))
-> Maybe [TagItemProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TagItemProperty]
tags]))}
instance JSON.ToJSON PublishingDestination where
  toJSON :: PublishingDestination -> Value
toJSON PublishingDestination {Maybe [TagItemProperty]
()
Value Text
CFNDestinationPropertiesProperty
haddock_workaround_ :: PublishingDestination -> ()
destinationProperties :: PublishingDestination -> CFNDestinationPropertiesProperty
destinationType :: PublishingDestination -> Value Text
detectorId :: PublishingDestination -> Value Text
tags :: PublishingDestination -> Maybe [TagItemProperty]
haddock_workaround_ :: ()
destinationProperties :: CFNDestinationPropertiesProperty
destinationType :: Value Text
detectorId :: Value Text
tags :: Maybe [TagItemProperty]
..}
    = [(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
"DestinationProperties" Key -> CFNDestinationPropertiesProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= CFNDestinationPropertiesProperty
destinationProperties,
               Key
"DestinationType" 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
destinationType,
               Key
"DetectorId" 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
detectorId]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [TagItemProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([TagItemProperty] -> (Key, Value))
-> Maybe [TagItemProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TagItemProperty]
tags])))
instance Property "DestinationProperties" PublishingDestination where
  type PropertyType "DestinationProperties" PublishingDestination = CFNDestinationPropertiesProperty
  set :: PropertyType "DestinationProperties" PublishingDestination
-> PublishingDestination -> PublishingDestination
set PropertyType "DestinationProperties" PublishingDestination
newValue PublishingDestination {Maybe [TagItemProperty]
()
Value Text
CFNDestinationPropertiesProperty
haddock_workaround_ :: PublishingDestination -> ()
destinationProperties :: PublishingDestination -> CFNDestinationPropertiesProperty
destinationType :: PublishingDestination -> Value Text
detectorId :: PublishingDestination -> Value Text
tags :: PublishingDestination -> Maybe [TagItemProperty]
haddock_workaround_ :: ()
destinationProperties :: CFNDestinationPropertiesProperty
destinationType :: Value Text
detectorId :: Value Text
tags :: Maybe [TagItemProperty]
..}
    = PublishingDestination {destinationProperties :: CFNDestinationPropertiesProperty
destinationProperties = PropertyType "DestinationProperties" PublishingDestination
CFNDestinationPropertiesProperty
newValue, Maybe [TagItemProperty]
()
Value Text
haddock_workaround_ :: ()
destinationType :: Value Text
detectorId :: Value Text
tags :: Maybe [TagItemProperty]
haddock_workaround_ :: ()
destinationType :: Value Text
detectorId :: Value Text
tags :: Maybe [TagItemProperty]
..}
instance Property "DestinationType" PublishingDestination where
  type PropertyType "DestinationType" PublishingDestination = Value Prelude.Text
  set :: PropertyType "DestinationType" PublishingDestination
-> PublishingDestination -> PublishingDestination
set PropertyType "DestinationType" PublishingDestination
newValue PublishingDestination {Maybe [TagItemProperty]
()
Value Text
CFNDestinationPropertiesProperty
haddock_workaround_ :: PublishingDestination -> ()
destinationProperties :: PublishingDestination -> CFNDestinationPropertiesProperty
destinationType :: PublishingDestination -> Value Text
detectorId :: PublishingDestination -> Value Text
tags :: PublishingDestination -> Maybe [TagItemProperty]
haddock_workaround_ :: ()
destinationProperties :: CFNDestinationPropertiesProperty
destinationType :: Value Text
detectorId :: Value Text
tags :: Maybe [TagItemProperty]
..}
    = PublishingDestination {destinationType :: Value Text
destinationType = PropertyType "DestinationType" PublishingDestination
Value Text
newValue, Maybe [TagItemProperty]
()
Value Text
CFNDestinationPropertiesProperty
haddock_workaround_ :: ()
destinationProperties :: CFNDestinationPropertiesProperty
detectorId :: Value Text
tags :: Maybe [TagItemProperty]
haddock_workaround_ :: ()
destinationProperties :: CFNDestinationPropertiesProperty
detectorId :: Value Text
tags :: Maybe [TagItemProperty]
..}
instance Property "DetectorId" PublishingDestination where
  type PropertyType "DetectorId" PublishingDestination = Value Prelude.Text
  set :: PropertyType "DetectorId" PublishingDestination
-> PublishingDestination -> PublishingDestination
set PropertyType "DetectorId" PublishingDestination
newValue PublishingDestination {Maybe [TagItemProperty]
()
Value Text
CFNDestinationPropertiesProperty
haddock_workaround_ :: PublishingDestination -> ()
destinationProperties :: PublishingDestination -> CFNDestinationPropertiesProperty
destinationType :: PublishingDestination -> Value Text
detectorId :: PublishingDestination -> Value Text
tags :: PublishingDestination -> Maybe [TagItemProperty]
haddock_workaround_ :: ()
destinationProperties :: CFNDestinationPropertiesProperty
destinationType :: Value Text
detectorId :: Value Text
tags :: Maybe [TagItemProperty]
..}
    = PublishingDestination {detectorId :: Value Text
detectorId = PropertyType "DetectorId" PublishingDestination
Value Text
newValue, Maybe [TagItemProperty]
()
Value Text
CFNDestinationPropertiesProperty
haddock_workaround_ :: ()
destinationProperties :: CFNDestinationPropertiesProperty
destinationType :: Value Text
tags :: Maybe [TagItemProperty]
haddock_workaround_ :: ()
destinationProperties :: CFNDestinationPropertiesProperty
destinationType :: Value Text
tags :: Maybe [TagItemProperty]
..}
instance Property "Tags" PublishingDestination where
  type PropertyType "Tags" PublishingDestination = [TagItemProperty]
  set :: PropertyType "Tags" PublishingDestination
-> PublishingDestination -> PublishingDestination
set PropertyType "Tags" PublishingDestination
newValue PublishingDestination {Maybe [TagItemProperty]
()
Value Text
CFNDestinationPropertiesProperty
haddock_workaround_ :: PublishingDestination -> ()
destinationProperties :: PublishingDestination -> CFNDestinationPropertiesProperty
destinationType :: PublishingDestination -> Value Text
detectorId :: PublishingDestination -> Value Text
tags :: PublishingDestination -> Maybe [TagItemProperty]
haddock_workaround_ :: ()
destinationProperties :: CFNDestinationPropertiesProperty
destinationType :: Value Text
detectorId :: Value Text
tags :: Maybe [TagItemProperty]
..}
    = PublishingDestination {tags :: Maybe [TagItemProperty]
tags = [TagItemProperty] -> Maybe [TagItemProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [TagItemProperty]
PropertyType "Tags" PublishingDestination
newValue, ()
Value Text
CFNDestinationPropertiesProperty
haddock_workaround_ :: ()
destinationProperties :: CFNDestinationPropertiesProperty
destinationType :: Value Text
detectorId :: Value Text
haddock_workaround_ :: ()
destinationProperties :: CFNDestinationPropertiesProperty
destinationType :: Value Text
detectorId :: Value Text
..}