module Stratosphere.IoTAnalytics.Dataset.QueryActionProperty (
        module Exports, QueryActionProperty(..), mkQueryActionProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.IoTAnalytics.Dataset.FilterProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data QueryActionProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-dataset-queryaction.html>
    QueryActionProperty {QueryActionProperty -> ()
haddock_workaround_ :: (),
                         -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-dataset-queryaction.html#cfn-iotanalytics-dataset-queryaction-filters>
                         QueryActionProperty -> Maybe [FilterProperty]
filters :: (Prelude.Maybe [FilterProperty]),
                         -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-dataset-queryaction.html#cfn-iotanalytics-dataset-queryaction-sqlquery>
                         QueryActionProperty -> Value Text
sqlQuery :: (Value Prelude.Text)}
  deriving stock (QueryActionProperty -> QueryActionProperty -> Bool
(QueryActionProperty -> QueryActionProperty -> Bool)
-> (QueryActionProperty -> QueryActionProperty -> Bool)
-> Eq QueryActionProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: QueryActionProperty -> QueryActionProperty -> Bool
== :: QueryActionProperty -> QueryActionProperty -> Bool
$c/= :: QueryActionProperty -> QueryActionProperty -> Bool
/= :: QueryActionProperty -> QueryActionProperty -> Bool
Prelude.Eq, Int -> QueryActionProperty -> ShowS
[QueryActionProperty] -> ShowS
QueryActionProperty -> String
(Int -> QueryActionProperty -> ShowS)
-> (QueryActionProperty -> String)
-> ([QueryActionProperty] -> ShowS)
-> Show QueryActionProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> QueryActionProperty -> ShowS
showsPrec :: Int -> QueryActionProperty -> ShowS
$cshow :: QueryActionProperty -> String
show :: QueryActionProperty -> String
$cshowList :: [QueryActionProperty] -> ShowS
showList :: [QueryActionProperty] -> ShowS
Prelude.Show)
mkQueryActionProperty :: Value Prelude.Text -> QueryActionProperty
mkQueryActionProperty :: Value Text -> QueryActionProperty
mkQueryActionProperty Value Text
sqlQuery
  = QueryActionProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), sqlQuery :: Value Text
sqlQuery = Value Text
sqlQuery,
       filters :: Maybe [FilterProperty]
filters = Maybe [FilterProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties QueryActionProperty where
  toResourceProperties :: QueryActionProperty -> ResourceProperties
toResourceProperties QueryActionProperty {Maybe [FilterProperty]
()
Value Text
haddock_workaround_ :: QueryActionProperty -> ()
filters :: QueryActionProperty -> Maybe [FilterProperty]
sqlQuery :: QueryActionProperty -> Value Text
haddock_workaround_ :: ()
filters :: Maybe [FilterProperty]
sqlQuery :: Value Text
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::IoTAnalytics::Dataset.QueryAction",
         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
"SqlQuery" 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
sqlQuery]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [FilterProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Filters" ([FilterProperty] -> (Key, Value))
-> Maybe [FilterProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [FilterProperty]
filters]))}
instance JSON.ToJSON QueryActionProperty where
  toJSON :: QueryActionProperty -> Value
toJSON QueryActionProperty {Maybe [FilterProperty]
()
Value Text
haddock_workaround_ :: QueryActionProperty -> ()
filters :: QueryActionProperty -> Maybe [FilterProperty]
sqlQuery :: QueryActionProperty -> Value Text
haddock_workaround_ :: ()
filters :: Maybe [FilterProperty]
sqlQuery :: Value Text
..}
    = [(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
"SqlQuery" 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
sqlQuery]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [FilterProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Filters" ([FilterProperty] -> (Key, Value))
-> Maybe [FilterProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [FilterProperty]
filters])))
instance Property "Filters" QueryActionProperty where
  type PropertyType "Filters" QueryActionProperty = [FilterProperty]
  set :: PropertyType "Filters" QueryActionProperty
-> QueryActionProperty -> QueryActionProperty
set PropertyType "Filters" QueryActionProperty
newValue QueryActionProperty {Maybe [FilterProperty]
()
Value Text
haddock_workaround_ :: QueryActionProperty -> ()
filters :: QueryActionProperty -> Maybe [FilterProperty]
sqlQuery :: QueryActionProperty -> Value Text
haddock_workaround_ :: ()
filters :: Maybe [FilterProperty]
sqlQuery :: Value Text
..}
    = QueryActionProperty {filters :: Maybe [FilterProperty]
filters = [FilterProperty] -> Maybe [FilterProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [FilterProperty]
PropertyType "Filters" QueryActionProperty
newValue, ()
Value Text
haddock_workaround_ :: ()
sqlQuery :: Value Text
haddock_workaround_ :: ()
sqlQuery :: Value Text
..}
instance Property "SqlQuery" QueryActionProperty where
  type PropertyType "SqlQuery" QueryActionProperty = Value Prelude.Text
  set :: PropertyType "SqlQuery" QueryActionProperty
-> QueryActionProperty -> QueryActionProperty
set PropertyType "SqlQuery" QueryActionProperty
newValue QueryActionProperty {Maybe [FilterProperty]
()
Value Text
haddock_workaround_ :: QueryActionProperty -> ()
filters :: QueryActionProperty -> Maybe [FilterProperty]
sqlQuery :: QueryActionProperty -> Value Text
haddock_workaround_ :: ()
filters :: Maybe [FilterProperty]
sqlQuery :: Value Text
..}
    = QueryActionProperty {sqlQuery :: Value Text
sqlQuery = PropertyType "SqlQuery" QueryActionProperty
Value Text
newValue, Maybe [FilterProperty]
()
haddock_workaround_ :: ()
filters :: Maybe [FilterProperty]
haddock_workaround_ :: ()
filters :: Maybe [FilterProperty]
..}