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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FraudDetector.Types.ModelSource
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
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]
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
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. 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'
    { $sel:modelEndpoint:ExternalModelSummary' :: Maybe Text
modelEndpoint =
        forall a. Maybe a
Prelude.Nothing,
      $sel:modelSource:ExternalModelSummary' :: Maybe ModelSource
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 :: Lens' ExternalModelSummary (Maybe Text)
externalModelSummary_modelEndpoint = 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 :: Lens' ExternalModelSummary (Maybe ModelSource)
externalModelSummary_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 Data.FromJSON ExternalModelSummary where
  parseJSON :: Value -> Parser ExternalModelSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ExternalModelSummary"
      ( \Object
x ->
          Maybe Text -> Maybe ModelSource -> ExternalModelSummary
ExternalModelSummary'
            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
"modelEndpoint")
            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
"modelSource")
      )

instance Prelude.Hashable ExternalModelSummary where
  hashWithSalt :: Int -> ExternalModelSummary -> Int
hashWithSalt Int
_salt ExternalModelSummary' {Maybe Text
Maybe ModelSource
modelSource :: Maybe ModelSource
modelEndpoint :: Maybe Text
$sel:modelSource:ExternalModelSummary' :: ExternalModelSummary -> Maybe ModelSource
$sel:modelEndpoint:ExternalModelSummary' :: ExternalModelSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
modelEndpoint
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ModelSource
modelSource

instance Prelude.NFData ExternalModelSummary where
  rnf :: ExternalModelSummary -> ()
rnf ExternalModelSummary' {Maybe Text
Maybe ModelSource
modelSource :: Maybe ModelSource
modelEndpoint :: Maybe Text
$sel:modelSource:ExternalModelSummary' :: ExternalModelSummary -> Maybe ModelSource
$sel:modelEndpoint:ExternalModelSummary' :: ExternalModelSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
modelEndpoint
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ModelSource
modelSource