module Stratosphere.Glue.Trigger.PredicateProperty (
        module Exports, PredicateProperty(..), mkPredicateProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.Glue.Trigger.ConditionProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data PredicateProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-trigger-predicate.html>
    PredicateProperty {PredicateProperty -> ()
haddock_workaround_ :: (),
                       -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-trigger-predicate.html#cfn-glue-trigger-predicate-conditions>
                       PredicateProperty -> Maybe [ConditionProperty]
conditions :: (Prelude.Maybe [ConditionProperty]),
                       -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-trigger-predicate.html#cfn-glue-trigger-predicate-logical>
                       PredicateProperty -> Maybe (Value Text)
logical :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (PredicateProperty -> PredicateProperty -> Bool
(PredicateProperty -> PredicateProperty -> Bool)
-> (PredicateProperty -> PredicateProperty -> Bool)
-> Eq PredicateProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PredicateProperty -> PredicateProperty -> Bool
== :: PredicateProperty -> PredicateProperty -> Bool
$c/= :: PredicateProperty -> PredicateProperty -> Bool
/= :: PredicateProperty -> PredicateProperty -> Bool
Prelude.Eq, Int -> PredicateProperty -> ShowS
[PredicateProperty] -> ShowS
PredicateProperty -> String
(Int -> PredicateProperty -> ShowS)
-> (PredicateProperty -> String)
-> ([PredicateProperty] -> ShowS)
-> Show PredicateProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PredicateProperty -> ShowS
showsPrec :: Int -> PredicateProperty -> ShowS
$cshow :: PredicateProperty -> String
show :: PredicateProperty -> String
$cshowList :: [PredicateProperty] -> ShowS
showList :: [PredicateProperty] -> ShowS
Prelude.Show)
mkPredicateProperty :: PredicateProperty
mkPredicateProperty :: PredicateProperty
mkPredicateProperty
  = PredicateProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), conditions :: Maybe [ConditionProperty]
conditions = Maybe [ConditionProperty]
forall a. Maybe a
Prelude.Nothing,
       logical :: Maybe (Value Text)
logical = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties PredicateProperty where
  toResourceProperties :: PredicateProperty -> ResourceProperties
toResourceProperties PredicateProperty {Maybe [ConditionProperty]
Maybe (Value Text)
()
haddock_workaround_ :: PredicateProperty -> ()
conditions :: PredicateProperty -> Maybe [ConditionProperty]
logical :: PredicateProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
conditions :: Maybe [ConditionProperty]
logical :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Glue::Trigger.Predicate",
         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 -> [ConditionProperty] -> (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" ([ConditionProperty] -> (Key, Value))
-> Maybe [ConditionProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ConditionProperty]
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
"Logical" (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)
logical])}
instance JSON.ToJSON PredicateProperty where
  toJSON :: PredicateProperty -> Value
toJSON PredicateProperty {Maybe [ConditionProperty]
Maybe (Value Text)
()
haddock_workaround_ :: PredicateProperty -> ()
conditions :: PredicateProperty -> Maybe [ConditionProperty]
logical :: PredicateProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
conditions :: Maybe [ConditionProperty]
logical :: Maybe (Value Text)
..}
    = [(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 -> [ConditionProperty] -> (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" ([ConditionProperty] -> (Key, Value))
-> Maybe [ConditionProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ConditionProperty]
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
"Logical" (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)
logical]))
instance Property "Conditions" PredicateProperty where
  type PropertyType "Conditions" PredicateProperty = [ConditionProperty]
  set :: PropertyType "Conditions" PredicateProperty
-> PredicateProperty -> PredicateProperty
set PropertyType "Conditions" PredicateProperty
newValue PredicateProperty {Maybe [ConditionProperty]
Maybe (Value Text)
()
haddock_workaround_ :: PredicateProperty -> ()
conditions :: PredicateProperty -> Maybe [ConditionProperty]
logical :: PredicateProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
conditions :: Maybe [ConditionProperty]
logical :: Maybe (Value Text)
..}
    = PredicateProperty {conditions :: Maybe [ConditionProperty]
conditions = [ConditionProperty] -> Maybe [ConditionProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [ConditionProperty]
PropertyType "Conditions" PredicateProperty
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
logical :: Maybe (Value Text)
haddock_workaround_ :: ()
logical :: Maybe (Value Text)
..}
instance Property "Logical" PredicateProperty where
  type PropertyType "Logical" PredicateProperty = Value Prelude.Text
  set :: PropertyType "Logical" PredicateProperty
-> PredicateProperty -> PredicateProperty
set PropertyType "Logical" PredicateProperty
newValue PredicateProperty {Maybe [ConditionProperty]
Maybe (Value Text)
()
haddock_workaround_ :: PredicateProperty -> ()
conditions :: PredicateProperty -> Maybe [ConditionProperty]
logical :: PredicateProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
conditions :: Maybe [ConditionProperty]
logical :: Maybe (Value Text)
..}
    = PredicateProperty {logical :: Maybe (Value Text)
logical = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Logical" PredicateProperty
Value Text
newValue, Maybe [ConditionProperty]
()
haddock_workaround_ :: ()
conditions :: Maybe [ConditionProperty]
haddock_workaround_ :: ()
conditions :: Maybe [ConditionProperty]
..}