module Stratosphere.IoTSiteWise.AssetModel.MetricWindowProperty (
module Exports, MetricWindowProperty(..), mkMetricWindowProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.IoTSiteWise.AssetModel.TumblingWindowProperty as Exports
import Stratosphere.ResourceProperties
data MetricWindowProperty
=
MetricWindowProperty {MetricWindowProperty -> ()
haddock_workaround_ :: (),
MetricWindowProperty -> Maybe TumblingWindowProperty
tumbling :: (Prelude.Maybe TumblingWindowProperty)}
deriving stock (MetricWindowProperty -> MetricWindowProperty -> Bool
(MetricWindowProperty -> MetricWindowProperty -> Bool)
-> (MetricWindowProperty -> MetricWindowProperty -> Bool)
-> Eq MetricWindowProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MetricWindowProperty -> MetricWindowProperty -> Bool
== :: MetricWindowProperty -> MetricWindowProperty -> Bool
$c/= :: MetricWindowProperty -> MetricWindowProperty -> Bool
/= :: MetricWindowProperty -> MetricWindowProperty -> Bool
Prelude.Eq, Int -> MetricWindowProperty -> ShowS
[MetricWindowProperty] -> ShowS
MetricWindowProperty -> String
(Int -> MetricWindowProperty -> ShowS)
-> (MetricWindowProperty -> String)
-> ([MetricWindowProperty] -> ShowS)
-> Show MetricWindowProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MetricWindowProperty -> ShowS
showsPrec :: Int -> MetricWindowProperty -> ShowS
$cshow :: MetricWindowProperty -> String
show :: MetricWindowProperty -> String
$cshowList :: [MetricWindowProperty] -> ShowS
showList :: [MetricWindowProperty] -> ShowS
Prelude.Show)
mkMetricWindowProperty :: MetricWindowProperty
mkMetricWindowProperty :: MetricWindowProperty
mkMetricWindowProperty
= MetricWindowProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), tumbling :: Maybe TumblingWindowProperty
tumbling = Maybe TumblingWindowProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties MetricWindowProperty where
toResourceProperties :: MetricWindowProperty -> ResourceProperties
toResourceProperties MetricWindowProperty {Maybe TumblingWindowProperty
()
haddock_workaround_ :: MetricWindowProperty -> ()
tumbling :: MetricWindowProperty -> Maybe TumblingWindowProperty
haddock_workaround_ :: ()
tumbling :: Maybe TumblingWindowProperty
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::IoTSiteWise::AssetModel.MetricWindow",
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 -> TumblingWindowProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tumbling" (TumblingWindowProperty -> (Key, Value))
-> Maybe TumblingWindowProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TumblingWindowProperty
tumbling])}
instance JSON.ToJSON MetricWindowProperty where
toJSON :: MetricWindowProperty -> Value
toJSON MetricWindowProperty {Maybe TumblingWindowProperty
()
haddock_workaround_ :: MetricWindowProperty -> ()
tumbling :: MetricWindowProperty -> Maybe TumblingWindowProperty
haddock_workaround_ :: ()
tumbling :: Maybe TumblingWindowProperty
..}
= [(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 -> TumblingWindowProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tumbling" (TumblingWindowProperty -> (Key, Value))
-> Maybe TumblingWindowProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TumblingWindowProperty
tumbling]))
instance Property "Tumbling" MetricWindowProperty where
type PropertyType "Tumbling" MetricWindowProperty = TumblingWindowProperty
set :: PropertyType "Tumbling" MetricWindowProperty
-> MetricWindowProperty -> MetricWindowProperty
set PropertyType "Tumbling" MetricWindowProperty
newValue MetricWindowProperty {Maybe TumblingWindowProperty
()
haddock_workaround_ :: MetricWindowProperty -> ()
tumbling :: MetricWindowProperty -> Maybe TumblingWindowProperty
haddock_workaround_ :: ()
tumbling :: Maybe TumblingWindowProperty
..}
= MetricWindowProperty {tumbling :: Maybe TumblingWindowProperty
tumbling = TumblingWindowProperty -> Maybe TumblingWindowProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Tumbling" MetricWindowProperty
TumblingWindowProperty
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}