{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.FraudDetector.Types.Outcome where

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

-- | The outcome.
--
-- /See:/ 'newOutcome' smart constructor.
data Outcome = Outcome'
  { -- | 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 description.
    Outcome -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when the outcome was last updated.
    Outcome -> Maybe Text
lastUpdatedTime :: Prelude.Maybe Prelude.Text,
    -- | The outcome name.
    Outcome -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (Outcome -> Outcome -> Bool
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]
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
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. 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:
--
-- 'arn', 'outcome_arn' - The outcome ARN.
--
-- 'createdTime', 'outcome_createdTime' - The timestamp when the outcome was created.
--
-- 'description', 'outcome_description' - The outcome description.
--
-- 'lastUpdatedTime', 'outcome_lastUpdatedTime' - The timestamp when the outcome was last updated.
--
-- 'name', 'outcome_name' - The outcome name.
newOutcome ::
  Outcome
newOutcome :: Outcome
newOutcome =
  Outcome'
    { $sel:arn:Outcome' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:Outcome' :: Maybe Text
createdTime = forall a. Maybe a
Prelude.Nothing,
      $sel:description:Outcome' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTime:Outcome' :: Maybe Text
lastUpdatedTime = forall a. Maybe a
Prelude.Nothing,
      $sel:name:Outcome' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The outcome ARN.
outcome_arn :: Lens.Lens' Outcome (Prelude.Maybe Prelude.Text)
outcome_arn :: Lens' Outcome (Maybe Text)
outcome_arn = 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 :: Lens' Outcome (Maybe Text)
outcome_createdTime = 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 description.
outcome_description :: Lens.Lens' Outcome (Prelude.Maybe Prelude.Text)
outcome_description :: Lens' Outcome (Maybe Text)
outcome_description = 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)

-- | The timestamp when the outcome was last updated.
outcome_lastUpdatedTime :: Lens.Lens' Outcome (Prelude.Maybe Prelude.Text)
outcome_lastUpdatedTime :: Lens' Outcome (Maybe Text)
outcome_lastUpdatedTime = 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 name.
outcome_name :: Lens.Lens' Outcome (Prelude.Maybe Prelude.Text)
outcome_name :: Lens' Outcome (Maybe Text)
outcome_name = 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)

instance Data.FromJSON Outcome where
  parseJSON :: Value -> Parser Outcome
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Outcome"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Outcome
Outcome'
            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
"arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"createdTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lastUpdatedTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
      )

instance Prelude.Hashable Outcome where
  hashWithSalt :: Int -> Outcome -> Int
hashWithSalt Int
_salt Outcome' {Maybe Text
name :: Maybe Text
lastUpdatedTime :: Maybe Text
description :: Maybe Text
createdTime :: Maybe Text
arn :: Maybe Text
$sel:name:Outcome' :: Outcome -> Maybe Text
$sel:lastUpdatedTime:Outcome' :: Outcome -> Maybe Text
$sel:description:Outcome' :: Outcome -> Maybe Text
$sel:createdTime:Outcome' :: Outcome -> Maybe Text
$sel:arn:Outcome' :: Outcome -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
createdTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastUpdatedTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData Outcome where
  rnf :: Outcome -> ()
rnf Outcome' {Maybe Text
name :: Maybe Text
lastUpdatedTime :: Maybe Text
description :: Maybe Text
createdTime :: Maybe Text
arn :: Maybe Text
$sel:name:Outcome' :: Outcome -> Maybe Text
$sel:lastUpdatedTime:Outcome' :: Outcome -> Maybe Text
$sel:description:Outcome' :: Outcome -> Maybe Text
$sel:createdTime:Outcome' :: Outcome -> Maybe Text
$sel:arn:Outcome' :: Outcome -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
createdTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lastUpdatedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name