module Stratosphere.Connect.Rule (
        module Exports, Rule(..), mkRule
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.Connect.Rule.ActionsProperty as Exports
import {-# SOURCE #-} Stratosphere.Connect.Rule.RuleTriggerEventSourceProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data Rule
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-rule.html>
    Rule {Rule -> ()
haddock_workaround_ :: (),
          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-rule.html#cfn-connect-rule-actions>
          Rule -> ActionsProperty
actions :: ActionsProperty,
          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-rule.html#cfn-connect-rule-function>
          Rule -> Value Text
function :: (Value Prelude.Text),
          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-rule.html#cfn-connect-rule-instancearn>
          Rule -> Value Text
instanceArn :: (Value Prelude.Text),
          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-rule.html#cfn-connect-rule-name>
          Rule -> Value Text
name :: (Value Prelude.Text),
          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-rule.html#cfn-connect-rule-publishstatus>
          Rule -> Value Text
publishStatus :: (Value Prelude.Text),
          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-rule.html#cfn-connect-rule-tags>
          Rule -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag]),
          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-connect-rule.html#cfn-connect-rule-triggereventsource>
          Rule -> RuleTriggerEventSourceProperty
triggerEventSource :: RuleTriggerEventSourceProperty}
  deriving stock (Rule -> Rule -> Bool
(Rule -> Rule -> Bool) -> (Rule -> Rule -> Bool) -> Eq Rule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Rule -> Rule -> Bool
== :: Rule -> Rule -> Bool
$c/= :: Rule -> Rule -> Bool
/= :: Rule -> Rule -> Bool
Prelude.Eq, Int -> Rule -> ShowS
[Rule] -> ShowS
Rule -> String
(Int -> Rule -> ShowS)
-> (Rule -> String) -> ([Rule] -> ShowS) -> Show Rule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Rule -> ShowS
showsPrec :: Int -> Rule -> ShowS
$cshow :: Rule -> String
show :: Rule -> String
$cshowList :: [Rule] -> ShowS
showList :: [Rule] -> ShowS
Prelude.Show)
mkRule ::
  ActionsProperty
  -> Value Prelude.Text
     -> Value Prelude.Text
        -> Value Prelude.Text
           -> Value Prelude.Text -> RuleTriggerEventSourceProperty -> Rule
mkRule :: ActionsProperty
-> Value Text
-> Value Text
-> Value Text
-> Value Text
-> RuleTriggerEventSourceProperty
-> Rule
mkRule
  ActionsProperty
actions
  Value Text
function
  Value Text
instanceArn
  Value Text
name
  Value Text
publishStatus
  RuleTriggerEventSourceProperty
triggerEventSource
  = Rule
      {haddock_workaround_ :: ()
haddock_workaround_ = (), actions :: ActionsProperty
actions = ActionsProperty
actions, function :: Value Text
function = Value Text
function,
       instanceArn :: Value Text
instanceArn = Value Text
instanceArn, name :: Value Text
name = Value Text
name,
       publishStatus :: Value Text
publishStatus = Value Text
publishStatus,
       triggerEventSource :: RuleTriggerEventSourceProperty
triggerEventSource = RuleTriggerEventSourceProperty
triggerEventSource, tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Rule where
  toResourceProperties :: Rule -> ResourceProperties
toResourceProperties Rule {Maybe [Tag]
()
Value Text
RuleTriggerEventSourceProperty
ActionsProperty
haddock_workaround_ :: Rule -> ()
actions :: Rule -> ActionsProperty
function :: Rule -> Value Text
instanceArn :: Rule -> Value Text
name :: Rule -> Value Text
publishStatus :: Rule -> Value Text
tags :: Rule -> Maybe [Tag]
triggerEventSource :: Rule -> RuleTriggerEventSourceProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
instanceArn :: Value Text
name :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Connect::Rule", 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
"Actions" Key -> ActionsProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ActionsProperty
actions, Key
"Function" 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
function,
                            Key
"InstanceArn" 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
instanceArn, Key
"Name" 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
name,
                            Key
"PublishStatus" 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
publishStatus,
                            Key
"TriggerEventSource" Key -> RuleTriggerEventSourceProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= RuleTriggerEventSourceProperty
triggerEventSource]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [Tag] -> (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" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))}
instance JSON.ToJSON Rule where
  toJSON :: Rule -> Value
toJSON Rule {Maybe [Tag]
()
Value Text
RuleTriggerEventSourceProperty
ActionsProperty
haddock_workaround_ :: Rule -> ()
actions :: Rule -> ActionsProperty
function :: Rule -> Value Text
instanceArn :: Rule -> Value Text
name :: Rule -> Value Text
publishStatus :: Rule -> Value Text
tags :: Rule -> Maybe [Tag]
triggerEventSource :: Rule -> RuleTriggerEventSourceProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
instanceArn :: Value Text
name :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
..}
    = [(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 -> ActionsProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ActionsProperty
actions, Key
"Function" 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
function,
               Key
"InstanceArn" 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
instanceArn, Key
"Name" 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
name,
               Key
"PublishStatus" 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
publishStatus,
               Key
"TriggerEventSource" Key -> RuleTriggerEventSourceProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= RuleTriggerEventSourceProperty
triggerEventSource]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [Tag] -> (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" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])))
instance Property "Actions" Rule where
  type PropertyType "Actions" Rule = ActionsProperty
  set :: PropertyType "Actions" Rule -> Rule -> Rule
set PropertyType "Actions" Rule
newValue Rule {Maybe [Tag]
()
Value Text
RuleTriggerEventSourceProperty
ActionsProperty
haddock_workaround_ :: Rule -> ()
actions :: Rule -> ActionsProperty
function :: Rule -> Value Text
instanceArn :: Rule -> Value Text
name :: Rule -> Value Text
publishStatus :: Rule -> Value Text
tags :: Rule -> Maybe [Tag]
triggerEventSource :: Rule -> RuleTriggerEventSourceProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
instanceArn :: Value Text
name :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
..} = Rule {actions :: ActionsProperty
actions = PropertyType "Actions" Rule
ActionsProperty
newValue, Maybe [Tag]
()
Value Text
RuleTriggerEventSourceProperty
haddock_workaround_ :: ()
function :: Value Text
instanceArn :: Value Text
name :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
haddock_workaround_ :: ()
function :: Value Text
instanceArn :: Value Text
name :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
..}
instance Property "Function" Rule where
  type PropertyType "Function" Rule = Value Prelude.Text
  set :: PropertyType "Function" Rule -> Rule -> Rule
set PropertyType "Function" Rule
newValue Rule {Maybe [Tag]
()
Value Text
RuleTriggerEventSourceProperty
ActionsProperty
haddock_workaround_ :: Rule -> ()
actions :: Rule -> ActionsProperty
function :: Rule -> Value Text
instanceArn :: Rule -> Value Text
name :: Rule -> Value Text
publishStatus :: Rule -> Value Text
tags :: Rule -> Maybe [Tag]
triggerEventSource :: Rule -> RuleTriggerEventSourceProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
instanceArn :: Value Text
name :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
..} = Rule {function :: Value Text
function = PropertyType "Function" Rule
Value Text
newValue, Maybe [Tag]
()
Value Text
RuleTriggerEventSourceProperty
ActionsProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
instanceArn :: Value Text
name :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
instanceArn :: Value Text
name :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
..}
instance Property "InstanceArn" Rule where
  type PropertyType "InstanceArn" Rule = Value Prelude.Text
  set :: PropertyType "InstanceArn" Rule -> Rule -> Rule
set PropertyType "InstanceArn" Rule
newValue Rule {Maybe [Tag]
()
Value Text
RuleTriggerEventSourceProperty
ActionsProperty
haddock_workaround_ :: Rule -> ()
actions :: Rule -> ActionsProperty
function :: Rule -> Value Text
instanceArn :: Rule -> Value Text
name :: Rule -> Value Text
publishStatus :: Rule -> Value Text
tags :: Rule -> Maybe [Tag]
triggerEventSource :: Rule -> RuleTriggerEventSourceProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
instanceArn :: Value Text
name :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
..} = Rule {instanceArn :: Value Text
instanceArn = PropertyType "InstanceArn" Rule
Value Text
newValue, Maybe [Tag]
()
Value Text
RuleTriggerEventSourceProperty
ActionsProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
name :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
name :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
..}
instance Property "Name" Rule where
  type PropertyType "Name" Rule = Value Prelude.Text
  set :: PropertyType "Name" Rule -> Rule -> Rule
set PropertyType "Name" Rule
newValue Rule {Maybe [Tag]
()
Value Text
RuleTriggerEventSourceProperty
ActionsProperty
haddock_workaround_ :: Rule -> ()
actions :: Rule -> ActionsProperty
function :: Rule -> Value Text
instanceArn :: Rule -> Value Text
name :: Rule -> Value Text
publishStatus :: Rule -> Value Text
tags :: Rule -> Maybe [Tag]
triggerEventSource :: Rule -> RuleTriggerEventSourceProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
instanceArn :: Value Text
name :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
..} = Rule {name :: Value Text
name = PropertyType "Name" Rule
Value Text
newValue, Maybe [Tag]
()
Value Text
RuleTriggerEventSourceProperty
ActionsProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
instanceArn :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
instanceArn :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
..}
instance Property "PublishStatus" Rule where
  type PropertyType "PublishStatus" Rule = Value Prelude.Text
  set :: PropertyType "PublishStatus" Rule -> Rule -> Rule
set PropertyType "PublishStatus" Rule
newValue Rule {Maybe [Tag]
()
Value Text
RuleTriggerEventSourceProperty
ActionsProperty
haddock_workaround_ :: Rule -> ()
actions :: Rule -> ActionsProperty
function :: Rule -> Value Text
instanceArn :: Rule -> Value Text
name :: Rule -> Value Text
publishStatus :: Rule -> Value Text
tags :: Rule -> Maybe [Tag]
triggerEventSource :: Rule -> RuleTriggerEventSourceProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
instanceArn :: Value Text
name :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
..} = Rule {publishStatus :: Value Text
publishStatus = PropertyType "PublishStatus" Rule
Value Text
newValue, Maybe [Tag]
()
Value Text
RuleTriggerEventSourceProperty
ActionsProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
instanceArn :: Value Text
name :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
instanceArn :: Value Text
name :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
..}
instance Property "Tags" Rule where
  type PropertyType "Tags" Rule = [Tag]
  set :: PropertyType "Tags" Rule -> Rule -> Rule
set PropertyType "Tags" Rule
newValue Rule {Maybe [Tag]
()
Value Text
RuleTriggerEventSourceProperty
ActionsProperty
haddock_workaround_ :: Rule -> ()
actions :: Rule -> ActionsProperty
function :: Rule -> Value Text
instanceArn :: Rule -> Value Text
name :: Rule -> Value Text
publishStatus :: Rule -> Value Text
tags :: Rule -> Maybe [Tag]
triggerEventSource :: Rule -> RuleTriggerEventSourceProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
instanceArn :: Value Text
name :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
..} = Rule {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" Rule
newValue, ()
Value Text
RuleTriggerEventSourceProperty
ActionsProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
instanceArn :: Value Text
name :: Value Text
publishStatus :: Value Text
triggerEventSource :: RuleTriggerEventSourceProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
instanceArn :: Value Text
name :: Value Text
publishStatus :: Value Text
triggerEventSource :: RuleTriggerEventSourceProperty
..}
instance Property "TriggerEventSource" Rule where
  type PropertyType "TriggerEventSource" Rule = RuleTriggerEventSourceProperty
  set :: PropertyType "TriggerEventSource" Rule -> Rule -> Rule
set PropertyType "TriggerEventSource" Rule
newValue Rule {Maybe [Tag]
()
Value Text
RuleTriggerEventSourceProperty
ActionsProperty
haddock_workaround_ :: Rule -> ()
actions :: Rule -> ActionsProperty
function :: Rule -> Value Text
instanceArn :: Rule -> Value Text
name :: Rule -> Value Text
publishStatus :: Rule -> Value Text
tags :: Rule -> Maybe [Tag]
triggerEventSource :: Rule -> RuleTriggerEventSourceProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
instanceArn :: Value Text
name :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
triggerEventSource :: RuleTriggerEventSourceProperty
..} = Rule {triggerEventSource :: RuleTriggerEventSourceProperty
triggerEventSource = PropertyType "TriggerEventSource" Rule
RuleTriggerEventSourceProperty
newValue, Maybe [Tag]
()
Value Text
ActionsProperty
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
instanceArn :: Value Text
name :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
actions :: ActionsProperty
function :: Value Text
instanceArn :: Value Text
name :: Value Text
publishStatus :: Value Text
tags :: Maybe [Tag]
..}