{-# 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.ActiveViolation
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoT.Types.ActiveViolation where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types.Behavior
import Amazonka.IoT.Types.MetricValue
import Amazonka.IoT.Types.VerificationState
import Amazonka.IoT.Types.ViolationEventAdditionalInfo
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about an active Device Defender security profile behavior
-- violation.
--
-- /See:/ 'newActiveViolation' smart constructor.
data ActiveViolation = ActiveViolation'
  { -- | The description of the verification state of the violation.
    ActiveViolation -> Maybe Text
verificationStateDescription :: Prelude.Maybe Prelude.Text,
    -- | The value of the metric (the measurement) that caused the most recent
    -- violation.
    ActiveViolation -> Maybe MetricValue
lastViolationValue :: Prelude.Maybe MetricValue,
    -- | The time the most recent violation occurred.
    ActiveViolation -> Maybe POSIX
lastViolationTime :: Prelude.Maybe Core.POSIX,
    -- | The time the violation started.
    ActiveViolation -> Maybe POSIX
violationStartTime :: Prelude.Maybe Core.POSIX,
    -- | The ID of the active violation.
    ActiveViolation -> Maybe Text
violationId :: Prelude.Maybe Prelude.Text,
    -- | The behavior that is being violated.
    ActiveViolation -> Maybe Behavior
behavior :: Prelude.Maybe Behavior,
    -- | The security profile with the behavior is in violation.
    ActiveViolation -> Maybe Text
securityProfileName :: Prelude.Maybe Prelude.Text,
    -- | The details of a violation event.
    ActiveViolation -> Maybe ViolationEventAdditionalInfo
violationEventAdditionalInfo :: Prelude.Maybe ViolationEventAdditionalInfo,
    -- | The name of the thing responsible for the active violation.
    ActiveViolation -> Maybe Text
thingName :: Prelude.Maybe Prelude.Text,
    -- | The verification state of the violation (detect alarm).
    ActiveViolation -> Maybe VerificationState
verificationState :: Prelude.Maybe VerificationState
  }
  deriving (ActiveViolation -> ActiveViolation -> Bool
(ActiveViolation -> ActiveViolation -> Bool)
-> (ActiveViolation -> ActiveViolation -> Bool)
-> Eq ActiveViolation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActiveViolation -> ActiveViolation -> Bool
$c/= :: ActiveViolation -> ActiveViolation -> Bool
== :: ActiveViolation -> ActiveViolation -> Bool
$c== :: ActiveViolation -> ActiveViolation -> Bool
Prelude.Eq, ReadPrec [ActiveViolation]
ReadPrec ActiveViolation
Int -> ReadS ActiveViolation
ReadS [ActiveViolation]
(Int -> ReadS ActiveViolation)
-> ReadS [ActiveViolation]
-> ReadPrec ActiveViolation
-> ReadPrec [ActiveViolation]
-> Read ActiveViolation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActiveViolation]
$creadListPrec :: ReadPrec [ActiveViolation]
readPrec :: ReadPrec ActiveViolation
$creadPrec :: ReadPrec ActiveViolation
readList :: ReadS [ActiveViolation]
$creadList :: ReadS [ActiveViolation]
readsPrec :: Int -> ReadS ActiveViolation
$creadsPrec :: Int -> ReadS ActiveViolation
Prelude.Read, Int -> ActiveViolation -> ShowS
[ActiveViolation] -> ShowS
ActiveViolation -> String
(Int -> ActiveViolation -> ShowS)
-> (ActiveViolation -> String)
-> ([ActiveViolation] -> ShowS)
-> Show ActiveViolation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActiveViolation] -> ShowS
$cshowList :: [ActiveViolation] -> ShowS
show :: ActiveViolation -> String
$cshow :: ActiveViolation -> String
showsPrec :: Int -> ActiveViolation -> ShowS
$cshowsPrec :: Int -> ActiveViolation -> ShowS
Prelude.Show, (forall x. ActiveViolation -> Rep ActiveViolation x)
-> (forall x. Rep ActiveViolation x -> ActiveViolation)
-> Generic ActiveViolation
forall x. Rep ActiveViolation x -> ActiveViolation
forall x. ActiveViolation -> Rep ActiveViolation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActiveViolation x -> ActiveViolation
$cfrom :: forall x. ActiveViolation -> Rep ActiveViolation x
Prelude.Generic)

-- |
-- Create a value of 'ActiveViolation' 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:
--
-- 'verificationStateDescription', 'activeViolation_verificationStateDescription' - The description of the verification state of the violation.
--
-- 'lastViolationValue', 'activeViolation_lastViolationValue' - The value of the metric (the measurement) that caused the most recent
-- violation.
--
-- 'lastViolationTime', 'activeViolation_lastViolationTime' - The time the most recent violation occurred.
--
-- 'violationStartTime', 'activeViolation_violationStartTime' - The time the violation started.
--
-- 'violationId', 'activeViolation_violationId' - The ID of the active violation.
--
-- 'behavior', 'activeViolation_behavior' - The behavior that is being violated.
--
-- 'securityProfileName', 'activeViolation_securityProfileName' - The security profile with the behavior is in violation.
--
-- 'violationEventAdditionalInfo', 'activeViolation_violationEventAdditionalInfo' - The details of a violation event.
--
-- 'thingName', 'activeViolation_thingName' - The name of the thing responsible for the active violation.
--
-- 'verificationState', 'activeViolation_verificationState' - The verification state of the violation (detect alarm).
newActiveViolation ::
  ActiveViolation
newActiveViolation :: ActiveViolation
newActiveViolation =
  ActiveViolation' :: Maybe Text
-> Maybe MetricValue
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Behavior
-> Maybe Text
-> Maybe ViolationEventAdditionalInfo
-> Maybe Text
-> Maybe VerificationState
-> ActiveViolation
ActiveViolation'
    { $sel:verificationStateDescription:ActiveViolation' :: Maybe Text
verificationStateDescription =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastViolationValue:ActiveViolation' :: Maybe MetricValue
lastViolationValue = Maybe MetricValue
forall a. Maybe a
Prelude.Nothing,
      $sel:lastViolationTime:ActiveViolation' :: Maybe POSIX
lastViolationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:violationStartTime:ActiveViolation' :: Maybe POSIX
violationStartTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:violationId:ActiveViolation' :: Maybe Text
violationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:behavior:ActiveViolation' :: Maybe Behavior
behavior = Maybe Behavior
forall a. Maybe a
Prelude.Nothing,
      $sel:securityProfileName:ActiveViolation' :: Maybe Text
securityProfileName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:violationEventAdditionalInfo:ActiveViolation' :: Maybe ViolationEventAdditionalInfo
violationEventAdditionalInfo = Maybe ViolationEventAdditionalInfo
forall a. Maybe a
Prelude.Nothing,
      $sel:thingName:ActiveViolation' :: Maybe Text
thingName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:verificationState:ActiveViolation' :: Maybe VerificationState
verificationState = Maybe VerificationState
forall a. Maybe a
Prelude.Nothing
    }

-- | The description of the verification state of the violation.
activeViolation_verificationStateDescription :: Lens.Lens' ActiveViolation (Prelude.Maybe Prelude.Text)
activeViolation_verificationStateDescription :: (Maybe Text -> f (Maybe Text))
-> ActiveViolation -> f ActiveViolation
activeViolation_verificationStateDescription = (ActiveViolation -> Maybe Text)
-> (ActiveViolation -> Maybe Text -> ActiveViolation)
-> Lens ActiveViolation ActiveViolation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActiveViolation' {Maybe Text
verificationStateDescription :: Maybe Text
$sel:verificationStateDescription:ActiveViolation' :: ActiveViolation -> Maybe Text
verificationStateDescription} -> Maybe Text
verificationStateDescription) (\s :: ActiveViolation
s@ActiveViolation' {} Maybe Text
a -> ActiveViolation
s {$sel:verificationStateDescription:ActiveViolation' :: Maybe Text
verificationStateDescription = Maybe Text
a} :: ActiveViolation)

-- | The value of the metric (the measurement) that caused the most recent
-- violation.
activeViolation_lastViolationValue :: Lens.Lens' ActiveViolation (Prelude.Maybe MetricValue)
activeViolation_lastViolationValue :: (Maybe MetricValue -> f (Maybe MetricValue))
-> ActiveViolation -> f ActiveViolation
activeViolation_lastViolationValue = (ActiveViolation -> Maybe MetricValue)
-> (ActiveViolation -> Maybe MetricValue -> ActiveViolation)
-> Lens
     ActiveViolation
     ActiveViolation
     (Maybe MetricValue)
     (Maybe MetricValue)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActiveViolation' {Maybe MetricValue
lastViolationValue :: Maybe MetricValue
$sel:lastViolationValue:ActiveViolation' :: ActiveViolation -> Maybe MetricValue
lastViolationValue} -> Maybe MetricValue
lastViolationValue) (\s :: ActiveViolation
s@ActiveViolation' {} Maybe MetricValue
a -> ActiveViolation
s {$sel:lastViolationValue:ActiveViolation' :: Maybe MetricValue
lastViolationValue = Maybe MetricValue
a} :: ActiveViolation)

-- | The time the most recent violation occurred.
activeViolation_lastViolationTime :: Lens.Lens' ActiveViolation (Prelude.Maybe Prelude.UTCTime)
activeViolation_lastViolationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ActiveViolation -> f ActiveViolation
activeViolation_lastViolationTime = (ActiveViolation -> Maybe POSIX)
-> (ActiveViolation -> Maybe POSIX -> ActiveViolation)
-> Lens ActiveViolation ActiveViolation (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActiveViolation' {Maybe POSIX
lastViolationTime :: Maybe POSIX
$sel:lastViolationTime:ActiveViolation' :: ActiveViolation -> Maybe POSIX
lastViolationTime} -> Maybe POSIX
lastViolationTime) (\s :: ActiveViolation
s@ActiveViolation' {} Maybe POSIX
a -> ActiveViolation
s {$sel:lastViolationTime:ActiveViolation' :: Maybe POSIX
lastViolationTime = Maybe POSIX
a} :: ActiveViolation) ((Maybe POSIX -> f (Maybe POSIX))
 -> ActiveViolation -> f ActiveViolation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ActiveViolation
-> f ActiveViolation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The time the violation started.
activeViolation_violationStartTime :: Lens.Lens' ActiveViolation (Prelude.Maybe Prelude.UTCTime)
activeViolation_violationStartTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ActiveViolation -> f ActiveViolation
activeViolation_violationStartTime = (ActiveViolation -> Maybe POSIX)
-> (ActiveViolation -> Maybe POSIX -> ActiveViolation)
-> Lens ActiveViolation ActiveViolation (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActiveViolation' {Maybe POSIX
violationStartTime :: Maybe POSIX
$sel:violationStartTime:ActiveViolation' :: ActiveViolation -> Maybe POSIX
violationStartTime} -> Maybe POSIX
violationStartTime) (\s :: ActiveViolation
s@ActiveViolation' {} Maybe POSIX
a -> ActiveViolation
s {$sel:violationStartTime:ActiveViolation' :: Maybe POSIX
violationStartTime = Maybe POSIX
a} :: ActiveViolation) ((Maybe POSIX -> f (Maybe POSIX))
 -> ActiveViolation -> f ActiveViolation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ActiveViolation
-> f ActiveViolation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The ID of the active violation.
activeViolation_violationId :: Lens.Lens' ActiveViolation (Prelude.Maybe Prelude.Text)
activeViolation_violationId :: (Maybe Text -> f (Maybe Text))
-> ActiveViolation -> f ActiveViolation
activeViolation_violationId = (ActiveViolation -> Maybe Text)
-> (ActiveViolation -> Maybe Text -> ActiveViolation)
-> Lens ActiveViolation ActiveViolation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActiveViolation' {Maybe Text
violationId :: Maybe Text
$sel:violationId:ActiveViolation' :: ActiveViolation -> Maybe Text
violationId} -> Maybe Text
violationId) (\s :: ActiveViolation
s@ActiveViolation' {} Maybe Text
a -> ActiveViolation
s {$sel:violationId:ActiveViolation' :: Maybe Text
violationId = Maybe Text
a} :: ActiveViolation)

-- | The behavior that is being violated.
activeViolation_behavior :: Lens.Lens' ActiveViolation (Prelude.Maybe Behavior)
activeViolation_behavior :: (Maybe Behavior -> f (Maybe Behavior))
-> ActiveViolation -> f ActiveViolation
activeViolation_behavior = (ActiveViolation -> Maybe Behavior)
-> (ActiveViolation -> Maybe Behavior -> ActiveViolation)
-> Lens
     ActiveViolation ActiveViolation (Maybe Behavior) (Maybe Behavior)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActiveViolation' {Maybe Behavior
behavior :: Maybe Behavior
$sel:behavior:ActiveViolation' :: ActiveViolation -> Maybe Behavior
behavior} -> Maybe Behavior
behavior) (\s :: ActiveViolation
s@ActiveViolation' {} Maybe Behavior
a -> ActiveViolation
s {$sel:behavior:ActiveViolation' :: Maybe Behavior
behavior = Maybe Behavior
a} :: ActiveViolation)

-- | The security profile with the behavior is in violation.
activeViolation_securityProfileName :: Lens.Lens' ActiveViolation (Prelude.Maybe Prelude.Text)
activeViolation_securityProfileName :: (Maybe Text -> f (Maybe Text))
-> ActiveViolation -> f ActiveViolation
activeViolation_securityProfileName = (ActiveViolation -> Maybe Text)
-> (ActiveViolation -> Maybe Text -> ActiveViolation)
-> Lens ActiveViolation ActiveViolation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActiveViolation' {Maybe Text
securityProfileName :: Maybe Text
$sel:securityProfileName:ActiveViolation' :: ActiveViolation -> Maybe Text
securityProfileName} -> Maybe Text
securityProfileName) (\s :: ActiveViolation
s@ActiveViolation' {} Maybe Text
a -> ActiveViolation
s {$sel:securityProfileName:ActiveViolation' :: Maybe Text
securityProfileName = Maybe Text
a} :: ActiveViolation)

-- | The details of a violation event.
activeViolation_violationEventAdditionalInfo :: Lens.Lens' ActiveViolation (Prelude.Maybe ViolationEventAdditionalInfo)
activeViolation_violationEventAdditionalInfo :: (Maybe ViolationEventAdditionalInfo
 -> f (Maybe ViolationEventAdditionalInfo))
-> ActiveViolation -> f ActiveViolation
activeViolation_violationEventAdditionalInfo = (ActiveViolation -> Maybe ViolationEventAdditionalInfo)
-> (ActiveViolation
    -> Maybe ViolationEventAdditionalInfo -> ActiveViolation)
-> Lens
     ActiveViolation
     ActiveViolation
     (Maybe ViolationEventAdditionalInfo)
     (Maybe ViolationEventAdditionalInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActiveViolation' {Maybe ViolationEventAdditionalInfo
violationEventAdditionalInfo :: Maybe ViolationEventAdditionalInfo
$sel:violationEventAdditionalInfo:ActiveViolation' :: ActiveViolation -> Maybe ViolationEventAdditionalInfo
violationEventAdditionalInfo} -> Maybe ViolationEventAdditionalInfo
violationEventAdditionalInfo) (\s :: ActiveViolation
s@ActiveViolation' {} Maybe ViolationEventAdditionalInfo
a -> ActiveViolation
s {$sel:violationEventAdditionalInfo:ActiveViolation' :: Maybe ViolationEventAdditionalInfo
violationEventAdditionalInfo = Maybe ViolationEventAdditionalInfo
a} :: ActiveViolation)

-- | The name of the thing responsible for the active violation.
activeViolation_thingName :: Lens.Lens' ActiveViolation (Prelude.Maybe Prelude.Text)
activeViolation_thingName :: (Maybe Text -> f (Maybe Text))
-> ActiveViolation -> f ActiveViolation
activeViolation_thingName = (ActiveViolation -> Maybe Text)
-> (ActiveViolation -> Maybe Text -> ActiveViolation)
-> Lens ActiveViolation ActiveViolation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActiveViolation' {Maybe Text
thingName :: Maybe Text
$sel:thingName:ActiveViolation' :: ActiveViolation -> Maybe Text
thingName} -> Maybe Text
thingName) (\s :: ActiveViolation
s@ActiveViolation' {} Maybe Text
a -> ActiveViolation
s {$sel:thingName:ActiveViolation' :: Maybe Text
thingName = Maybe Text
a} :: ActiveViolation)

-- | The verification state of the violation (detect alarm).
activeViolation_verificationState :: Lens.Lens' ActiveViolation (Prelude.Maybe VerificationState)
activeViolation_verificationState :: (Maybe VerificationState -> f (Maybe VerificationState))
-> ActiveViolation -> f ActiveViolation
activeViolation_verificationState = (ActiveViolation -> Maybe VerificationState)
-> (ActiveViolation -> Maybe VerificationState -> ActiveViolation)
-> Lens
     ActiveViolation
     ActiveViolation
     (Maybe VerificationState)
     (Maybe VerificationState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActiveViolation' {Maybe VerificationState
verificationState :: Maybe VerificationState
$sel:verificationState:ActiveViolation' :: ActiveViolation -> Maybe VerificationState
verificationState} -> Maybe VerificationState
verificationState) (\s :: ActiveViolation
s@ActiveViolation' {} Maybe VerificationState
a -> ActiveViolation
s {$sel:verificationState:ActiveViolation' :: Maybe VerificationState
verificationState = Maybe VerificationState
a} :: ActiveViolation)

instance Core.FromJSON ActiveViolation where
  parseJSON :: Value -> Parser ActiveViolation
parseJSON =
    String
-> (Object -> Parser ActiveViolation)
-> Value
-> Parser ActiveViolation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ActiveViolation"
      ( \Object
x ->
          Maybe Text
-> Maybe MetricValue
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Behavior
-> Maybe Text
-> Maybe ViolationEventAdditionalInfo
-> Maybe Text
-> Maybe VerificationState
-> ActiveViolation
ActiveViolation'
            (Maybe Text
 -> Maybe MetricValue
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Behavior
 -> Maybe Text
 -> Maybe ViolationEventAdditionalInfo
 -> Maybe Text
 -> Maybe VerificationState
 -> ActiveViolation)
-> Parser (Maybe Text)
-> Parser
     (Maybe MetricValue
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Behavior
      -> Maybe Text
      -> Maybe ViolationEventAdditionalInfo
      -> Maybe Text
      -> Maybe VerificationState
      -> ActiveViolation)
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
"verificationStateDescription")
            Parser
  (Maybe MetricValue
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Behavior
   -> Maybe Text
   -> Maybe ViolationEventAdditionalInfo
   -> Maybe Text
   -> Maybe VerificationState
   -> ActiveViolation)
-> Parser (Maybe MetricValue)
-> Parser
     (Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Behavior
      -> Maybe Text
      -> Maybe ViolationEventAdditionalInfo
      -> Maybe Text
      -> Maybe VerificationState
      -> ActiveViolation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MetricValue)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastViolationValue")
            Parser
  (Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Behavior
   -> Maybe Text
   -> Maybe ViolationEventAdditionalInfo
   -> Maybe Text
   -> Maybe VerificationState
   -> ActiveViolation)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Behavior
      -> Maybe Text
      -> Maybe ViolationEventAdditionalInfo
      -> Maybe Text
      -> Maybe VerificationState
      -> ActiveViolation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastViolationTime")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Behavior
   -> Maybe Text
   -> Maybe ViolationEventAdditionalInfo
   -> Maybe Text
   -> Maybe VerificationState
   -> ActiveViolation)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Behavior
      -> Maybe Text
      -> Maybe ViolationEventAdditionalInfo
      -> Maybe Text
      -> Maybe VerificationState
      -> ActiveViolation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"violationStartTime")
            Parser
  (Maybe Text
   -> Maybe Behavior
   -> Maybe Text
   -> Maybe ViolationEventAdditionalInfo
   -> Maybe Text
   -> Maybe VerificationState
   -> ActiveViolation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Behavior
      -> Maybe Text
      -> Maybe ViolationEventAdditionalInfo
      -> Maybe Text
      -> Maybe VerificationState
      -> ActiveViolation)
forall (f :: * -> *) a b. Applicative f => 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
"violationId")
            Parser
  (Maybe Behavior
   -> Maybe Text
   -> Maybe ViolationEventAdditionalInfo
   -> Maybe Text
   -> Maybe VerificationState
   -> ActiveViolation)
-> Parser (Maybe Behavior)
-> Parser
     (Maybe Text
      -> Maybe ViolationEventAdditionalInfo
      -> Maybe Text
      -> Maybe VerificationState
      -> ActiveViolation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Behavior)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"behavior")
            Parser
  (Maybe Text
   -> Maybe ViolationEventAdditionalInfo
   -> Maybe Text
   -> Maybe VerificationState
   -> ActiveViolation)
-> Parser (Maybe Text)
-> Parser
     (Maybe ViolationEventAdditionalInfo
      -> Maybe Text -> Maybe VerificationState -> ActiveViolation)
forall (f :: * -> *) a b. Applicative f => 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
"securityProfileName")
            Parser
  (Maybe ViolationEventAdditionalInfo
   -> Maybe Text -> Maybe VerificationState -> ActiveViolation)
-> Parser (Maybe ViolationEventAdditionalInfo)
-> Parser
     (Maybe Text -> Maybe VerificationState -> ActiveViolation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ViolationEventAdditionalInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"violationEventAdditionalInfo")
            Parser (Maybe Text -> Maybe VerificationState -> ActiveViolation)
-> Parser (Maybe Text)
-> Parser (Maybe VerificationState -> ActiveViolation)
forall (f :: * -> *) a b. Applicative f => 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
"thingName")
            Parser (Maybe VerificationState -> ActiveViolation)
-> Parser (Maybe VerificationState) -> Parser ActiveViolation
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VerificationState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"verificationState")
      )

instance Prelude.Hashable ActiveViolation

instance Prelude.NFData ActiveViolation