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

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

-- | The Amazon SageMaker model.
--
-- /See:/ 'newExternalModelSummary' smart constructor.
data ExternalModelSummary = ExternalModelSummary'
  { -- | The endpoint of the Amazon SageMaker model.
    ExternalModelSummary -> Maybe Text
modelEndpoint :: Prelude.Maybe Prelude.Text,
    -- | The source of the model.
    ExternalModelSummary -> Maybe ModelSource
modelSource :: Prelude.Maybe ModelSource
  }
  deriving (ExternalModelSummary -> ExternalModelSummary -> Bool
(ExternalModelSummary -> ExternalModelSummary -> Bool)
-> (ExternalModelSummary -> ExternalModelSummary -> Bool)
-> Eq ExternalModelSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExternalModelSummary -> ExternalModelSummary -> Bool
$c/= :: ExternalModelSummary -> ExternalModelSummary -> Bool
== :: ExternalModelSummary -> ExternalModelSummary -> Bool
$c== :: ExternalModelSummary -> ExternalModelSummary -> Bool
Prelude.Eq, ReadPrec [ExternalModelSummary]
ReadPrec ExternalModelSummary
Int -> ReadS ExternalModelSummary
ReadS [ExternalModelSummary]
(Int -> ReadS ExternalModelSummary)
-> ReadS [ExternalModelSummary]
-> ReadPrec ExternalModelSummary
-> ReadPrec [ExternalModelSummary]
-> Read ExternalModelSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExternalModelSummary]
$creadListPrec :: ReadPrec [ExternalModelSummary]
readPrec :: ReadPrec ExternalModelSummary
$creadPrec :: ReadPrec ExternalModelSummary
readList :: ReadS [ExternalModelSummary]
$creadList :: ReadS [ExternalModelSummary]
readsPrec :: Int -> ReadS ExternalModelSummary
$creadsPrec :: Int -> ReadS ExternalModelSummary
Prelude.Read, Int -> ExternalModelSummary -> ShowS
[ExternalModelSummary] -> ShowS
ExternalModelSummary -> String
(Int -> ExternalModelSummary -> ShowS)
-> (ExternalModelSummary -> String)
-> ([ExternalModelSummary] -> ShowS)
-> Show ExternalModelSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExternalModelSummary] -> ShowS
$cshowList :: [ExternalModelSummary] -> ShowS
show :: ExternalModelSummary -> String
$cshow :: ExternalModelSummary -> String
showsPrec :: Int -> ExternalModelSummary -> ShowS
$cshowsPrec :: Int -> ExternalModelSummary -> ShowS
Prelude.Show, (forall x. ExternalModelSummary -> Rep ExternalModelSummary x)
-> (forall x. Rep ExternalModelSummary x -> ExternalModelSummary)
-> Generic ExternalModelSummary
forall x. Rep ExternalModelSummary x -> ExternalModelSummary
forall x. ExternalModelSummary -> Rep ExternalModelSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExternalModelSummary x -> ExternalModelSummary
$cfrom :: forall x. ExternalModelSummary -> Rep ExternalModelSummary x
Prelude.Generic)

-- |
-- Create a value of 'ExternalModelSummary' 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:
--
-- 'modelEndpoint', 'externalModelSummary_modelEndpoint' - The endpoint of the Amazon SageMaker model.
--
-- 'modelSource', 'externalModelSummary_modelSource' - The source of the model.
newExternalModelSummary ::
  ExternalModelSummary
newExternalModelSummary :: ExternalModelSummary
newExternalModelSummary =
  ExternalModelSummary' :: Maybe Text -> Maybe ModelSource -> ExternalModelSummary
ExternalModelSummary'
    { $sel:modelEndpoint:ExternalModelSummary' :: Maybe Text
modelEndpoint =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:modelSource:ExternalModelSummary' :: Maybe ModelSource
modelSource = Maybe ModelSource
forall a. Maybe a
Prelude.Nothing
    }

-- | The endpoint of the Amazon SageMaker model.
externalModelSummary_modelEndpoint :: Lens.Lens' ExternalModelSummary (Prelude.Maybe Prelude.Text)
externalModelSummary_modelEndpoint :: (Maybe Text -> f (Maybe Text))
-> ExternalModelSummary -> f ExternalModelSummary
externalModelSummary_modelEndpoint = (ExternalModelSummary -> Maybe Text)
-> (ExternalModelSummary -> Maybe Text -> ExternalModelSummary)
-> Lens
     ExternalModelSummary ExternalModelSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalModelSummary' {Maybe Text
modelEndpoint :: Maybe Text
$sel:modelEndpoint:ExternalModelSummary' :: ExternalModelSummary -> Maybe Text
modelEndpoint} -> Maybe Text
modelEndpoint) (\s :: ExternalModelSummary
s@ExternalModelSummary' {} Maybe Text
a -> ExternalModelSummary
s {$sel:modelEndpoint:ExternalModelSummary' :: Maybe Text
modelEndpoint = Maybe Text
a} :: ExternalModelSummary)

-- | The source of the model.
externalModelSummary_modelSource :: Lens.Lens' ExternalModelSummary (Prelude.Maybe ModelSource)
externalModelSummary_modelSource :: (Maybe ModelSource -> f (Maybe ModelSource))
-> ExternalModelSummary -> f ExternalModelSummary
externalModelSummary_modelSource = (ExternalModelSummary -> Maybe ModelSource)
-> (ExternalModelSummary
    -> Maybe ModelSource -> ExternalModelSummary)
-> Lens
     ExternalModelSummary
     ExternalModelSummary
     (Maybe ModelSource)
     (Maybe ModelSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalModelSummary' {Maybe ModelSource
modelSource :: Maybe ModelSource
$sel:modelSource:ExternalModelSummary' :: ExternalModelSummary -> Maybe ModelSource
modelSource} -> Maybe ModelSource
modelSource) (\s :: ExternalModelSummary
s@ExternalModelSummary' {} Maybe ModelSource
a -> ExternalModelSummary
s {$sel:modelSource:ExternalModelSummary' :: Maybe ModelSource
modelSource = Maybe ModelSource
a} :: ExternalModelSummary)

instance Core.FromJSON ExternalModelSummary where
  parseJSON :: Value -> Parser ExternalModelSummary
parseJSON =
    String
-> (Object -> Parser ExternalModelSummary)
-> Value
-> Parser ExternalModelSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ExternalModelSummary"
      ( \Object
x ->
          Maybe Text -> Maybe ModelSource -> ExternalModelSummary
ExternalModelSummary'
            (Maybe Text -> Maybe ModelSource -> ExternalModelSummary)
-> Parser (Maybe Text)
-> Parser (Maybe ModelSource -> ExternalModelSummary)
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
"modelEndpoint")
            Parser (Maybe ModelSource -> ExternalModelSummary)
-> Parser (Maybe ModelSource) -> Parser ExternalModelSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ModelSource)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"modelSource")
      )

instance Prelude.Hashable ExternalModelSummary

instance Prelude.NFData ExternalModelSummary