{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data StatisticalThreshold = StatisticalThreshold'
{
StatisticalThreshold -> Maybe Text
statistic :: Prelude.Maybe Prelude.Text
}
deriving (StatisticalThreshold -> StatisticalThreshold -> Bool
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]
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
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. 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' {$sel:statistic:StatisticalThreshold' :: Maybe Text
statistic = forall a. Maybe a
Prelude.Nothing}
statisticalThreshold_statistic :: Lens.Lens' StatisticalThreshold (Prelude.Maybe Prelude.Text)
statisticalThreshold_statistic :: Lens' StatisticalThreshold (Maybe Text)
statisticalThreshold_statistic = 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 Data.FromJSON StatisticalThreshold where
parseJSON :: Value -> Parser StatisticalThreshold
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"StatisticalThreshold"
( \Object
x ->
Maybe Text -> StatisticalThreshold
StatisticalThreshold'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"statistic")
)
instance Prelude.Hashable StatisticalThreshold where
hashWithSalt :: Int -> StatisticalThreshold -> Int
hashWithSalt Int
_salt StatisticalThreshold' {Maybe Text
statistic :: Maybe Text
$sel:statistic:StatisticalThreshold' :: StatisticalThreshold -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statistic
instance Prelude.NFData StatisticalThreshold where
rnf :: StatisticalThreshold -> ()
rnf StatisticalThreshold' {Maybe Text
statistic :: Maybe Text
$sel:statistic:StatisticalThreshold' :: StatisticalThreshold -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statistic
instance Data.ToJSON StatisticalThreshold where
toJSON :: StatisticalThreshold -> Value
toJSON StatisticalThreshold' {Maybe Text
statistic :: Maybe Text
$sel:statistic:StatisticalThreshold' :: StatisticalThreshold -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"statistic" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
statistic]
)