{-# 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.Outcome
-- 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.Outcome where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The outcome.
--
-- /See:/ 'newOutcome' smart constructor.
data Outcome = Outcome'
  { -- | The timestamp when the outcome was last updated.
    Outcome -> Maybe Text
lastUpdatedTime :: Prelude.Maybe Prelude.Text,
    -- | The outcome ARN.
    Outcome -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when the outcome was created.
    Outcome -> Maybe Text
createdTime :: Prelude.Maybe Prelude.Text,
    -- | The outcome name.
    Outcome -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The outcome description.
    Outcome -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (Outcome -> Outcome -> Bool
(Outcome -> Outcome -> Bool)
-> (Outcome -> Outcome -> Bool) -> Eq Outcome
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Outcome -> Outcome -> Bool
$c/= :: Outcome -> Outcome -> Bool
== :: Outcome -> Outcome -> Bool
$c== :: Outcome -> Outcome -> Bool
Prelude.Eq, ReadPrec [Outcome]
ReadPrec Outcome
Int -> ReadS Outcome
ReadS [Outcome]
(Int -> ReadS Outcome)
-> ReadS [Outcome]
-> ReadPrec Outcome
-> ReadPrec [Outcome]
-> Read Outcome
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Outcome]
$creadListPrec :: ReadPrec [Outcome]
readPrec :: ReadPrec Outcome
$creadPrec :: ReadPrec Outcome
readList :: ReadS [Outcome]
$creadList :: ReadS [Outcome]
readsPrec :: Int -> ReadS Outcome
$creadsPrec :: Int -> ReadS Outcome
Prelude.Read, Int -> Outcome -> ShowS
[Outcome] -> ShowS
Outcome -> String
(Int -> Outcome -> ShowS)
-> (Outcome -> String) -> ([Outcome] -> ShowS) -> Show Outcome
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Outcome] -> ShowS
$cshowList :: [Outcome] -> ShowS
show :: Outcome -> String
$cshow :: Outcome -> String
showsPrec :: Int -> Outcome -> ShowS
$cshowsPrec :: Int -> Outcome -> ShowS
Prelude.Show, (forall x. Outcome -> Rep Outcome x)
-> (forall x. Rep Outcome x -> Outcome) -> Generic Outcome
forall x. Rep Outcome x -> Outcome
forall x. Outcome -> Rep Outcome x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Outcome x -> Outcome
$cfrom :: forall x. Outcome -> Rep Outcome x
Prelude.Generic)

-- |
-- Create a value of 'Outcome' 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:
--
-- 'lastUpdatedTime', 'outcome_lastUpdatedTime' - The timestamp when the outcome was last updated.
--
-- 'arn', 'outcome_arn' - The outcome ARN.
--
-- 'createdTime', 'outcome_createdTime' - The timestamp when the outcome was created.
--
-- 'name', 'outcome_name' - The outcome name.
--
-- 'description', 'outcome_description' - The outcome description.
newOutcome ::
  Outcome
newOutcome :: Outcome
newOutcome =
  Outcome' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Outcome
Outcome'
    { $sel:lastUpdatedTime:Outcome' :: Maybe Text
lastUpdatedTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:Outcome' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:Outcome' :: Maybe Text
createdTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Outcome' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Outcome' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The timestamp when the outcome was last updated.
outcome_lastUpdatedTime :: Lens.Lens' Outcome (Prelude.Maybe Prelude.Text)
outcome_lastUpdatedTime :: (Maybe Text -> f (Maybe Text)) -> Outcome -> f Outcome
outcome_lastUpdatedTime = (Outcome -> Maybe Text)
-> (Outcome -> Maybe Text -> Outcome)
-> Lens Outcome Outcome (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Outcome' {Maybe Text
lastUpdatedTime :: Maybe Text
$sel:lastUpdatedTime:Outcome' :: Outcome -> Maybe Text
lastUpdatedTime} -> Maybe Text
lastUpdatedTime) (\s :: Outcome
s@Outcome' {} Maybe Text
a -> Outcome
s {$sel:lastUpdatedTime:Outcome' :: Maybe Text
lastUpdatedTime = Maybe Text
a} :: Outcome)

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

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

-- | The outcome name.
outcome_name :: Lens.Lens' Outcome (Prelude.Maybe Prelude.Text)
outcome_name :: (Maybe Text -> f (Maybe Text)) -> Outcome -> f Outcome
outcome_name = (Outcome -> Maybe Text)
-> (Outcome -> Maybe Text -> Outcome)
-> Lens Outcome Outcome (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Outcome' {Maybe Text
name :: Maybe Text
$sel:name:Outcome' :: Outcome -> Maybe Text
name} -> Maybe Text
name) (\s :: Outcome
s@Outcome' {} Maybe Text
a -> Outcome
s {$sel:name:Outcome' :: Maybe Text
name = Maybe Text
a} :: Outcome)

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

instance Core.FromJSON Outcome where
  parseJSON :: Value -> Parser Outcome
parseJSON =
    String -> (Object -> Parser Outcome) -> Value -> Parser Outcome
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Outcome"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Outcome
Outcome'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Outcome)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Outcome)
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
"lastUpdatedTime")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Outcome)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Outcome)
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 Text -> Outcome)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Outcome)
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 Text -> Outcome)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Outcome)
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
"name")
            Parser (Maybe Text -> Outcome)
-> Parser (Maybe Text) -> Parser Outcome
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 Outcome

instance Prelude.NFData Outcome