module Stratosphere.Macie.AllowList.CriteriaProperty (
        module Exports, CriteriaProperty(..), mkCriteriaProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.Macie.AllowList.S3WordsListProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data CriteriaProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-macie-allowlist-criteria.html>
    CriteriaProperty {CriteriaProperty -> ()
haddock_workaround_ :: (),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-macie-allowlist-criteria.html#cfn-macie-allowlist-criteria-regex>
                      CriteriaProperty -> Maybe (Value Text)
regex :: (Prelude.Maybe (Value Prelude.Text)),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-macie-allowlist-criteria.html#cfn-macie-allowlist-criteria-s3wordslist>
                      CriteriaProperty -> Maybe S3WordsListProperty
s3WordsList :: (Prelude.Maybe S3WordsListProperty)}
  deriving stock (CriteriaProperty -> CriteriaProperty -> Bool
(CriteriaProperty -> CriteriaProperty -> Bool)
-> (CriteriaProperty -> CriteriaProperty -> Bool)
-> Eq CriteriaProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CriteriaProperty -> CriteriaProperty -> Bool
== :: CriteriaProperty -> CriteriaProperty -> Bool
$c/= :: CriteriaProperty -> CriteriaProperty -> Bool
/= :: CriteriaProperty -> CriteriaProperty -> Bool
Prelude.Eq, Int -> CriteriaProperty -> ShowS
[CriteriaProperty] -> ShowS
CriteriaProperty -> String
(Int -> CriteriaProperty -> ShowS)
-> (CriteriaProperty -> String)
-> ([CriteriaProperty] -> ShowS)
-> Show CriteriaProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CriteriaProperty -> ShowS
showsPrec :: Int -> CriteriaProperty -> ShowS
$cshow :: CriteriaProperty -> String
show :: CriteriaProperty -> String
$cshowList :: [CriteriaProperty] -> ShowS
showList :: [CriteriaProperty] -> ShowS
Prelude.Show)
mkCriteriaProperty :: CriteriaProperty
mkCriteriaProperty :: CriteriaProperty
mkCriteriaProperty
  = CriteriaProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), regex :: Maybe (Value Text)
regex = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       s3WordsList :: Maybe S3WordsListProperty
s3WordsList = Maybe S3WordsListProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties CriteriaProperty where
  toResourceProperties :: CriteriaProperty -> ResourceProperties
toResourceProperties CriteriaProperty {Maybe (Value Text)
Maybe S3WordsListProperty
()
haddock_workaround_ :: CriteriaProperty -> ()
regex :: CriteriaProperty -> Maybe (Value Text)
s3WordsList :: CriteriaProperty -> Maybe S3WordsListProperty
haddock_workaround_ :: ()
regex :: Maybe (Value Text)
s3WordsList :: Maybe S3WordsListProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Macie::AllowList.Criteria",
         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 -> 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
"Regex" (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)
regex,
                            Key -> S3WordsListProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"S3WordsList" (S3WordsListProperty -> (Key, Value))
-> Maybe S3WordsListProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3WordsListProperty
s3WordsList])}
instance JSON.ToJSON CriteriaProperty where
  toJSON :: CriteriaProperty -> Value
toJSON CriteriaProperty {Maybe (Value Text)
Maybe S3WordsListProperty
()
haddock_workaround_ :: CriteriaProperty -> ()
regex :: CriteriaProperty -> Maybe (Value Text)
s3WordsList :: CriteriaProperty -> Maybe S3WordsListProperty
haddock_workaround_ :: ()
regex :: Maybe (Value Text)
s3WordsList :: Maybe S3WordsListProperty
..}
    = [(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 -> 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
"Regex" (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)
regex,
               Key -> S3WordsListProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"S3WordsList" (S3WordsListProperty -> (Key, Value))
-> Maybe S3WordsListProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3WordsListProperty
s3WordsList]))
instance Property "Regex" CriteriaProperty where
  type PropertyType "Regex" CriteriaProperty = Value Prelude.Text
  set :: PropertyType "Regex" CriteriaProperty
-> CriteriaProperty -> CriteriaProperty
set PropertyType "Regex" CriteriaProperty
newValue CriteriaProperty {Maybe (Value Text)
Maybe S3WordsListProperty
()
haddock_workaround_ :: CriteriaProperty -> ()
regex :: CriteriaProperty -> Maybe (Value Text)
s3WordsList :: CriteriaProperty -> Maybe S3WordsListProperty
haddock_workaround_ :: ()
regex :: Maybe (Value Text)
s3WordsList :: Maybe S3WordsListProperty
..}
    = CriteriaProperty {regex :: Maybe (Value Text)
regex = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Regex" CriteriaProperty
Value Text
newValue, Maybe S3WordsListProperty
()
haddock_workaround_ :: ()
s3WordsList :: Maybe S3WordsListProperty
haddock_workaround_ :: ()
s3WordsList :: Maybe S3WordsListProperty
..}
instance Property "S3WordsList" CriteriaProperty where
  type PropertyType "S3WordsList" CriteriaProperty = S3WordsListProperty
  set :: PropertyType "S3WordsList" CriteriaProperty
-> CriteriaProperty -> CriteriaProperty
set PropertyType "S3WordsList" CriteriaProperty
newValue CriteriaProperty {Maybe (Value Text)
Maybe S3WordsListProperty
()
haddock_workaround_ :: CriteriaProperty -> ()
regex :: CriteriaProperty -> Maybe (Value Text)
s3WordsList :: CriteriaProperty -> Maybe S3WordsListProperty
haddock_workaround_ :: ()
regex :: Maybe (Value Text)
s3WordsList :: Maybe S3WordsListProperty
..}
    = CriteriaProperty {s3WordsList :: Maybe S3WordsListProperty
s3WordsList = S3WordsListProperty -> Maybe S3WordsListProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "S3WordsList" CriteriaProperty
S3WordsListProperty
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
regex :: Maybe (Value Text)
haddock_workaround_ :: ()
regex :: Maybe (Value Text)
..}