{-# 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.IoTEvents.Types.DetectorModelSummary
-- 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.IoTEvents.Types.DetectorModelSummary 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

-- | Information about the detector model.
--
-- /See:/ 'newDetectorModelSummary' smart constructor.
data DetectorModelSummary = DetectorModelSummary'
  { -- | The time the detector model was created.
    DetectorModelSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
    -- | A brief description of the detector model.
    DetectorModelSummary -> Maybe Text
detectorModelDescription :: Prelude.Maybe Prelude.Text,
    -- | The name of the detector model.
    DetectorModelSummary -> Maybe Text
detectorModelName :: Prelude.Maybe Prelude.Text
  }
  deriving (DetectorModelSummary -> DetectorModelSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectorModelSummary -> DetectorModelSummary -> Bool
$c/= :: DetectorModelSummary -> DetectorModelSummary -> Bool
== :: DetectorModelSummary -> DetectorModelSummary -> Bool
$c== :: DetectorModelSummary -> DetectorModelSummary -> Bool
Prelude.Eq, ReadPrec [DetectorModelSummary]
ReadPrec DetectorModelSummary
Int -> ReadS DetectorModelSummary
ReadS [DetectorModelSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectorModelSummary]
$creadListPrec :: ReadPrec [DetectorModelSummary]
readPrec :: ReadPrec DetectorModelSummary
$creadPrec :: ReadPrec DetectorModelSummary
readList :: ReadS [DetectorModelSummary]
$creadList :: ReadS [DetectorModelSummary]
readsPrec :: Int -> ReadS DetectorModelSummary
$creadsPrec :: Int -> ReadS DetectorModelSummary
Prelude.Read, Int -> DetectorModelSummary -> ShowS
[DetectorModelSummary] -> ShowS
DetectorModelSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectorModelSummary] -> ShowS
$cshowList :: [DetectorModelSummary] -> ShowS
show :: DetectorModelSummary -> String
$cshow :: DetectorModelSummary -> String
showsPrec :: Int -> DetectorModelSummary -> ShowS
$cshowsPrec :: Int -> DetectorModelSummary -> ShowS
Prelude.Show, forall x. Rep DetectorModelSummary x -> DetectorModelSummary
forall x. DetectorModelSummary -> Rep DetectorModelSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DetectorModelSummary x -> DetectorModelSummary
$cfrom :: forall x. DetectorModelSummary -> Rep DetectorModelSummary x
Prelude.Generic)

-- |
-- Create a value of 'DetectorModelSummary' 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:
--
-- 'creationTime', 'detectorModelSummary_creationTime' - The time the detector model was created.
--
-- 'detectorModelDescription', 'detectorModelSummary_detectorModelDescription' - A brief description of the detector model.
--
-- 'detectorModelName', 'detectorModelSummary_detectorModelName' - The name of the detector model.
newDetectorModelSummary ::
  DetectorModelSummary
newDetectorModelSummary :: DetectorModelSummary
newDetectorModelSummary =
  DetectorModelSummary'
    { $sel:creationTime:DetectorModelSummary' :: Maybe POSIX
creationTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:detectorModelDescription:DetectorModelSummary' :: Maybe Text
detectorModelDescription = forall a. Maybe a
Prelude.Nothing,
      $sel:detectorModelName:DetectorModelSummary' :: Maybe Text
detectorModelName = forall a. Maybe a
Prelude.Nothing
    }

-- | The time the detector model was created.
detectorModelSummary_creationTime :: Lens.Lens' DetectorModelSummary (Prelude.Maybe Prelude.UTCTime)
detectorModelSummary_creationTime :: Lens' DetectorModelSummary (Maybe UTCTime)
detectorModelSummary_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectorModelSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DetectorModelSummary' :: DetectorModelSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DetectorModelSummary
s@DetectorModelSummary' {} Maybe POSIX
a -> DetectorModelSummary
s {$sel:creationTime:DetectorModelSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DetectorModelSummary) 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

-- | A brief description of the detector model.
detectorModelSummary_detectorModelDescription :: Lens.Lens' DetectorModelSummary (Prelude.Maybe Prelude.Text)
detectorModelSummary_detectorModelDescription :: Lens' DetectorModelSummary (Maybe Text)
detectorModelSummary_detectorModelDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectorModelSummary' {Maybe Text
detectorModelDescription :: Maybe Text
$sel:detectorModelDescription:DetectorModelSummary' :: DetectorModelSummary -> Maybe Text
detectorModelDescription} -> Maybe Text
detectorModelDescription) (\s :: DetectorModelSummary
s@DetectorModelSummary' {} Maybe Text
a -> DetectorModelSummary
s {$sel:detectorModelDescription:DetectorModelSummary' :: Maybe Text
detectorModelDescription = Maybe Text
a} :: DetectorModelSummary)

-- | The name of the detector model.
detectorModelSummary_detectorModelName :: Lens.Lens' DetectorModelSummary (Prelude.Maybe Prelude.Text)
detectorModelSummary_detectorModelName :: Lens' DetectorModelSummary (Maybe Text)
detectorModelSummary_detectorModelName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectorModelSummary' {Maybe Text
detectorModelName :: Maybe Text
$sel:detectorModelName:DetectorModelSummary' :: DetectorModelSummary -> Maybe Text
detectorModelName} -> Maybe Text
detectorModelName) (\s :: DetectorModelSummary
s@DetectorModelSummary' {} Maybe Text
a -> DetectorModelSummary
s {$sel:detectorModelName:DetectorModelSummary' :: Maybe Text
detectorModelName = Maybe Text
a} :: DetectorModelSummary)

instance Data.FromJSON DetectorModelSummary where
  parseJSON :: Value -> Parser DetectorModelSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DetectorModelSummary"
      ( \Object
x ->
          Maybe POSIX -> Maybe Text -> Maybe Text -> DetectorModelSummary
DetectorModelSummary'
            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
"creationTime")
            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
"detectorModelDescription")
            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
"detectorModelName")
      )

instance Prelude.Hashable DetectorModelSummary where
  hashWithSalt :: Int -> DetectorModelSummary -> Int
hashWithSalt Int
_salt DetectorModelSummary' {Maybe Text
Maybe POSIX
detectorModelName :: Maybe Text
detectorModelDescription :: Maybe Text
creationTime :: Maybe POSIX
$sel:detectorModelName:DetectorModelSummary' :: DetectorModelSummary -> Maybe Text
$sel:detectorModelDescription:DetectorModelSummary' :: DetectorModelSummary -> Maybe Text
$sel:creationTime:DetectorModelSummary' :: DetectorModelSummary -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
detectorModelDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
detectorModelName

instance Prelude.NFData DetectorModelSummary where
  rnf :: DetectorModelSummary -> ()
rnf DetectorModelSummary' {Maybe Text
Maybe POSIX
detectorModelName :: Maybe Text
detectorModelDescription :: Maybe Text
creationTime :: Maybe POSIX
$sel:detectorModelName:DetectorModelSummary' :: DetectorModelSummary -> Maybe Text
$sel:detectorModelDescription:DetectorModelSummary' :: DetectorModelSummary -> Maybe Text
$sel:creationTime:DetectorModelSummary' :: DetectorModelSummary -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
detectorModelDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
detectorModelName