{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IoT.Types.BehaviorModelTrainingSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoT.Types.BehaviorModelTrainingSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types.ModelStatus
import qualified Amazonka.Prelude as Prelude

-- | The summary of an ML Detect behavior model.
--
-- /See:/ 'newBehaviorModelTrainingSummary' smart constructor.
data BehaviorModelTrainingSummary = BehaviorModelTrainingSummary'
  { -- | The name of the behavior.
    BehaviorModelTrainingSummary -> Maybe Text
behaviorName :: Prelude.Maybe Prelude.Text,
    -- | The percentage of datapoints collected.
    BehaviorModelTrainingSummary -> Maybe Double
datapointsCollectionPercentage :: Prelude.Maybe Prelude.Double,
    -- | The date the model was last refreshed.
    BehaviorModelTrainingSummary -> Maybe POSIX
lastModelRefreshDate :: Prelude.Maybe Data.POSIX,
    -- | The status of the behavior model.
    BehaviorModelTrainingSummary -> Maybe ModelStatus
modelStatus :: Prelude.Maybe ModelStatus,
    -- | The name of the security profile.
    BehaviorModelTrainingSummary -> Maybe Text
securityProfileName :: Prelude.Maybe Prelude.Text,
    -- | The date a training model started collecting data.
    BehaviorModelTrainingSummary -> Maybe POSIX
trainingDataCollectionStartDate :: Prelude.Maybe Data.POSIX
  }
  deriving (BehaviorModelTrainingSummary
-> BehaviorModelTrainingSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BehaviorModelTrainingSummary
-> BehaviorModelTrainingSummary -> Bool
$c/= :: BehaviorModelTrainingSummary
-> BehaviorModelTrainingSummary -> Bool
== :: BehaviorModelTrainingSummary
-> BehaviorModelTrainingSummary -> Bool
$c== :: BehaviorModelTrainingSummary
-> BehaviorModelTrainingSummary -> Bool
Prelude.Eq, ReadPrec [BehaviorModelTrainingSummary]
ReadPrec BehaviorModelTrainingSummary
Int -> ReadS BehaviorModelTrainingSummary
ReadS [BehaviorModelTrainingSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BehaviorModelTrainingSummary]
$creadListPrec :: ReadPrec [BehaviorModelTrainingSummary]
readPrec :: ReadPrec BehaviorModelTrainingSummary
$creadPrec :: ReadPrec BehaviorModelTrainingSummary
readList :: ReadS [BehaviorModelTrainingSummary]
$creadList :: ReadS [BehaviorModelTrainingSummary]
readsPrec :: Int -> ReadS BehaviorModelTrainingSummary
$creadsPrec :: Int -> ReadS BehaviorModelTrainingSummary
Prelude.Read, Int -> BehaviorModelTrainingSummary -> ShowS
[BehaviorModelTrainingSummary] -> ShowS
BehaviorModelTrainingSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BehaviorModelTrainingSummary] -> ShowS
$cshowList :: [BehaviorModelTrainingSummary] -> ShowS
show :: BehaviorModelTrainingSummary -> String
$cshow :: BehaviorModelTrainingSummary -> String
showsPrec :: Int -> BehaviorModelTrainingSummary -> ShowS
$cshowsPrec :: Int -> BehaviorModelTrainingSummary -> ShowS
Prelude.Show, forall x.
Rep BehaviorModelTrainingSummary x -> BehaviorModelTrainingSummary
forall x.
BehaviorModelTrainingSummary -> Rep BehaviorModelTrainingSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BehaviorModelTrainingSummary x -> BehaviorModelTrainingSummary
$cfrom :: forall x.
BehaviorModelTrainingSummary -> Rep BehaviorModelTrainingSummary x
Prelude.Generic)

-- |
-- Create a value of 'BehaviorModelTrainingSummary' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'behaviorName', 'behaviorModelTrainingSummary_behaviorName' - The name of the behavior.
--
-- 'datapointsCollectionPercentage', 'behaviorModelTrainingSummary_datapointsCollectionPercentage' - The percentage of datapoints collected.
--
-- 'lastModelRefreshDate', 'behaviorModelTrainingSummary_lastModelRefreshDate' - The date the model was last refreshed.
--
-- 'modelStatus', 'behaviorModelTrainingSummary_modelStatus' - The status of the behavior model.
--
-- 'securityProfileName', 'behaviorModelTrainingSummary_securityProfileName' - The name of the security profile.
--
-- 'trainingDataCollectionStartDate', 'behaviorModelTrainingSummary_trainingDataCollectionStartDate' - The date a training model started collecting data.
newBehaviorModelTrainingSummary ::
  BehaviorModelTrainingSummary
newBehaviorModelTrainingSummary :: BehaviorModelTrainingSummary
newBehaviorModelTrainingSummary =
  BehaviorModelTrainingSummary'
    { $sel:behaviorName:BehaviorModelTrainingSummary' :: Maybe Text
behaviorName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:datapointsCollectionPercentage:BehaviorModelTrainingSummary' :: Maybe Double
datapointsCollectionPercentage =
        forall a. Maybe a
Prelude.Nothing,
      $sel:lastModelRefreshDate:BehaviorModelTrainingSummary' :: Maybe POSIX
lastModelRefreshDate = forall a. Maybe a
Prelude.Nothing,
      $sel:modelStatus:BehaviorModelTrainingSummary' :: Maybe ModelStatus
modelStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:securityProfileName:BehaviorModelTrainingSummary' :: Maybe Text
securityProfileName = forall a. Maybe a
Prelude.Nothing,
      $sel:trainingDataCollectionStartDate:BehaviorModelTrainingSummary' :: Maybe POSIX
trainingDataCollectionStartDate =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the behavior.
behaviorModelTrainingSummary_behaviorName :: Lens.Lens' BehaviorModelTrainingSummary (Prelude.Maybe Prelude.Text)
behaviorModelTrainingSummary_behaviorName :: Lens' BehaviorModelTrainingSummary (Maybe Text)
behaviorModelTrainingSummary_behaviorName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BehaviorModelTrainingSummary' {Maybe Text
behaviorName :: Maybe Text
$sel:behaviorName:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe Text
behaviorName} -> Maybe Text
behaviorName) (\s :: BehaviorModelTrainingSummary
s@BehaviorModelTrainingSummary' {} Maybe Text
a -> BehaviorModelTrainingSummary
s {$sel:behaviorName:BehaviorModelTrainingSummary' :: Maybe Text
behaviorName = Maybe Text
a} :: BehaviorModelTrainingSummary)

-- | The percentage of datapoints collected.
behaviorModelTrainingSummary_datapointsCollectionPercentage :: Lens.Lens' BehaviorModelTrainingSummary (Prelude.Maybe Prelude.Double)
behaviorModelTrainingSummary_datapointsCollectionPercentage :: Lens' BehaviorModelTrainingSummary (Maybe Double)
behaviorModelTrainingSummary_datapointsCollectionPercentage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BehaviorModelTrainingSummary' {Maybe Double
datapointsCollectionPercentage :: Maybe Double
$sel:datapointsCollectionPercentage:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe Double
datapointsCollectionPercentage} -> Maybe Double
datapointsCollectionPercentage) (\s :: BehaviorModelTrainingSummary
s@BehaviorModelTrainingSummary' {} Maybe Double
a -> BehaviorModelTrainingSummary
s {$sel:datapointsCollectionPercentage:BehaviorModelTrainingSummary' :: Maybe Double
datapointsCollectionPercentage = Maybe Double
a} :: BehaviorModelTrainingSummary)

-- | The date the model was last refreshed.
behaviorModelTrainingSummary_lastModelRefreshDate :: Lens.Lens' BehaviorModelTrainingSummary (Prelude.Maybe Prelude.UTCTime)
behaviorModelTrainingSummary_lastModelRefreshDate :: Lens' BehaviorModelTrainingSummary (Maybe UTCTime)
behaviorModelTrainingSummary_lastModelRefreshDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BehaviorModelTrainingSummary' {Maybe POSIX
lastModelRefreshDate :: Maybe POSIX
$sel:lastModelRefreshDate:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe POSIX
lastModelRefreshDate} -> Maybe POSIX
lastModelRefreshDate) (\s :: BehaviorModelTrainingSummary
s@BehaviorModelTrainingSummary' {} Maybe POSIX
a -> BehaviorModelTrainingSummary
s {$sel:lastModelRefreshDate:BehaviorModelTrainingSummary' :: Maybe POSIX
lastModelRefreshDate = Maybe POSIX
a} :: BehaviorModelTrainingSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The status of the behavior model.
behaviorModelTrainingSummary_modelStatus :: Lens.Lens' BehaviorModelTrainingSummary (Prelude.Maybe ModelStatus)
behaviorModelTrainingSummary_modelStatus :: Lens' BehaviorModelTrainingSummary (Maybe ModelStatus)
behaviorModelTrainingSummary_modelStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BehaviorModelTrainingSummary' {Maybe ModelStatus
modelStatus :: Maybe ModelStatus
$sel:modelStatus:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe ModelStatus
modelStatus} -> Maybe ModelStatus
modelStatus) (\s :: BehaviorModelTrainingSummary
s@BehaviorModelTrainingSummary' {} Maybe ModelStatus
a -> BehaviorModelTrainingSummary
s {$sel:modelStatus:BehaviorModelTrainingSummary' :: Maybe ModelStatus
modelStatus = Maybe ModelStatus
a} :: BehaviorModelTrainingSummary)

-- | The name of the security profile.
behaviorModelTrainingSummary_securityProfileName :: Lens.Lens' BehaviorModelTrainingSummary (Prelude.Maybe Prelude.Text)
behaviorModelTrainingSummary_securityProfileName :: Lens' BehaviorModelTrainingSummary (Maybe Text)
behaviorModelTrainingSummary_securityProfileName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BehaviorModelTrainingSummary' {Maybe Text
securityProfileName :: Maybe Text
$sel:securityProfileName:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe Text
securityProfileName} -> Maybe Text
securityProfileName) (\s :: BehaviorModelTrainingSummary
s@BehaviorModelTrainingSummary' {} Maybe Text
a -> BehaviorModelTrainingSummary
s {$sel:securityProfileName:BehaviorModelTrainingSummary' :: Maybe Text
securityProfileName = Maybe Text
a} :: BehaviorModelTrainingSummary)

-- | The date a training model started collecting data.
behaviorModelTrainingSummary_trainingDataCollectionStartDate :: Lens.Lens' BehaviorModelTrainingSummary (Prelude.Maybe Prelude.UTCTime)
behaviorModelTrainingSummary_trainingDataCollectionStartDate :: Lens' BehaviorModelTrainingSummary (Maybe UTCTime)
behaviorModelTrainingSummary_trainingDataCollectionStartDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BehaviorModelTrainingSummary' {Maybe POSIX
trainingDataCollectionStartDate :: Maybe POSIX
$sel:trainingDataCollectionStartDate:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe POSIX
trainingDataCollectionStartDate} -> Maybe POSIX
trainingDataCollectionStartDate) (\s :: BehaviorModelTrainingSummary
s@BehaviorModelTrainingSummary' {} Maybe POSIX
a -> BehaviorModelTrainingSummary
s {$sel:trainingDataCollectionStartDate:BehaviorModelTrainingSummary' :: Maybe POSIX
trainingDataCollectionStartDate = Maybe POSIX
a} :: BehaviorModelTrainingSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON BehaviorModelTrainingSummary where
  parseJSON :: Value -> Parser BehaviorModelTrainingSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BehaviorModelTrainingSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Double
-> Maybe POSIX
-> Maybe ModelStatus
-> Maybe Text
-> Maybe POSIX
-> BehaviorModelTrainingSummary
BehaviorModelTrainingSummary'
            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
"behaviorName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"datapointsCollectionPercentage")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lastModelRefreshDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"modelStatus")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"securityProfileName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"trainingDataCollectionStartDate")
      )

instance
  Prelude.Hashable
    BehaviorModelTrainingSummary
  where
  hashWithSalt :: Int -> BehaviorModelTrainingSummary -> Int
hashWithSalt Int
_salt BehaviorModelTrainingSummary' {Maybe Double
Maybe Text
Maybe POSIX
Maybe ModelStatus
trainingDataCollectionStartDate :: Maybe POSIX
securityProfileName :: Maybe Text
modelStatus :: Maybe ModelStatus
lastModelRefreshDate :: Maybe POSIX
datapointsCollectionPercentage :: Maybe Double
behaviorName :: Maybe Text
$sel:trainingDataCollectionStartDate:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe POSIX
$sel:securityProfileName:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe Text
$sel:modelStatus:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe ModelStatus
$sel:lastModelRefreshDate:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe POSIX
$sel:datapointsCollectionPercentage:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe Double
$sel:behaviorName:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
behaviorName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
datapointsCollectionPercentage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModelRefreshDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ModelStatus
modelStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
securityProfileName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
trainingDataCollectionStartDate

instance Prelude.NFData BehaviorModelTrainingSummary where
  rnf :: BehaviorModelTrainingSummary -> ()
rnf BehaviorModelTrainingSummary' {Maybe Double
Maybe Text
Maybe POSIX
Maybe ModelStatus
trainingDataCollectionStartDate :: Maybe POSIX
securityProfileName :: Maybe Text
modelStatus :: Maybe ModelStatus
lastModelRefreshDate :: Maybe POSIX
datapointsCollectionPercentage :: Maybe Double
behaviorName :: Maybe Text
$sel:trainingDataCollectionStartDate:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe POSIX
$sel:securityProfileName:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe Text
$sel:modelStatus:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe ModelStatus
$sel:lastModelRefreshDate:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe POSIX
$sel:datapointsCollectionPercentage:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe Double
$sel:behaviorName:BehaviorModelTrainingSummary' :: BehaviorModelTrainingSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
behaviorName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
datapointsCollectionPercentage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModelRefreshDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ModelStatus
modelStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
securityProfileName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
trainingDataCollectionStartDate