module Stratosphere.SES.MailManagerRuleSet.RuleProperty (
        module Exports, RuleProperty(..), mkRuleProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.SES.MailManagerRuleSet.RuleActionProperty as Exports
import {-# SOURCE #-} Stratosphere.SES.MailManagerRuleSet.RuleConditionProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data RuleProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-mailmanagerruleset-rule.html>
    RuleProperty {RuleProperty -> ()
haddock_workaround_ :: (),
                  -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-mailmanagerruleset-rule.html#cfn-ses-mailmanagerruleset-rule-actions>
                  RuleProperty -> [RuleActionProperty]
actions :: [RuleActionProperty],
                  -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-mailmanagerruleset-rule.html#cfn-ses-mailmanagerruleset-rule-conditions>
                  RuleProperty -> Maybe [RuleConditionProperty]
conditions :: (Prelude.Maybe [RuleConditionProperty]),
                  -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-mailmanagerruleset-rule.html#cfn-ses-mailmanagerruleset-rule-name>
                  RuleProperty -> Maybe (Value Text)
name :: (Prelude.Maybe (Value Prelude.Text)),
                  -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-mailmanagerruleset-rule.html#cfn-ses-mailmanagerruleset-rule-unless>
                  RuleProperty -> Maybe [RuleConditionProperty]
unless :: (Prelude.Maybe [RuleConditionProperty])}
  deriving stock (RuleProperty -> RuleProperty -> Bool
(RuleProperty -> RuleProperty -> Bool)
-> (RuleProperty -> RuleProperty -> Bool) -> Eq RuleProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RuleProperty -> RuleProperty -> Bool
== :: RuleProperty -> RuleProperty -> Bool
$c/= :: RuleProperty -> RuleProperty -> Bool
/= :: RuleProperty -> RuleProperty -> Bool
Prelude.Eq, Int -> RuleProperty -> ShowS
[RuleProperty] -> ShowS
RuleProperty -> String
(Int -> RuleProperty -> ShowS)
-> (RuleProperty -> String)
-> ([RuleProperty] -> ShowS)
-> Show RuleProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RuleProperty -> ShowS
showsPrec :: Int -> RuleProperty -> ShowS
$cshow :: RuleProperty -> String
show :: RuleProperty -> String
$cshowList :: [RuleProperty] -> ShowS
showList :: [RuleProperty] -> ShowS
Prelude.Show)
mkRuleProperty :: [RuleActionProperty] -> RuleProperty
mkRuleProperty :: [RuleActionProperty] -> RuleProperty
mkRuleProperty [RuleActionProperty]
actions
  = RuleProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), actions :: [RuleActionProperty]
actions = [RuleActionProperty]
actions,
       conditions :: Maybe [RuleConditionProperty]
conditions = Maybe [RuleConditionProperty]
forall a. Maybe a
Prelude.Nothing, name :: Maybe (Value Text)
name = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       unless :: Maybe [RuleConditionProperty]
unless = Maybe [RuleConditionProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties RuleProperty where
  toResourceProperties :: RuleProperty -> ResourceProperties
toResourceProperties RuleProperty {[RuleActionProperty]
Maybe [RuleConditionProperty]
Maybe (Value Text)
()
haddock_workaround_ :: RuleProperty -> ()
actions :: RuleProperty -> [RuleActionProperty]
conditions :: RuleProperty -> Maybe [RuleConditionProperty]
name :: RuleProperty -> Maybe (Value Text)
unless :: RuleProperty -> Maybe [RuleConditionProperty]
haddock_workaround_ :: ()
actions :: [RuleActionProperty]
conditions :: Maybe [RuleConditionProperty]
name :: Maybe (Value Text)
unless :: Maybe [RuleConditionProperty]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::SES::MailManagerRuleSet.Rule",
         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
"Actions" Key -> [RuleActionProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= [RuleActionProperty]
actions]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> [RuleConditionProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Conditions" ([RuleConditionProperty] -> (Key, Value))
-> Maybe [RuleConditionProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RuleConditionProperty]
conditions,
                               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
"Name" (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)
name,
                               Key -> [RuleConditionProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Unless" ([RuleConditionProperty] -> (Key, Value))
-> Maybe [RuleConditionProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RuleConditionProperty]
unless]))}
instance JSON.ToJSON RuleProperty where
  toJSON :: RuleProperty -> Value
toJSON RuleProperty {[RuleActionProperty]
Maybe [RuleConditionProperty]
Maybe (Value Text)
()
haddock_workaround_ :: RuleProperty -> ()
actions :: RuleProperty -> [RuleActionProperty]
conditions :: RuleProperty -> Maybe [RuleConditionProperty]
name :: RuleProperty -> Maybe (Value Text)
unless :: RuleProperty -> Maybe [RuleConditionProperty]
haddock_workaround_ :: ()
actions :: [RuleActionProperty]
conditions :: Maybe [RuleConditionProperty]
name :: Maybe (Value Text)
unless :: Maybe [RuleConditionProperty]
..}
    = [(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
"Actions" Key -> [RuleActionProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= [RuleActionProperty]
actions]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> [RuleConditionProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Conditions" ([RuleConditionProperty] -> (Key, Value))
-> Maybe [RuleConditionProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RuleConditionProperty]
conditions,
                  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
"Name" (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)
name,
                  Key -> [RuleConditionProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Unless" ([RuleConditionProperty] -> (Key, Value))
-> Maybe [RuleConditionProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RuleConditionProperty]
unless])))
instance Property "Actions" RuleProperty where
  type PropertyType "Actions" RuleProperty = [RuleActionProperty]
  set :: PropertyType "Actions" RuleProperty -> RuleProperty -> RuleProperty
set PropertyType "Actions" RuleProperty
newValue RuleProperty {[RuleActionProperty]
Maybe [RuleConditionProperty]
Maybe (Value Text)
()
haddock_workaround_ :: RuleProperty -> ()
actions :: RuleProperty -> [RuleActionProperty]
conditions :: RuleProperty -> Maybe [RuleConditionProperty]
name :: RuleProperty -> Maybe (Value Text)
unless :: RuleProperty -> Maybe [RuleConditionProperty]
haddock_workaround_ :: ()
actions :: [RuleActionProperty]
conditions :: Maybe [RuleConditionProperty]
name :: Maybe (Value Text)
unless :: Maybe [RuleConditionProperty]
..}
    = RuleProperty {actions :: [RuleActionProperty]
actions = [RuleActionProperty]
PropertyType "Actions" RuleProperty
newValue, Maybe [RuleConditionProperty]
Maybe (Value Text)
()
haddock_workaround_ :: ()
conditions :: Maybe [RuleConditionProperty]
name :: Maybe (Value Text)
unless :: Maybe [RuleConditionProperty]
haddock_workaround_ :: ()
conditions :: Maybe [RuleConditionProperty]
name :: Maybe (Value Text)
unless :: Maybe [RuleConditionProperty]
..}
instance Property "Conditions" RuleProperty where
  type PropertyType "Conditions" RuleProperty = [RuleConditionProperty]
  set :: PropertyType "Conditions" RuleProperty
-> RuleProperty -> RuleProperty
set PropertyType "Conditions" RuleProperty
newValue RuleProperty {[RuleActionProperty]
Maybe [RuleConditionProperty]
Maybe (Value Text)
()
haddock_workaround_ :: RuleProperty -> ()
actions :: RuleProperty -> [RuleActionProperty]
conditions :: RuleProperty -> Maybe [RuleConditionProperty]
name :: RuleProperty -> Maybe (Value Text)
unless :: RuleProperty -> Maybe [RuleConditionProperty]
haddock_workaround_ :: ()
actions :: [RuleActionProperty]
conditions :: Maybe [RuleConditionProperty]
name :: Maybe (Value Text)
unless :: Maybe [RuleConditionProperty]
..}
    = RuleProperty {conditions :: Maybe [RuleConditionProperty]
conditions = [RuleConditionProperty] -> Maybe [RuleConditionProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [RuleConditionProperty]
PropertyType "Conditions" RuleProperty
newValue, [RuleActionProperty]
Maybe [RuleConditionProperty]
Maybe (Value Text)
()
haddock_workaround_ :: ()
actions :: [RuleActionProperty]
name :: Maybe (Value Text)
unless :: Maybe [RuleConditionProperty]
haddock_workaround_ :: ()
actions :: [RuleActionProperty]
name :: Maybe (Value Text)
unless :: Maybe [RuleConditionProperty]
..}
instance Property "Name" RuleProperty where
  type PropertyType "Name" RuleProperty = Value Prelude.Text
  set :: PropertyType "Name" RuleProperty -> RuleProperty -> RuleProperty
set PropertyType "Name" RuleProperty
newValue RuleProperty {[RuleActionProperty]
Maybe [RuleConditionProperty]
Maybe (Value Text)
()
haddock_workaround_ :: RuleProperty -> ()
actions :: RuleProperty -> [RuleActionProperty]
conditions :: RuleProperty -> Maybe [RuleConditionProperty]
name :: RuleProperty -> Maybe (Value Text)
unless :: RuleProperty -> Maybe [RuleConditionProperty]
haddock_workaround_ :: ()
actions :: [RuleActionProperty]
conditions :: Maybe [RuleConditionProperty]
name :: Maybe (Value Text)
unless :: Maybe [RuleConditionProperty]
..}
    = RuleProperty {name :: Maybe (Value Text)
name = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Name" RuleProperty
Value Text
newValue, [RuleActionProperty]
Maybe [RuleConditionProperty]
()
haddock_workaround_ :: ()
actions :: [RuleActionProperty]
conditions :: Maybe [RuleConditionProperty]
unless :: Maybe [RuleConditionProperty]
haddock_workaround_ :: ()
actions :: [RuleActionProperty]
conditions :: Maybe [RuleConditionProperty]
unless :: Maybe [RuleConditionProperty]
..}
instance Property "Unless" RuleProperty where
  type PropertyType "Unless" RuleProperty = [RuleConditionProperty]
  set :: PropertyType "Unless" RuleProperty -> RuleProperty -> RuleProperty
set PropertyType "Unless" RuleProperty
newValue RuleProperty {[RuleActionProperty]
Maybe [RuleConditionProperty]
Maybe (Value Text)
()
haddock_workaround_ :: RuleProperty -> ()
actions :: RuleProperty -> [RuleActionProperty]
conditions :: RuleProperty -> Maybe [RuleConditionProperty]
name :: RuleProperty -> Maybe (Value Text)
unless :: RuleProperty -> Maybe [RuleConditionProperty]
haddock_workaround_ :: ()
actions :: [RuleActionProperty]
conditions :: Maybe [RuleConditionProperty]
name :: Maybe (Value Text)
unless :: Maybe [RuleConditionProperty]
..}
    = RuleProperty {unless :: Maybe [RuleConditionProperty]
unless = [RuleConditionProperty] -> Maybe [RuleConditionProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [RuleConditionProperty]
PropertyType "Unless" RuleProperty
newValue, [RuleActionProperty]
Maybe [RuleConditionProperty]
Maybe (Value Text)
()
haddock_workaround_ :: ()
actions :: [RuleActionProperty]
conditions :: Maybe [RuleConditionProperty]
name :: Maybe (Value Text)
haddock_workaround_ :: ()
actions :: [RuleActionProperty]
conditions :: Maybe [RuleConditionProperty]
name :: Maybe (Value Text)
..}