{-# 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.MachineLearningDetectionConfig where
import qualified Amazonka.Core as Core
import Amazonka.IoT.Types.ConfidenceLevel
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MachineLearningDetectionConfig = MachineLearningDetectionConfig'
{
MachineLearningDetectionConfig -> ConfidenceLevel
confidenceLevel :: ConfidenceLevel
}
deriving (MachineLearningDetectionConfig
-> MachineLearningDetectionConfig -> Bool
(MachineLearningDetectionConfig
-> MachineLearningDetectionConfig -> Bool)
-> (MachineLearningDetectionConfig
-> MachineLearningDetectionConfig -> Bool)
-> Eq MachineLearningDetectionConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MachineLearningDetectionConfig
-> MachineLearningDetectionConfig -> Bool
$c/= :: MachineLearningDetectionConfig
-> MachineLearningDetectionConfig -> Bool
== :: MachineLearningDetectionConfig
-> MachineLearningDetectionConfig -> Bool
$c== :: MachineLearningDetectionConfig
-> MachineLearningDetectionConfig -> Bool
Prelude.Eq, ReadPrec [MachineLearningDetectionConfig]
ReadPrec MachineLearningDetectionConfig
Int -> ReadS MachineLearningDetectionConfig
ReadS [MachineLearningDetectionConfig]
(Int -> ReadS MachineLearningDetectionConfig)
-> ReadS [MachineLearningDetectionConfig]
-> ReadPrec MachineLearningDetectionConfig
-> ReadPrec [MachineLearningDetectionConfig]
-> Read MachineLearningDetectionConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MachineLearningDetectionConfig]
$creadListPrec :: ReadPrec [MachineLearningDetectionConfig]
readPrec :: ReadPrec MachineLearningDetectionConfig
$creadPrec :: ReadPrec MachineLearningDetectionConfig
readList :: ReadS [MachineLearningDetectionConfig]
$creadList :: ReadS [MachineLearningDetectionConfig]
readsPrec :: Int -> ReadS MachineLearningDetectionConfig
$creadsPrec :: Int -> ReadS MachineLearningDetectionConfig
Prelude.Read, Int -> MachineLearningDetectionConfig -> ShowS
[MachineLearningDetectionConfig] -> ShowS
MachineLearningDetectionConfig -> String
(Int -> MachineLearningDetectionConfig -> ShowS)
-> (MachineLearningDetectionConfig -> String)
-> ([MachineLearningDetectionConfig] -> ShowS)
-> Show MachineLearningDetectionConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MachineLearningDetectionConfig] -> ShowS
$cshowList :: [MachineLearningDetectionConfig] -> ShowS
show :: MachineLearningDetectionConfig -> String
$cshow :: MachineLearningDetectionConfig -> String
showsPrec :: Int -> MachineLearningDetectionConfig -> ShowS
$cshowsPrec :: Int -> MachineLearningDetectionConfig -> ShowS
Prelude.Show, (forall x.
MachineLearningDetectionConfig
-> Rep MachineLearningDetectionConfig x)
-> (forall x.
Rep MachineLearningDetectionConfig x
-> MachineLearningDetectionConfig)
-> Generic MachineLearningDetectionConfig
forall x.
Rep MachineLearningDetectionConfig x
-> MachineLearningDetectionConfig
forall x.
MachineLearningDetectionConfig
-> Rep MachineLearningDetectionConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MachineLearningDetectionConfig x
-> MachineLearningDetectionConfig
$cfrom :: forall x.
MachineLearningDetectionConfig
-> Rep MachineLearningDetectionConfig x
Prelude.Generic)
newMachineLearningDetectionConfig ::
ConfidenceLevel ->
MachineLearningDetectionConfig
newMachineLearningDetectionConfig :: ConfidenceLevel -> MachineLearningDetectionConfig
newMachineLearningDetectionConfig ConfidenceLevel
pConfidenceLevel_ =
MachineLearningDetectionConfig' :: ConfidenceLevel -> MachineLearningDetectionConfig
MachineLearningDetectionConfig'
{ $sel:confidenceLevel:MachineLearningDetectionConfig' :: ConfidenceLevel
confidenceLevel =
ConfidenceLevel
pConfidenceLevel_
}
machineLearningDetectionConfig_confidenceLevel :: Lens.Lens' MachineLearningDetectionConfig ConfidenceLevel
machineLearningDetectionConfig_confidenceLevel :: (ConfidenceLevel -> f ConfidenceLevel)
-> MachineLearningDetectionConfig
-> f MachineLearningDetectionConfig
machineLearningDetectionConfig_confidenceLevel = (MachineLearningDetectionConfig -> ConfidenceLevel)
-> (MachineLearningDetectionConfig
-> ConfidenceLevel -> MachineLearningDetectionConfig)
-> Lens
MachineLearningDetectionConfig
MachineLearningDetectionConfig
ConfidenceLevel
ConfidenceLevel
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MachineLearningDetectionConfig' {ConfidenceLevel
confidenceLevel :: ConfidenceLevel
$sel:confidenceLevel:MachineLearningDetectionConfig' :: MachineLearningDetectionConfig -> ConfidenceLevel
confidenceLevel} -> ConfidenceLevel
confidenceLevel) (\s :: MachineLearningDetectionConfig
s@MachineLearningDetectionConfig' {} ConfidenceLevel
a -> MachineLearningDetectionConfig
s {$sel:confidenceLevel:MachineLearningDetectionConfig' :: ConfidenceLevel
confidenceLevel = ConfidenceLevel
a} :: MachineLearningDetectionConfig)
instance Core.FromJSON MachineLearningDetectionConfig where
parseJSON :: Value -> Parser MachineLearningDetectionConfig
parseJSON =
String
-> (Object -> Parser MachineLearningDetectionConfig)
-> Value
-> Parser MachineLearningDetectionConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MachineLearningDetectionConfig"
( \Object
x ->
ConfidenceLevel -> MachineLearningDetectionConfig
MachineLearningDetectionConfig'
(ConfidenceLevel -> MachineLearningDetectionConfig)
-> Parser ConfidenceLevel -> Parser MachineLearningDetectionConfig
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser ConfidenceLevel
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"confidenceLevel")
)
instance
Prelude.Hashable
MachineLearningDetectionConfig
instance
Prelude.NFData
MachineLearningDetectionConfig
instance Core.ToJSON MachineLearningDetectionConfig where
toJSON :: MachineLearningDetectionConfig -> Value
toJSON MachineLearningDetectionConfig' {ConfidenceLevel
confidenceLevel :: ConfidenceLevel
$sel:confidenceLevel:MachineLearningDetectionConfig' :: MachineLearningDetectionConfig -> ConfidenceLevel
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"confidenceLevel" Text -> ConfidenceLevel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ConfidenceLevel
confidenceLevel)
]
)