{-# 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.ViolationEvent
-- 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.ViolationEvent 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 Amazonka.IoT.Types.ViolationEventType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'ViolationEvent' 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:
--
-- 'violationEventType', 'violationEvent_violationEventType' - The type of violation event.
--
-- 'verificationStateDescription', 'violationEvent_verificationStateDescription' - The description of the verification state of the violation.
--
-- 'violationId', 'violationEvent_violationId' - The ID of the violation event.
--
-- 'behavior', 'violationEvent_behavior' - The behavior that was violated.
--
-- 'metricValue', 'violationEvent_metricValue' - The value of the metric (the measurement).
--
-- 'securityProfileName', 'violationEvent_securityProfileName' - The name of the security profile whose behavior was violated.
--
-- 'violationEventAdditionalInfo', 'violationEvent_violationEventAdditionalInfo' - The details of a violation event.
--
-- 'violationEventTime', 'violationEvent_violationEventTime' - The time the violation event occurred.
--
-- 'thingName', 'violationEvent_thingName' - The name of the thing responsible for the violation event.
--
-- 'verificationState', 'violationEvent_verificationState' - The verification state of the violation (detect alarm).
newViolationEvent ::
  ViolationEvent
newViolationEvent :: ViolationEvent
newViolationEvent =
  ViolationEvent' :: Maybe ViolationEventType
-> Maybe Text
-> Maybe Text
-> Maybe Behavior
-> Maybe MetricValue
-> Maybe Text
-> Maybe ViolationEventAdditionalInfo
-> Maybe POSIX
-> Maybe Text
-> Maybe VerificationState
-> ViolationEvent
ViolationEvent'
    { $sel:violationEventType:ViolationEvent' :: Maybe ViolationEventType
violationEventType =
        Maybe ViolationEventType
forall a. Maybe a
Prelude.Nothing,
      $sel:verificationStateDescription:ViolationEvent' :: Maybe Text
verificationStateDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:violationId:ViolationEvent' :: Maybe Text
violationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:behavior:ViolationEvent' :: Maybe Behavior
behavior = Maybe Behavior
forall a. Maybe a
Prelude.Nothing,
      $sel:metricValue:ViolationEvent' :: Maybe MetricValue
metricValue = Maybe MetricValue
forall a. Maybe a
Prelude.Nothing,
      $sel:securityProfileName:ViolationEvent' :: Maybe Text
securityProfileName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:violationEventAdditionalInfo:ViolationEvent' :: Maybe ViolationEventAdditionalInfo
violationEventAdditionalInfo = Maybe ViolationEventAdditionalInfo
forall a. Maybe a
Prelude.Nothing,
      $sel:violationEventTime:ViolationEvent' :: Maybe POSIX
violationEventTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:thingName:ViolationEvent' :: Maybe Text
thingName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:verificationState:ViolationEvent' :: Maybe VerificationState
verificationState = Maybe VerificationState
forall a. Maybe a
Prelude.Nothing
    }

-- | The type of violation event.
violationEvent_violationEventType :: Lens.Lens' ViolationEvent (Prelude.Maybe ViolationEventType)
violationEvent_violationEventType :: (Maybe ViolationEventType -> f (Maybe ViolationEventType))
-> ViolationEvent -> f ViolationEvent
violationEvent_violationEventType = (ViolationEvent -> Maybe ViolationEventType)
-> (ViolationEvent -> Maybe ViolationEventType -> ViolationEvent)
-> Lens
     ViolationEvent
     ViolationEvent
     (Maybe ViolationEventType)
     (Maybe ViolationEventType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ViolationEvent' {Maybe ViolationEventType
violationEventType :: Maybe ViolationEventType
$sel:violationEventType:ViolationEvent' :: ViolationEvent -> Maybe ViolationEventType
violationEventType} -> Maybe ViolationEventType
violationEventType) (\s :: ViolationEvent
s@ViolationEvent' {} Maybe ViolationEventType
a -> ViolationEvent
s {$sel:violationEventType:ViolationEvent' :: Maybe ViolationEventType
violationEventType = Maybe ViolationEventType
a} :: ViolationEvent)

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

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

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

-- | The value of the metric (the measurement).
violationEvent_metricValue :: Lens.Lens' ViolationEvent (Prelude.Maybe MetricValue)
violationEvent_metricValue :: (Maybe MetricValue -> f (Maybe MetricValue))
-> ViolationEvent -> f ViolationEvent
violationEvent_metricValue = (ViolationEvent -> Maybe MetricValue)
-> (ViolationEvent -> Maybe MetricValue -> ViolationEvent)
-> Lens
     ViolationEvent
     ViolationEvent
     (Maybe MetricValue)
     (Maybe MetricValue)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ViolationEvent' {Maybe MetricValue
metricValue :: Maybe MetricValue
$sel:metricValue:ViolationEvent' :: ViolationEvent -> Maybe MetricValue
metricValue} -> Maybe MetricValue
metricValue) (\s :: ViolationEvent
s@ViolationEvent' {} Maybe MetricValue
a -> ViolationEvent
s {$sel:metricValue:ViolationEvent' :: Maybe MetricValue
metricValue = Maybe MetricValue
a} :: ViolationEvent)

-- | The name of the security profile whose behavior was violated.
violationEvent_securityProfileName :: Lens.Lens' ViolationEvent (Prelude.Maybe Prelude.Text)
violationEvent_securityProfileName :: (Maybe Text -> f (Maybe Text))
-> ViolationEvent -> f ViolationEvent
violationEvent_securityProfileName = (ViolationEvent -> Maybe Text)
-> (ViolationEvent -> Maybe Text -> ViolationEvent)
-> Lens ViolationEvent ViolationEvent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ViolationEvent' {Maybe Text
securityProfileName :: Maybe Text
$sel:securityProfileName:ViolationEvent' :: ViolationEvent -> Maybe Text
securityProfileName} -> Maybe Text
securityProfileName) (\s :: ViolationEvent
s@ViolationEvent' {} Maybe Text
a -> ViolationEvent
s {$sel:securityProfileName:ViolationEvent' :: Maybe Text
securityProfileName = Maybe Text
a} :: ViolationEvent)

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

-- | The time the violation event occurred.
violationEvent_violationEventTime :: Lens.Lens' ViolationEvent (Prelude.Maybe Prelude.UTCTime)
violationEvent_violationEventTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ViolationEvent -> f ViolationEvent
violationEvent_violationEventTime = (ViolationEvent -> Maybe POSIX)
-> (ViolationEvent -> Maybe POSIX -> ViolationEvent)
-> Lens ViolationEvent ViolationEvent (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ViolationEvent' {Maybe POSIX
violationEventTime :: Maybe POSIX
$sel:violationEventTime:ViolationEvent' :: ViolationEvent -> Maybe POSIX
violationEventTime} -> Maybe POSIX
violationEventTime) (\s :: ViolationEvent
s@ViolationEvent' {} Maybe POSIX
a -> ViolationEvent
s {$sel:violationEventTime:ViolationEvent' :: Maybe POSIX
violationEventTime = Maybe POSIX
a} :: ViolationEvent) ((Maybe POSIX -> f (Maybe POSIX))
 -> ViolationEvent -> f ViolationEvent)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ViolationEvent
-> f ViolationEvent
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 name of the thing responsible for the violation event.
violationEvent_thingName :: Lens.Lens' ViolationEvent (Prelude.Maybe Prelude.Text)
violationEvent_thingName :: (Maybe Text -> f (Maybe Text))
-> ViolationEvent -> f ViolationEvent
violationEvent_thingName = (ViolationEvent -> Maybe Text)
-> (ViolationEvent -> Maybe Text -> ViolationEvent)
-> Lens ViolationEvent ViolationEvent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ViolationEvent' {Maybe Text
thingName :: Maybe Text
$sel:thingName:ViolationEvent' :: ViolationEvent -> Maybe Text
thingName} -> Maybe Text
thingName) (\s :: ViolationEvent
s@ViolationEvent' {} Maybe Text
a -> ViolationEvent
s {$sel:thingName:ViolationEvent' :: Maybe Text
thingName = Maybe Text
a} :: ViolationEvent)

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

instance Core.FromJSON ViolationEvent where
  parseJSON :: Value -> Parser ViolationEvent
parseJSON =
    String
-> (Object -> Parser ViolationEvent)
-> Value
-> Parser ViolationEvent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ViolationEvent"
      ( \Object
x ->
          Maybe ViolationEventType
-> Maybe Text
-> Maybe Text
-> Maybe Behavior
-> Maybe MetricValue
-> Maybe Text
-> Maybe ViolationEventAdditionalInfo
-> Maybe POSIX
-> Maybe Text
-> Maybe VerificationState
-> ViolationEvent
ViolationEvent'
            (Maybe ViolationEventType
 -> Maybe Text
 -> Maybe Text
 -> Maybe Behavior
 -> Maybe MetricValue
 -> Maybe Text
 -> Maybe ViolationEventAdditionalInfo
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe VerificationState
 -> ViolationEvent)
-> Parser (Maybe ViolationEventType)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Behavior
      -> Maybe MetricValue
      -> Maybe Text
      -> Maybe ViolationEventAdditionalInfo
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe VerificationState
      -> ViolationEvent)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ViolationEventType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"violationEventType")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Behavior
   -> Maybe MetricValue
   -> Maybe Text
   -> Maybe ViolationEventAdditionalInfo
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe VerificationState
   -> ViolationEvent)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Behavior
      -> Maybe MetricValue
      -> Maybe Text
      -> Maybe ViolationEventAdditionalInfo
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe VerificationState
      -> ViolationEvent)
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
"verificationStateDescription")
            Parser
  (Maybe Text
   -> Maybe Behavior
   -> Maybe MetricValue
   -> Maybe Text
   -> Maybe ViolationEventAdditionalInfo
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe VerificationState
   -> ViolationEvent)
-> Parser (Maybe Text)
-> Parser
     (Maybe Behavior
      -> Maybe MetricValue
      -> Maybe Text
      -> Maybe ViolationEventAdditionalInfo
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe VerificationState
      -> ViolationEvent)
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 MetricValue
   -> Maybe Text
   -> Maybe ViolationEventAdditionalInfo
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe VerificationState
   -> ViolationEvent)
-> Parser (Maybe Behavior)
-> Parser
     (Maybe MetricValue
      -> Maybe Text
      -> Maybe ViolationEventAdditionalInfo
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe VerificationState
      -> ViolationEvent)
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 MetricValue
   -> Maybe Text
   -> Maybe ViolationEventAdditionalInfo
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe VerificationState
   -> ViolationEvent)
-> Parser (Maybe MetricValue)
-> Parser
     (Maybe Text
      -> Maybe ViolationEventAdditionalInfo
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe VerificationState
      -> ViolationEvent)
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
"metricValue")
            Parser
  (Maybe Text
   -> Maybe ViolationEventAdditionalInfo
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe VerificationState
   -> ViolationEvent)
-> Parser (Maybe Text)
-> Parser
     (Maybe ViolationEventAdditionalInfo
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe VerificationState
      -> ViolationEvent)
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 POSIX
   -> Maybe Text
   -> Maybe VerificationState
   -> ViolationEvent)
-> Parser (Maybe ViolationEventAdditionalInfo)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe VerificationState -> ViolationEvent)
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 POSIX
   -> Maybe Text -> Maybe VerificationState -> ViolationEvent)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe VerificationState -> ViolationEvent)
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
"violationEventTime")
            Parser (Maybe Text -> Maybe VerificationState -> ViolationEvent)
-> Parser (Maybe Text)
-> Parser (Maybe VerificationState -> ViolationEvent)
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 -> ViolationEvent)
-> Parser (Maybe VerificationState) -> Parser ViolationEvent
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 ViolationEvent

instance Prelude.NFData ViolationEvent