module Stratosphere.IoT.CustomMetric (
CustomMetric(..), mkCustomMetric
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data CustomMetric
=
CustomMetric {CustomMetric -> ()
haddock_workaround_ :: (),
CustomMetric -> Maybe (Value Text)
displayName :: (Prelude.Maybe (Value Prelude.Text)),
CustomMetric -> Maybe (Value Text)
metricName :: (Prelude.Maybe (Value Prelude.Text)),
CustomMetric -> Value Text
metricType :: (Value Prelude.Text),
CustomMetric -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
deriving stock (CustomMetric -> CustomMetric -> Bool
(CustomMetric -> CustomMetric -> Bool)
-> (CustomMetric -> CustomMetric -> Bool) -> Eq CustomMetric
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CustomMetric -> CustomMetric -> Bool
== :: CustomMetric -> CustomMetric -> Bool
$c/= :: CustomMetric -> CustomMetric -> Bool
/= :: CustomMetric -> CustomMetric -> Bool
Prelude.Eq, Int -> CustomMetric -> ShowS
[CustomMetric] -> ShowS
CustomMetric -> String
(Int -> CustomMetric -> ShowS)
-> (CustomMetric -> String)
-> ([CustomMetric] -> ShowS)
-> Show CustomMetric
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CustomMetric -> ShowS
showsPrec :: Int -> CustomMetric -> ShowS
$cshow :: CustomMetric -> String
show :: CustomMetric -> String
$cshowList :: [CustomMetric] -> ShowS
showList :: [CustomMetric] -> ShowS
Prelude.Show)
mkCustomMetric :: Value Prelude.Text -> CustomMetric
mkCustomMetric :: Value Text -> CustomMetric
mkCustomMetric Value Text
metricType
= CustomMetric
{haddock_workaround_ :: ()
haddock_workaround_ = (), metricType :: Value Text
metricType = Value Text
metricType,
displayName :: Maybe (Value Text)
displayName = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, metricName :: Maybe (Value Text)
metricName = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties CustomMetric where
toResourceProperties :: CustomMetric -> ResourceProperties
toResourceProperties CustomMetric {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: CustomMetric -> ()
displayName :: CustomMetric -> Maybe (Value Text)
metricName :: CustomMetric -> Maybe (Value Text)
metricType :: CustomMetric -> Value Text
tags :: CustomMetric -> Maybe [Tag]
haddock_workaround_ :: ()
displayName :: Maybe (Value Text)
metricName :: Maybe (Value Text)
metricType :: Value Text
tags :: Maybe [Tag]
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::IoT::CustomMetric", 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
"MetricType" 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
metricType]
([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
"DisplayName" (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)
displayName,
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
"MetricName" (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)
metricName,
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 CustomMetric where
toJSON :: CustomMetric -> Value
toJSON CustomMetric {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: CustomMetric -> ()
displayName :: CustomMetric -> Maybe (Value Text)
metricName :: CustomMetric -> Maybe (Value Text)
metricType :: CustomMetric -> Value Text
tags :: CustomMetric -> Maybe [Tag]
haddock_workaround_ :: ()
displayName :: Maybe (Value Text)
metricName :: Maybe (Value Text)
metricType :: Value Text
tags :: Maybe [Tag]
..}
= [(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
"MetricType" 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
metricType]
([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
"DisplayName" (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)
displayName,
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
"MetricName" (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)
metricName,
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 "DisplayName" CustomMetric where
type PropertyType "DisplayName" CustomMetric = Value Prelude.Text
set :: PropertyType "DisplayName" CustomMetric
-> CustomMetric -> CustomMetric
set PropertyType "DisplayName" CustomMetric
newValue CustomMetric {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: CustomMetric -> ()
displayName :: CustomMetric -> Maybe (Value Text)
metricName :: CustomMetric -> Maybe (Value Text)
metricType :: CustomMetric -> Value Text
tags :: CustomMetric -> Maybe [Tag]
haddock_workaround_ :: ()
displayName :: Maybe (Value Text)
metricName :: Maybe (Value Text)
metricType :: Value Text
tags :: Maybe [Tag]
..}
= CustomMetric {displayName :: Maybe (Value Text)
displayName = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "DisplayName" CustomMetric
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
metricName :: Maybe (Value Text)
metricType :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
metricName :: Maybe (Value Text)
metricType :: Value Text
tags :: Maybe [Tag]
..}
instance Property "MetricName" CustomMetric where
type PropertyType "MetricName" CustomMetric = Value Prelude.Text
set :: PropertyType "MetricName" CustomMetric
-> CustomMetric -> CustomMetric
set PropertyType "MetricName" CustomMetric
newValue CustomMetric {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: CustomMetric -> ()
displayName :: CustomMetric -> Maybe (Value Text)
metricName :: CustomMetric -> Maybe (Value Text)
metricType :: CustomMetric -> Value Text
tags :: CustomMetric -> Maybe [Tag]
haddock_workaround_ :: ()
displayName :: Maybe (Value Text)
metricName :: Maybe (Value Text)
metricType :: Value Text
tags :: Maybe [Tag]
..}
= CustomMetric {metricName :: Maybe (Value Text)
metricName = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "MetricName" CustomMetric
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
displayName :: Maybe (Value Text)
metricType :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
displayName :: Maybe (Value Text)
metricType :: Value Text
tags :: Maybe [Tag]
..}
instance Property "MetricType" CustomMetric where
type PropertyType "MetricType" CustomMetric = Value Prelude.Text
set :: PropertyType "MetricType" CustomMetric
-> CustomMetric -> CustomMetric
set PropertyType "MetricType" CustomMetric
newValue CustomMetric {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: CustomMetric -> ()
displayName :: CustomMetric -> Maybe (Value Text)
metricName :: CustomMetric -> Maybe (Value Text)
metricType :: CustomMetric -> Value Text
tags :: CustomMetric -> Maybe [Tag]
haddock_workaround_ :: ()
displayName :: Maybe (Value Text)
metricName :: Maybe (Value Text)
metricType :: Value Text
tags :: Maybe [Tag]
..}
= CustomMetric {metricType :: Value Text
metricType = PropertyType "MetricType" CustomMetric
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
haddock_workaround_ :: ()
displayName :: Maybe (Value Text)
metricName :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
displayName :: Maybe (Value Text)
metricName :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "Tags" CustomMetric where
type PropertyType "Tags" CustomMetric = [Tag]
set :: PropertyType "Tags" CustomMetric -> CustomMetric -> CustomMetric
set PropertyType "Tags" CustomMetric
newValue CustomMetric {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: CustomMetric -> ()
displayName :: CustomMetric -> Maybe (Value Text)
metricName :: CustomMetric -> Maybe (Value Text)
metricType :: CustomMetric -> Value Text
tags :: CustomMetric -> Maybe [Tag]
haddock_workaround_ :: ()
displayName :: Maybe (Value Text)
metricName :: Maybe (Value Text)
metricType :: Value Text
tags :: Maybe [Tag]
..}
= CustomMetric {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" CustomMetric
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
displayName :: Maybe (Value Text)
metricName :: Maybe (Value Text)
metricType :: Value Text
haddock_workaround_ :: ()
displayName :: Maybe (Value Text)
metricName :: Maybe (Value Text)
metricType :: Value Text
..}