{-# 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.FraudDetector.Types.RuleDetail
-- 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.FraudDetector.Types.RuleDetail where

import qualified Amazonka.Core as Core
import Amazonka.FraudDetector.Types.Language
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The details of the rule.
--
-- /See:/ 'newRuleDetail' smart constructor.
data RuleDetail = RuleDetail'
  { -- | The rule version.
    RuleDetail -> Maybe Text
ruleVersion :: Prelude.Maybe Prelude.Text,
    -- | Timestamp of the last time the rule was updated.
    RuleDetail -> Maybe Text
lastUpdatedTime :: Prelude.Maybe Prelude.Text,
    -- | The rule ARN.
    RuleDetail -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The timestamp of when the rule was created.
    RuleDetail -> Maybe Text
createdTime :: Prelude.Maybe Prelude.Text,
    -- | The rule ID.
    RuleDetail -> Maybe Text
ruleId :: Prelude.Maybe Prelude.Text,
    -- | The rule outcomes.
    RuleDetail -> Maybe (NonEmpty Text)
outcomes :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The detector for which the rule is associated.
    RuleDetail -> Maybe Text
detectorId :: Prelude.Maybe Prelude.Text,
    -- | The rule expression.
    RuleDetail -> Maybe (Sensitive Text)
expression :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The rule language.
    RuleDetail -> Maybe Language
language :: Prelude.Maybe Language,
    -- | The rule description.
    RuleDetail -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (RuleDetail -> RuleDetail -> Bool
(RuleDetail -> RuleDetail -> Bool)
-> (RuleDetail -> RuleDetail -> Bool) -> Eq RuleDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RuleDetail -> RuleDetail -> Bool
$c/= :: RuleDetail -> RuleDetail -> Bool
== :: RuleDetail -> RuleDetail -> Bool
$c== :: RuleDetail -> RuleDetail -> Bool
Prelude.Eq, Int -> RuleDetail -> ShowS
[RuleDetail] -> ShowS
RuleDetail -> String
(Int -> RuleDetail -> ShowS)
-> (RuleDetail -> String)
-> ([RuleDetail] -> ShowS)
-> Show RuleDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RuleDetail] -> ShowS
$cshowList :: [RuleDetail] -> ShowS
show :: RuleDetail -> String
$cshow :: RuleDetail -> String
showsPrec :: Int -> RuleDetail -> ShowS
$cshowsPrec :: Int -> RuleDetail -> ShowS
Prelude.Show, (forall x. RuleDetail -> Rep RuleDetail x)
-> (forall x. Rep RuleDetail x -> RuleDetail) -> Generic RuleDetail
forall x. Rep RuleDetail x -> RuleDetail
forall x. RuleDetail -> Rep RuleDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RuleDetail x -> RuleDetail
$cfrom :: forall x. RuleDetail -> Rep RuleDetail x
Prelude.Generic)

-- |
-- Create a value of 'RuleDetail' 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:
--
-- 'ruleVersion', 'ruleDetail_ruleVersion' - The rule version.
--
-- 'lastUpdatedTime', 'ruleDetail_lastUpdatedTime' - Timestamp of the last time the rule was updated.
--
-- 'arn', 'ruleDetail_arn' - The rule ARN.
--
-- 'createdTime', 'ruleDetail_createdTime' - The timestamp of when the rule was created.
--
-- 'ruleId', 'ruleDetail_ruleId' - The rule ID.
--
-- 'outcomes', 'ruleDetail_outcomes' - The rule outcomes.
--
-- 'detectorId', 'ruleDetail_detectorId' - The detector for which the rule is associated.
--
-- 'expression', 'ruleDetail_expression' - The rule expression.
--
-- 'language', 'ruleDetail_language' - The rule language.
--
-- 'description', 'ruleDetail_description' - The rule description.
newRuleDetail ::
  RuleDetail
newRuleDetail :: RuleDetail
newRuleDetail =
  RuleDetail' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Language
-> Maybe Text
-> RuleDetail
RuleDetail'
    { $sel:ruleVersion:RuleDetail' :: Maybe Text
ruleVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTime:RuleDetail' :: Maybe Text
lastUpdatedTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:RuleDetail' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:RuleDetail' :: Maybe Text
createdTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ruleId:RuleDetail' :: Maybe Text
ruleId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:outcomes:RuleDetail' :: Maybe (NonEmpty Text)
outcomes = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:detectorId:RuleDetail' :: Maybe Text
detectorId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:expression:RuleDetail' :: Maybe (Sensitive Text)
expression = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:language:RuleDetail' :: Maybe Language
language = Maybe Language
forall a. Maybe a
Prelude.Nothing,
      $sel:description:RuleDetail' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The rule version.
ruleDetail_ruleVersion :: Lens.Lens' RuleDetail (Prelude.Maybe Prelude.Text)
ruleDetail_ruleVersion :: (Maybe Text -> f (Maybe Text)) -> RuleDetail -> f RuleDetail
ruleDetail_ruleVersion = (RuleDetail -> Maybe Text)
-> (RuleDetail -> Maybe Text -> RuleDetail)
-> Lens RuleDetail RuleDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleDetail' {Maybe Text
ruleVersion :: Maybe Text
$sel:ruleVersion:RuleDetail' :: RuleDetail -> Maybe Text
ruleVersion} -> Maybe Text
ruleVersion) (\s :: RuleDetail
s@RuleDetail' {} Maybe Text
a -> RuleDetail
s {$sel:ruleVersion:RuleDetail' :: Maybe Text
ruleVersion = Maybe Text
a} :: RuleDetail)

-- | Timestamp of the last time the rule was updated.
ruleDetail_lastUpdatedTime :: Lens.Lens' RuleDetail (Prelude.Maybe Prelude.Text)
ruleDetail_lastUpdatedTime :: (Maybe Text -> f (Maybe Text)) -> RuleDetail -> f RuleDetail
ruleDetail_lastUpdatedTime = (RuleDetail -> Maybe Text)
-> (RuleDetail -> Maybe Text -> RuleDetail)
-> Lens RuleDetail RuleDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleDetail' {Maybe Text
lastUpdatedTime :: Maybe Text
$sel:lastUpdatedTime:RuleDetail' :: RuleDetail -> Maybe Text
lastUpdatedTime} -> Maybe Text
lastUpdatedTime) (\s :: RuleDetail
s@RuleDetail' {} Maybe Text
a -> RuleDetail
s {$sel:lastUpdatedTime:RuleDetail' :: Maybe Text
lastUpdatedTime = Maybe Text
a} :: RuleDetail)

-- | The rule ARN.
ruleDetail_arn :: Lens.Lens' RuleDetail (Prelude.Maybe Prelude.Text)
ruleDetail_arn :: (Maybe Text -> f (Maybe Text)) -> RuleDetail -> f RuleDetail
ruleDetail_arn = (RuleDetail -> Maybe Text)
-> (RuleDetail -> Maybe Text -> RuleDetail)
-> Lens RuleDetail RuleDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleDetail' {Maybe Text
arn :: Maybe Text
$sel:arn:RuleDetail' :: RuleDetail -> Maybe Text
arn} -> Maybe Text
arn) (\s :: RuleDetail
s@RuleDetail' {} Maybe Text
a -> RuleDetail
s {$sel:arn:RuleDetail' :: Maybe Text
arn = Maybe Text
a} :: RuleDetail)

-- | The timestamp of when the rule was created.
ruleDetail_createdTime :: Lens.Lens' RuleDetail (Prelude.Maybe Prelude.Text)
ruleDetail_createdTime :: (Maybe Text -> f (Maybe Text)) -> RuleDetail -> f RuleDetail
ruleDetail_createdTime = (RuleDetail -> Maybe Text)
-> (RuleDetail -> Maybe Text -> RuleDetail)
-> Lens RuleDetail RuleDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleDetail' {Maybe Text
createdTime :: Maybe Text
$sel:createdTime:RuleDetail' :: RuleDetail -> Maybe Text
createdTime} -> Maybe Text
createdTime) (\s :: RuleDetail
s@RuleDetail' {} Maybe Text
a -> RuleDetail
s {$sel:createdTime:RuleDetail' :: Maybe Text
createdTime = Maybe Text
a} :: RuleDetail)

-- | The rule ID.
ruleDetail_ruleId :: Lens.Lens' RuleDetail (Prelude.Maybe Prelude.Text)
ruleDetail_ruleId :: (Maybe Text -> f (Maybe Text)) -> RuleDetail -> f RuleDetail
ruleDetail_ruleId = (RuleDetail -> Maybe Text)
-> (RuleDetail -> Maybe Text -> RuleDetail)
-> Lens RuleDetail RuleDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleDetail' {Maybe Text
ruleId :: Maybe Text
$sel:ruleId:RuleDetail' :: RuleDetail -> Maybe Text
ruleId} -> Maybe Text
ruleId) (\s :: RuleDetail
s@RuleDetail' {} Maybe Text
a -> RuleDetail
s {$sel:ruleId:RuleDetail' :: Maybe Text
ruleId = Maybe Text
a} :: RuleDetail)

-- | The rule outcomes.
ruleDetail_outcomes :: Lens.Lens' RuleDetail (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
ruleDetail_outcomes :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> RuleDetail -> f RuleDetail
ruleDetail_outcomes = (RuleDetail -> Maybe (NonEmpty Text))
-> (RuleDetail -> Maybe (NonEmpty Text) -> RuleDetail)
-> Lens
     RuleDetail
     RuleDetail
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleDetail' {Maybe (NonEmpty Text)
outcomes :: Maybe (NonEmpty Text)
$sel:outcomes:RuleDetail' :: RuleDetail -> Maybe (NonEmpty Text)
outcomes} -> Maybe (NonEmpty Text)
outcomes) (\s :: RuleDetail
s@RuleDetail' {} Maybe (NonEmpty Text)
a -> RuleDetail
s {$sel:outcomes:RuleDetail' :: Maybe (NonEmpty Text)
outcomes = Maybe (NonEmpty Text)
a} :: RuleDetail) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> RuleDetail -> f RuleDetail)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> RuleDetail
-> f RuleDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The detector for which the rule is associated.
ruleDetail_detectorId :: Lens.Lens' RuleDetail (Prelude.Maybe Prelude.Text)
ruleDetail_detectorId :: (Maybe Text -> f (Maybe Text)) -> RuleDetail -> f RuleDetail
ruleDetail_detectorId = (RuleDetail -> Maybe Text)
-> (RuleDetail -> Maybe Text -> RuleDetail)
-> Lens RuleDetail RuleDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleDetail' {Maybe Text
detectorId :: Maybe Text
$sel:detectorId:RuleDetail' :: RuleDetail -> Maybe Text
detectorId} -> Maybe Text
detectorId) (\s :: RuleDetail
s@RuleDetail' {} Maybe Text
a -> RuleDetail
s {$sel:detectorId:RuleDetail' :: Maybe Text
detectorId = Maybe Text
a} :: RuleDetail)

-- | The rule expression.
ruleDetail_expression :: Lens.Lens' RuleDetail (Prelude.Maybe Prelude.Text)
ruleDetail_expression :: (Maybe Text -> f (Maybe Text)) -> RuleDetail -> f RuleDetail
ruleDetail_expression = (RuleDetail -> Maybe (Sensitive Text))
-> (RuleDetail -> Maybe (Sensitive Text) -> RuleDetail)
-> Lens
     RuleDetail
     RuleDetail
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleDetail' {Maybe (Sensitive Text)
expression :: Maybe (Sensitive Text)
$sel:expression:RuleDetail' :: RuleDetail -> Maybe (Sensitive Text)
expression} -> Maybe (Sensitive Text)
expression) (\s :: RuleDetail
s@RuleDetail' {} Maybe (Sensitive Text)
a -> RuleDetail
s {$sel:expression:RuleDetail' :: Maybe (Sensitive Text)
expression = Maybe (Sensitive Text)
a} :: RuleDetail) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> RuleDetail -> f RuleDetail)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> RuleDetail
-> f RuleDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The rule language.
ruleDetail_language :: Lens.Lens' RuleDetail (Prelude.Maybe Language)
ruleDetail_language :: (Maybe Language -> f (Maybe Language))
-> RuleDetail -> f RuleDetail
ruleDetail_language = (RuleDetail -> Maybe Language)
-> (RuleDetail -> Maybe Language -> RuleDetail)
-> Lens RuleDetail RuleDetail (Maybe Language) (Maybe Language)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleDetail' {Maybe Language
language :: Maybe Language
$sel:language:RuleDetail' :: RuleDetail -> Maybe Language
language} -> Maybe Language
language) (\s :: RuleDetail
s@RuleDetail' {} Maybe Language
a -> RuleDetail
s {$sel:language:RuleDetail' :: Maybe Language
language = Maybe Language
a} :: RuleDetail)

-- | The rule description.
ruleDetail_description :: Lens.Lens' RuleDetail (Prelude.Maybe Prelude.Text)
ruleDetail_description :: (Maybe Text -> f (Maybe Text)) -> RuleDetail -> f RuleDetail
ruleDetail_description = (RuleDetail -> Maybe Text)
-> (RuleDetail -> Maybe Text -> RuleDetail)
-> Lens RuleDetail RuleDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleDetail' {Maybe Text
description :: Maybe Text
$sel:description:RuleDetail' :: RuleDetail -> Maybe Text
description} -> Maybe Text
description) (\s :: RuleDetail
s@RuleDetail' {} Maybe Text
a -> RuleDetail
s {$sel:description:RuleDetail' :: Maybe Text
description = Maybe Text
a} :: RuleDetail)

instance Core.FromJSON RuleDetail where
  parseJSON :: Value -> Parser RuleDetail
parseJSON =
    String
-> (Object -> Parser RuleDetail) -> Value -> Parser RuleDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RuleDetail"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Language
-> Maybe Text
-> RuleDetail
RuleDetail'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (NonEmpty Text)
 -> Maybe Text
 -> Maybe (Sensitive Text)
 -> Maybe Language
 -> Maybe Text
 -> RuleDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe Language
      -> Maybe Text
      -> RuleDetail)
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
"ruleVersion")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe Language
   -> Maybe Text
   -> RuleDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe Language
      -> Maybe Text
      -> RuleDetail)
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
"lastUpdatedTime")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe Language
   -> Maybe Text
   -> RuleDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe Language
      -> Maybe Text
      -> RuleDetail)
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
"arn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe Language
   -> Maybe Text
   -> RuleDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe Language
      -> Maybe Text
      -> RuleDetail)
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
"createdTime")
            Parser
  (Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe Language
   -> Maybe Text
   -> RuleDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe Language
      -> Maybe Text
      -> RuleDetail)
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
"ruleId")
            Parser
  (Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe Language
   -> Maybe Text
   -> RuleDetail)
-> Parser (Maybe (NonEmpty Text))
-> Parser
     (Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe Language
      -> Maybe Text
      -> RuleDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"outcomes")
            Parser
  (Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe Language
   -> Maybe Text
   -> RuleDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe (Sensitive Text)
      -> Maybe Language -> Maybe Text -> RuleDetail)
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
"detectorId")
            Parser
  (Maybe (Sensitive Text)
   -> Maybe Language -> Maybe Text -> RuleDetail)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe Language -> Maybe Text -> RuleDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"expression")
            Parser (Maybe Language -> Maybe Text -> RuleDetail)
-> Parser (Maybe Language) -> Parser (Maybe Text -> RuleDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Language)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"language")
            Parser (Maybe Text -> RuleDetail)
-> Parser (Maybe Text) -> Parser RuleDetail
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
"description")
      )

instance Prelude.Hashable RuleDetail

instance Prelude.NFData RuleDetail