{-# 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.ExternalModel
-- 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.ExternalModel 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.ModelEndpointStatus
import Amazonka.FraudDetector.Types.ModelInputConfiguration
import Amazonka.FraudDetector.Types.ModelOutputConfiguration
import Amazonka.FraudDetector.Types.ModelSource
import qualified Amazonka.Prelude as Prelude

-- | The Amazon SageMaker model.
--
-- /See:/ 'newExternalModel' smart constructor.
data ExternalModel = ExternalModel'
  { -- | The model ARN.
    ExternalModel -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Timestamp of when the model was last created.
    ExternalModel -> Maybe Text
createdTime :: Prelude.Maybe Prelude.Text,
    -- | The input configuration.
    ExternalModel -> Maybe ModelInputConfiguration
inputConfiguration :: Prelude.Maybe ModelInputConfiguration,
    -- | The role used to invoke the model.
    ExternalModel -> Maybe Text
invokeModelEndpointRoleArn :: Prelude.Maybe Prelude.Text,
    -- | Timestamp of when the model was last updated.
    ExternalModel -> Maybe Text
lastUpdatedTime :: Prelude.Maybe Prelude.Text,
    -- | The Amazon SageMaker model endpoints.
    ExternalModel -> Maybe Text
modelEndpoint :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Fraud Detector status for the external model endpoint
    ExternalModel -> Maybe ModelEndpointStatus
modelEndpointStatus :: Prelude.Maybe ModelEndpointStatus,
    -- | The source of the model.
    ExternalModel -> Maybe ModelSource
modelSource :: Prelude.Maybe ModelSource,
    -- | The output configuration.
    ExternalModel -> Maybe ModelOutputConfiguration
outputConfiguration :: Prelude.Maybe ModelOutputConfiguration
  }
  deriving (ExternalModel -> ExternalModel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExternalModel -> ExternalModel -> Bool
$c/= :: ExternalModel -> ExternalModel -> Bool
== :: ExternalModel -> ExternalModel -> Bool
$c== :: ExternalModel -> ExternalModel -> Bool
Prelude.Eq, ReadPrec [ExternalModel]
ReadPrec ExternalModel
Int -> ReadS ExternalModel
ReadS [ExternalModel]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExternalModel]
$creadListPrec :: ReadPrec [ExternalModel]
readPrec :: ReadPrec ExternalModel
$creadPrec :: ReadPrec ExternalModel
readList :: ReadS [ExternalModel]
$creadList :: ReadS [ExternalModel]
readsPrec :: Int -> ReadS ExternalModel
$creadsPrec :: Int -> ReadS ExternalModel
Prelude.Read, Int -> ExternalModel -> ShowS
[ExternalModel] -> ShowS
ExternalModel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExternalModel] -> ShowS
$cshowList :: [ExternalModel] -> ShowS
show :: ExternalModel -> String
$cshow :: ExternalModel -> String
showsPrec :: Int -> ExternalModel -> ShowS
$cshowsPrec :: Int -> ExternalModel -> ShowS
Prelude.Show, forall x. Rep ExternalModel x -> ExternalModel
forall x. ExternalModel -> Rep ExternalModel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExternalModel x -> ExternalModel
$cfrom :: forall x. ExternalModel -> Rep ExternalModel x
Prelude.Generic)

-- |
-- Create a value of 'ExternalModel' 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', 'externalModel_arn' - The model ARN.
--
-- 'createdTime', 'externalModel_createdTime' - Timestamp of when the model was last created.
--
-- 'inputConfiguration', 'externalModel_inputConfiguration' - The input configuration.
--
-- 'invokeModelEndpointRoleArn', 'externalModel_invokeModelEndpointRoleArn' - The role used to invoke the model.
--
-- 'lastUpdatedTime', 'externalModel_lastUpdatedTime' - Timestamp of when the model was last updated.
--
-- 'modelEndpoint', 'externalModel_modelEndpoint' - The Amazon SageMaker model endpoints.
--
-- 'modelEndpointStatus', 'externalModel_modelEndpointStatus' - The Amazon Fraud Detector status for the external model endpoint
--
-- 'modelSource', 'externalModel_modelSource' - The source of the model.
--
-- 'outputConfiguration', 'externalModel_outputConfiguration' - The output configuration.
newExternalModel ::
  ExternalModel
newExternalModel :: ExternalModel
newExternalModel =
  ExternalModel'
    { $sel:arn:ExternalModel' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:ExternalModel' :: Maybe Text
createdTime = forall a. Maybe a
Prelude.Nothing,
      $sel:inputConfiguration:ExternalModel' :: Maybe ModelInputConfiguration
inputConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:invokeModelEndpointRoleArn:ExternalModel' :: Maybe Text
invokeModelEndpointRoleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTime:ExternalModel' :: Maybe Text
lastUpdatedTime = forall a. Maybe a
Prelude.Nothing,
      $sel:modelEndpoint:ExternalModel' :: Maybe Text
modelEndpoint = forall a. Maybe a
Prelude.Nothing,
      $sel:modelEndpointStatus:ExternalModel' :: Maybe ModelEndpointStatus
modelEndpointStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:modelSource:ExternalModel' :: Maybe ModelSource
modelSource = forall a. Maybe a
Prelude.Nothing,
      $sel:outputConfiguration:ExternalModel' :: Maybe ModelOutputConfiguration
outputConfiguration = forall a. Maybe a
Prelude.Nothing
    }

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

-- | Timestamp of when the model was last created.
externalModel_createdTime :: Lens.Lens' ExternalModel (Prelude.Maybe Prelude.Text)
externalModel_createdTime :: Lens' ExternalModel (Maybe Text)
externalModel_createdTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalModel' {Maybe Text
createdTime :: Maybe Text
$sel:createdTime:ExternalModel' :: ExternalModel -> Maybe Text
createdTime} -> Maybe Text
createdTime) (\s :: ExternalModel
s@ExternalModel' {} Maybe Text
a -> ExternalModel
s {$sel:createdTime:ExternalModel' :: Maybe Text
createdTime = Maybe Text
a} :: ExternalModel)

-- | The input configuration.
externalModel_inputConfiguration :: Lens.Lens' ExternalModel (Prelude.Maybe ModelInputConfiguration)
externalModel_inputConfiguration :: Lens' ExternalModel (Maybe ModelInputConfiguration)
externalModel_inputConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalModel' {Maybe ModelInputConfiguration
inputConfiguration :: Maybe ModelInputConfiguration
$sel:inputConfiguration:ExternalModel' :: ExternalModel -> Maybe ModelInputConfiguration
inputConfiguration} -> Maybe ModelInputConfiguration
inputConfiguration) (\s :: ExternalModel
s@ExternalModel' {} Maybe ModelInputConfiguration
a -> ExternalModel
s {$sel:inputConfiguration:ExternalModel' :: Maybe ModelInputConfiguration
inputConfiguration = Maybe ModelInputConfiguration
a} :: ExternalModel)

-- | The role used to invoke the model.
externalModel_invokeModelEndpointRoleArn :: Lens.Lens' ExternalModel (Prelude.Maybe Prelude.Text)
externalModel_invokeModelEndpointRoleArn :: Lens' ExternalModel (Maybe Text)
externalModel_invokeModelEndpointRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalModel' {Maybe Text
invokeModelEndpointRoleArn :: Maybe Text
$sel:invokeModelEndpointRoleArn:ExternalModel' :: ExternalModel -> Maybe Text
invokeModelEndpointRoleArn} -> Maybe Text
invokeModelEndpointRoleArn) (\s :: ExternalModel
s@ExternalModel' {} Maybe Text
a -> ExternalModel
s {$sel:invokeModelEndpointRoleArn:ExternalModel' :: Maybe Text
invokeModelEndpointRoleArn = Maybe Text
a} :: ExternalModel)

-- | Timestamp of when the model was last updated.
externalModel_lastUpdatedTime :: Lens.Lens' ExternalModel (Prelude.Maybe Prelude.Text)
externalModel_lastUpdatedTime :: Lens' ExternalModel (Maybe Text)
externalModel_lastUpdatedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalModel' {Maybe Text
lastUpdatedTime :: Maybe Text
$sel:lastUpdatedTime:ExternalModel' :: ExternalModel -> Maybe Text
lastUpdatedTime} -> Maybe Text
lastUpdatedTime) (\s :: ExternalModel
s@ExternalModel' {} Maybe Text
a -> ExternalModel
s {$sel:lastUpdatedTime:ExternalModel' :: Maybe Text
lastUpdatedTime = Maybe Text
a} :: ExternalModel)

-- | The Amazon SageMaker model endpoints.
externalModel_modelEndpoint :: Lens.Lens' ExternalModel (Prelude.Maybe Prelude.Text)
externalModel_modelEndpoint :: Lens' ExternalModel (Maybe Text)
externalModel_modelEndpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalModel' {Maybe Text
modelEndpoint :: Maybe Text
$sel:modelEndpoint:ExternalModel' :: ExternalModel -> Maybe Text
modelEndpoint} -> Maybe Text
modelEndpoint) (\s :: ExternalModel
s@ExternalModel' {} Maybe Text
a -> ExternalModel
s {$sel:modelEndpoint:ExternalModel' :: Maybe Text
modelEndpoint = Maybe Text
a} :: ExternalModel)

-- | The Amazon Fraud Detector status for the external model endpoint
externalModel_modelEndpointStatus :: Lens.Lens' ExternalModel (Prelude.Maybe ModelEndpointStatus)
externalModel_modelEndpointStatus :: Lens' ExternalModel (Maybe ModelEndpointStatus)
externalModel_modelEndpointStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalModel' {Maybe ModelEndpointStatus
modelEndpointStatus :: Maybe ModelEndpointStatus
$sel:modelEndpointStatus:ExternalModel' :: ExternalModel -> Maybe ModelEndpointStatus
modelEndpointStatus} -> Maybe ModelEndpointStatus
modelEndpointStatus) (\s :: ExternalModel
s@ExternalModel' {} Maybe ModelEndpointStatus
a -> ExternalModel
s {$sel:modelEndpointStatus:ExternalModel' :: Maybe ModelEndpointStatus
modelEndpointStatus = Maybe ModelEndpointStatus
a} :: ExternalModel)

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

-- | The output configuration.
externalModel_outputConfiguration :: Lens.Lens' ExternalModel (Prelude.Maybe ModelOutputConfiguration)
externalModel_outputConfiguration :: Lens' ExternalModel (Maybe ModelOutputConfiguration)
externalModel_outputConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalModel' {Maybe ModelOutputConfiguration
outputConfiguration :: Maybe ModelOutputConfiguration
$sel:outputConfiguration:ExternalModel' :: ExternalModel -> Maybe ModelOutputConfiguration
outputConfiguration} -> Maybe ModelOutputConfiguration
outputConfiguration) (\s :: ExternalModel
s@ExternalModel' {} Maybe ModelOutputConfiguration
a -> ExternalModel
s {$sel:outputConfiguration:ExternalModel' :: Maybe ModelOutputConfiguration
outputConfiguration = Maybe ModelOutputConfiguration
a} :: ExternalModel)

instance Data.FromJSON ExternalModel where
  parseJSON :: Value -> Parser ExternalModel
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ExternalModel"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe ModelInputConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ModelEndpointStatus
-> Maybe ModelSource
-> Maybe ModelOutputConfiguration
-> ExternalModel
ExternalModel'
            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
"inputConfiguration")
            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
"invokeModelEndpointRoleArn")
            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
"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
"modelEndpointStatus")
            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")
            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
"outputConfiguration")
      )

instance Prelude.Hashable ExternalModel where
  hashWithSalt :: Int -> ExternalModel -> Int
hashWithSalt Int
_salt ExternalModel' {Maybe Text
Maybe ModelEndpointStatus
Maybe ModelInputConfiguration
Maybe ModelOutputConfiguration
Maybe ModelSource
outputConfiguration :: Maybe ModelOutputConfiguration
modelSource :: Maybe ModelSource
modelEndpointStatus :: Maybe ModelEndpointStatus
modelEndpoint :: Maybe Text
lastUpdatedTime :: Maybe Text
invokeModelEndpointRoleArn :: Maybe Text
inputConfiguration :: Maybe ModelInputConfiguration
createdTime :: Maybe Text
arn :: Maybe Text
$sel:outputConfiguration:ExternalModel' :: ExternalModel -> Maybe ModelOutputConfiguration
$sel:modelSource:ExternalModel' :: ExternalModel -> Maybe ModelSource
$sel:modelEndpointStatus:ExternalModel' :: ExternalModel -> Maybe ModelEndpointStatus
$sel:modelEndpoint:ExternalModel' :: ExternalModel -> Maybe Text
$sel:lastUpdatedTime:ExternalModel' :: ExternalModel -> Maybe Text
$sel:invokeModelEndpointRoleArn:ExternalModel' :: ExternalModel -> Maybe Text
$sel:inputConfiguration:ExternalModel' :: ExternalModel -> Maybe ModelInputConfiguration
$sel:createdTime:ExternalModel' :: ExternalModel -> Maybe Text
$sel:arn:ExternalModel' :: ExternalModel -> 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 ModelInputConfiguration
inputConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
invokeModelEndpointRoleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastUpdatedTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
modelEndpoint
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ModelEndpointStatus
modelEndpointStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ModelSource
modelSource
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ModelOutputConfiguration
outputConfiguration

instance Prelude.NFData ExternalModel where
  rnf :: ExternalModel -> ()
rnf ExternalModel' {Maybe Text
Maybe ModelEndpointStatus
Maybe ModelInputConfiguration
Maybe ModelOutputConfiguration
Maybe ModelSource
outputConfiguration :: Maybe ModelOutputConfiguration
modelSource :: Maybe ModelSource
modelEndpointStatus :: Maybe ModelEndpointStatus
modelEndpoint :: Maybe Text
lastUpdatedTime :: Maybe Text
invokeModelEndpointRoleArn :: Maybe Text
inputConfiguration :: Maybe ModelInputConfiguration
createdTime :: Maybe Text
arn :: Maybe Text
$sel:outputConfiguration:ExternalModel' :: ExternalModel -> Maybe ModelOutputConfiguration
$sel:modelSource:ExternalModel' :: ExternalModel -> Maybe ModelSource
$sel:modelEndpointStatus:ExternalModel' :: ExternalModel -> Maybe ModelEndpointStatus
$sel:modelEndpoint:ExternalModel' :: ExternalModel -> Maybe Text
$sel:lastUpdatedTime:ExternalModel' :: ExternalModel -> Maybe Text
$sel:invokeModelEndpointRoleArn:ExternalModel' :: ExternalModel -> Maybe Text
$sel:inputConfiguration:ExternalModel' :: ExternalModel -> Maybe ModelInputConfiguration
$sel:createdTime:ExternalModel' :: ExternalModel -> Maybe Text
$sel:arn:ExternalModel' :: ExternalModel -> 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 ModelInputConfiguration
inputConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
invokeModelEndpointRoleArn
      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
modelEndpoint
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ModelEndpointStatus
modelEndpointStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ModelSource
modelSource
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ModelOutputConfiguration
outputConfiguration