{-# 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.IoTEventsData.Types.RuleEvaluation
-- 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.IoTEventsData.Types.RuleEvaluation where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTEventsData.Types.SimpleRuleEvaluation
import qualified Amazonka.Prelude as Prelude

-- | Information needed to evaluate data.
--
-- /See:/ 'newRuleEvaluation' smart constructor.
data RuleEvaluation = RuleEvaluation'
  { -- | Information needed to compare two values with a comparison operator.
    RuleEvaluation -> Maybe SimpleRuleEvaluation
simpleRuleEvaluation :: Prelude.Maybe SimpleRuleEvaluation
  }
  deriving (RuleEvaluation -> RuleEvaluation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RuleEvaluation -> RuleEvaluation -> Bool
$c/= :: RuleEvaluation -> RuleEvaluation -> Bool
== :: RuleEvaluation -> RuleEvaluation -> Bool
$c== :: RuleEvaluation -> RuleEvaluation -> Bool
Prelude.Eq, ReadPrec [RuleEvaluation]
ReadPrec RuleEvaluation
Int -> ReadS RuleEvaluation
ReadS [RuleEvaluation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RuleEvaluation]
$creadListPrec :: ReadPrec [RuleEvaluation]
readPrec :: ReadPrec RuleEvaluation
$creadPrec :: ReadPrec RuleEvaluation
readList :: ReadS [RuleEvaluation]
$creadList :: ReadS [RuleEvaluation]
readsPrec :: Int -> ReadS RuleEvaluation
$creadsPrec :: Int -> ReadS RuleEvaluation
Prelude.Read, Int -> RuleEvaluation -> ShowS
[RuleEvaluation] -> ShowS
RuleEvaluation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RuleEvaluation] -> ShowS
$cshowList :: [RuleEvaluation] -> ShowS
show :: RuleEvaluation -> String
$cshow :: RuleEvaluation -> String
showsPrec :: Int -> RuleEvaluation -> ShowS
$cshowsPrec :: Int -> RuleEvaluation -> ShowS
Prelude.Show, forall x. Rep RuleEvaluation x -> RuleEvaluation
forall x. RuleEvaluation -> Rep RuleEvaluation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RuleEvaluation x -> RuleEvaluation
$cfrom :: forall x. RuleEvaluation -> Rep RuleEvaluation x
Prelude.Generic)

-- |
-- Create a value of 'RuleEvaluation' 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:
--
-- 'simpleRuleEvaluation', 'ruleEvaluation_simpleRuleEvaluation' - Information needed to compare two values with a comparison operator.
newRuleEvaluation ::
  RuleEvaluation
newRuleEvaluation :: RuleEvaluation
newRuleEvaluation =
  RuleEvaluation'
    { $sel:simpleRuleEvaluation:RuleEvaluation' :: Maybe SimpleRuleEvaluation
simpleRuleEvaluation =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Information needed to compare two values with a comparison operator.
ruleEvaluation_simpleRuleEvaluation :: Lens.Lens' RuleEvaluation (Prelude.Maybe SimpleRuleEvaluation)
ruleEvaluation_simpleRuleEvaluation :: Lens' RuleEvaluation (Maybe SimpleRuleEvaluation)
ruleEvaluation_simpleRuleEvaluation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleEvaluation' {Maybe SimpleRuleEvaluation
simpleRuleEvaluation :: Maybe SimpleRuleEvaluation
$sel:simpleRuleEvaluation:RuleEvaluation' :: RuleEvaluation -> Maybe SimpleRuleEvaluation
simpleRuleEvaluation} -> Maybe SimpleRuleEvaluation
simpleRuleEvaluation) (\s :: RuleEvaluation
s@RuleEvaluation' {} Maybe SimpleRuleEvaluation
a -> RuleEvaluation
s {$sel:simpleRuleEvaluation:RuleEvaluation' :: Maybe SimpleRuleEvaluation
simpleRuleEvaluation = Maybe SimpleRuleEvaluation
a} :: RuleEvaluation)

instance Data.FromJSON RuleEvaluation where
  parseJSON :: Value -> Parser RuleEvaluation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RuleEvaluation"
      ( \Object
x ->
          Maybe SimpleRuleEvaluation -> RuleEvaluation
RuleEvaluation'
            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
"simpleRuleEvaluation")
      )

instance Prelude.Hashable RuleEvaluation where
  hashWithSalt :: Int -> RuleEvaluation -> Int
hashWithSalt Int
_salt RuleEvaluation' {Maybe SimpleRuleEvaluation
simpleRuleEvaluation :: Maybe SimpleRuleEvaluation
$sel:simpleRuleEvaluation:RuleEvaluation' :: RuleEvaluation -> Maybe SimpleRuleEvaluation
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SimpleRuleEvaluation
simpleRuleEvaluation

instance Prelude.NFData RuleEvaluation where
  rnf :: RuleEvaluation -> ()
rnf RuleEvaluation' {Maybe SimpleRuleEvaluation
simpleRuleEvaluation :: Maybe SimpleRuleEvaluation
$sel:simpleRuleEvaluation:RuleEvaluation' :: RuleEvaluation -> Maybe SimpleRuleEvaluation
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe SimpleRuleEvaluation
simpleRuleEvaluation