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

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

-- | The fraud prediction scores from Amazon SageMaker model.
--
-- /See:/ 'newExternalModelOutputs' smart constructor.
data ExternalModelOutputs = ExternalModelOutputs'
  { -- | The Amazon SageMaker model.
    ExternalModelOutputs -> Maybe ExternalModelSummary
externalModel :: Prelude.Maybe ExternalModelSummary,
    -- | The fraud prediction scores from Amazon SageMaker model.
    ExternalModelOutputs -> Maybe (HashMap Text Text)
outputs :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (ExternalModelOutputs -> ExternalModelOutputs -> Bool
(ExternalModelOutputs -> ExternalModelOutputs -> Bool)
-> (ExternalModelOutputs -> ExternalModelOutputs -> Bool)
-> Eq ExternalModelOutputs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExternalModelOutputs -> ExternalModelOutputs -> Bool
$c/= :: ExternalModelOutputs -> ExternalModelOutputs -> Bool
== :: ExternalModelOutputs -> ExternalModelOutputs -> Bool
$c== :: ExternalModelOutputs -> ExternalModelOutputs -> Bool
Prelude.Eq, ReadPrec [ExternalModelOutputs]
ReadPrec ExternalModelOutputs
Int -> ReadS ExternalModelOutputs
ReadS [ExternalModelOutputs]
(Int -> ReadS ExternalModelOutputs)
-> ReadS [ExternalModelOutputs]
-> ReadPrec ExternalModelOutputs
-> ReadPrec [ExternalModelOutputs]
-> Read ExternalModelOutputs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExternalModelOutputs]
$creadListPrec :: ReadPrec [ExternalModelOutputs]
readPrec :: ReadPrec ExternalModelOutputs
$creadPrec :: ReadPrec ExternalModelOutputs
readList :: ReadS [ExternalModelOutputs]
$creadList :: ReadS [ExternalModelOutputs]
readsPrec :: Int -> ReadS ExternalModelOutputs
$creadsPrec :: Int -> ReadS ExternalModelOutputs
Prelude.Read, Int -> ExternalModelOutputs -> ShowS
[ExternalModelOutputs] -> ShowS
ExternalModelOutputs -> String
(Int -> ExternalModelOutputs -> ShowS)
-> (ExternalModelOutputs -> String)
-> ([ExternalModelOutputs] -> ShowS)
-> Show ExternalModelOutputs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExternalModelOutputs] -> ShowS
$cshowList :: [ExternalModelOutputs] -> ShowS
show :: ExternalModelOutputs -> String
$cshow :: ExternalModelOutputs -> String
showsPrec :: Int -> ExternalModelOutputs -> ShowS
$cshowsPrec :: Int -> ExternalModelOutputs -> ShowS
Prelude.Show, (forall x. ExternalModelOutputs -> Rep ExternalModelOutputs x)
-> (forall x. Rep ExternalModelOutputs x -> ExternalModelOutputs)
-> Generic ExternalModelOutputs
forall x. Rep ExternalModelOutputs x -> ExternalModelOutputs
forall x. ExternalModelOutputs -> Rep ExternalModelOutputs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExternalModelOutputs x -> ExternalModelOutputs
$cfrom :: forall x. ExternalModelOutputs -> Rep ExternalModelOutputs x
Prelude.Generic)

-- |
-- Create a value of 'ExternalModelOutputs' 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:
--
-- 'externalModel', 'externalModelOutputs_externalModel' - The Amazon SageMaker model.
--
-- 'outputs', 'externalModelOutputs_outputs' - The fraud prediction scores from Amazon SageMaker model.
newExternalModelOutputs ::
  ExternalModelOutputs
newExternalModelOutputs :: ExternalModelOutputs
newExternalModelOutputs =
  ExternalModelOutputs' :: Maybe ExternalModelSummary
-> Maybe (HashMap Text Text) -> ExternalModelOutputs
ExternalModelOutputs'
    { $sel:externalModel:ExternalModelOutputs' :: Maybe ExternalModelSummary
externalModel =
        Maybe ExternalModelSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:outputs:ExternalModelOutputs' :: Maybe (HashMap Text Text)
outputs = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon SageMaker model.
externalModelOutputs_externalModel :: Lens.Lens' ExternalModelOutputs (Prelude.Maybe ExternalModelSummary)
externalModelOutputs_externalModel :: (Maybe ExternalModelSummary -> f (Maybe ExternalModelSummary))
-> ExternalModelOutputs -> f ExternalModelOutputs
externalModelOutputs_externalModel = (ExternalModelOutputs -> Maybe ExternalModelSummary)
-> (ExternalModelOutputs
    -> Maybe ExternalModelSummary -> ExternalModelOutputs)
-> Lens
     ExternalModelOutputs
     ExternalModelOutputs
     (Maybe ExternalModelSummary)
     (Maybe ExternalModelSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalModelOutputs' {Maybe ExternalModelSummary
externalModel :: Maybe ExternalModelSummary
$sel:externalModel:ExternalModelOutputs' :: ExternalModelOutputs -> Maybe ExternalModelSummary
externalModel} -> Maybe ExternalModelSummary
externalModel) (\s :: ExternalModelOutputs
s@ExternalModelOutputs' {} Maybe ExternalModelSummary
a -> ExternalModelOutputs
s {$sel:externalModel:ExternalModelOutputs' :: Maybe ExternalModelSummary
externalModel = Maybe ExternalModelSummary
a} :: ExternalModelOutputs)

-- | The fraud prediction scores from Amazon SageMaker model.
externalModelOutputs_outputs :: Lens.Lens' ExternalModelOutputs (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
externalModelOutputs_outputs :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ExternalModelOutputs -> f ExternalModelOutputs
externalModelOutputs_outputs = (ExternalModelOutputs -> Maybe (HashMap Text Text))
-> (ExternalModelOutputs
    -> Maybe (HashMap Text Text) -> ExternalModelOutputs)
-> Lens
     ExternalModelOutputs
     ExternalModelOutputs
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalModelOutputs' {Maybe (HashMap Text Text)
outputs :: Maybe (HashMap Text Text)
$sel:outputs:ExternalModelOutputs' :: ExternalModelOutputs -> Maybe (HashMap Text Text)
outputs} -> Maybe (HashMap Text Text)
outputs) (\s :: ExternalModelOutputs
s@ExternalModelOutputs' {} Maybe (HashMap Text Text)
a -> ExternalModelOutputs
s {$sel:outputs:ExternalModelOutputs' :: Maybe (HashMap Text Text)
outputs = Maybe (HashMap Text Text)
a} :: ExternalModelOutputs) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> ExternalModelOutputs -> f ExternalModelOutputs)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ExternalModelOutputs
-> f ExternalModelOutputs
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON ExternalModelOutputs where
  parseJSON :: Value -> Parser ExternalModelOutputs
parseJSON =
    String
-> (Object -> Parser ExternalModelOutputs)
-> Value
-> Parser ExternalModelOutputs
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ExternalModelOutputs"
      ( \Object
x ->
          Maybe ExternalModelSummary
-> Maybe (HashMap Text Text) -> ExternalModelOutputs
ExternalModelOutputs'
            (Maybe ExternalModelSummary
 -> Maybe (HashMap Text Text) -> ExternalModelOutputs)
-> Parser (Maybe ExternalModelSummary)
-> Parser (Maybe (HashMap Text Text) -> ExternalModelOutputs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ExternalModelSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"externalModel")
            Parser (Maybe (HashMap Text Text) -> ExternalModelOutputs)
-> Parser (Maybe (HashMap Text Text))
-> Parser ExternalModelOutputs
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"outputs" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ExternalModelOutputs

instance Prelude.NFData ExternalModelOutputs