{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.IoT.Types.StatisticalThreshold where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StatisticalThreshold = StatisticalThreshold'
{
StatisticalThreshold -> Maybe Text
statistic :: Prelude.Maybe Prelude.Text
}
deriving (StatisticalThreshold -> StatisticalThreshold -> Bool
(StatisticalThreshold -> StatisticalThreshold -> Bool)
-> (StatisticalThreshold -> StatisticalThreshold -> Bool)
-> Eq StatisticalThreshold
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StatisticalThreshold -> StatisticalThreshold -> Bool
$c/= :: StatisticalThreshold -> StatisticalThreshold -> Bool
== :: StatisticalThreshold -> StatisticalThreshold -> Bool
$c== :: StatisticalThreshold -> StatisticalThreshold -> Bool
Prelude.Eq, ReadPrec [StatisticalThreshold]
ReadPrec StatisticalThreshold
Int -> ReadS StatisticalThreshold
ReadS [StatisticalThreshold]
(Int -> ReadS StatisticalThreshold)
-> ReadS [StatisticalThreshold]
-> ReadPrec StatisticalThreshold
-> ReadPrec [StatisticalThreshold]
-> Read StatisticalThreshold
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StatisticalThreshold]
$creadListPrec :: ReadPrec [StatisticalThreshold]
readPrec :: ReadPrec StatisticalThreshold
$creadPrec :: ReadPrec StatisticalThreshold
readList :: ReadS [StatisticalThreshold]
$creadList :: ReadS [StatisticalThreshold]
readsPrec :: Int -> ReadS StatisticalThreshold
$creadsPrec :: Int -> ReadS StatisticalThreshold
Prelude.Read, Int -> StatisticalThreshold -> ShowS
[StatisticalThreshold] -> ShowS
StatisticalThreshold -> String
(Int -> StatisticalThreshold -> ShowS)
-> (StatisticalThreshold -> String)
-> ([StatisticalThreshold] -> ShowS)
-> Show StatisticalThreshold
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StatisticalThreshold] -> ShowS
$cshowList :: [StatisticalThreshold] -> ShowS
show :: StatisticalThreshold -> String
$cshow :: StatisticalThreshold -> String
showsPrec :: Int -> StatisticalThreshold -> ShowS
$cshowsPrec :: Int -> StatisticalThreshold -> ShowS
Prelude.Show, (forall x. StatisticalThreshold -> Rep StatisticalThreshold x)
-> (forall x. Rep StatisticalThreshold x -> StatisticalThreshold)
-> Generic StatisticalThreshold
forall x. Rep StatisticalThreshold x -> StatisticalThreshold
forall x. StatisticalThreshold -> Rep StatisticalThreshold x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StatisticalThreshold x -> StatisticalThreshold
$cfrom :: forall x. StatisticalThreshold -> Rep StatisticalThreshold x
Prelude.Generic)
newStatisticalThreshold ::
StatisticalThreshold
newStatisticalThreshold :: StatisticalThreshold
newStatisticalThreshold =
StatisticalThreshold' :: Maybe Text -> StatisticalThreshold
StatisticalThreshold' {$sel:statistic:StatisticalThreshold' :: Maybe Text
statistic = Maybe Text
forall a. Maybe a
Prelude.Nothing}
statisticalThreshold_statistic :: Lens.Lens' StatisticalThreshold (Prelude.Maybe Prelude.Text)
statisticalThreshold_statistic :: (Maybe Text -> f (Maybe Text))
-> StatisticalThreshold -> f StatisticalThreshold
statisticalThreshold_statistic = (StatisticalThreshold -> Maybe Text)
-> (StatisticalThreshold -> Maybe Text -> StatisticalThreshold)
-> Lens
StatisticalThreshold StatisticalThreshold (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatisticalThreshold' {Maybe Text
statistic :: Maybe Text
$sel:statistic:StatisticalThreshold' :: StatisticalThreshold -> Maybe Text
statistic} -> Maybe Text
statistic) (\s :: StatisticalThreshold
s@StatisticalThreshold' {} Maybe Text
a -> StatisticalThreshold
s {$sel:statistic:StatisticalThreshold' :: Maybe Text
statistic = Maybe Text
a} :: StatisticalThreshold)
instance Core.FromJSON StatisticalThreshold where
parseJSON :: Value -> Parser StatisticalThreshold
parseJSON =
String
-> (Object -> Parser StatisticalThreshold)
-> Value
-> Parser StatisticalThreshold
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"StatisticalThreshold"
( \Object
x ->
Maybe Text -> StatisticalThreshold
StatisticalThreshold'
(Maybe Text -> StatisticalThreshold)
-> Parser (Maybe Text) -> Parser StatisticalThreshold
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"statistic")
)
instance Prelude.Hashable StatisticalThreshold
instance Prelude.NFData StatisticalThreshold
instance Core.ToJSON StatisticalThreshold where
toJSON :: StatisticalThreshold -> Value
toJSON StatisticalThreshold' {Maybe Text
statistic :: Maybe Text
$sel:statistic:StatisticalThreshold' :: StatisticalThreshold -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"statistic" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
statistic]
)