{-# 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.LookoutEquipment.Types.ModelSummary
-- 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.LookoutEquipment.Types.ModelSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LookoutEquipment.Types.ModelStatus
import qualified Amazonka.Prelude as Prelude

-- | Provides information about the specified ML model, including dataset and
-- model names and ARNs, as well as status.
--
-- /See:/ 'newModelSummary' smart constructor.
data ModelSummary = ModelSummary'
  { -- | The time at which the specific model was created.
    ModelSummary -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
    -- | The Amazon Resource Name (ARN) of the dataset used to create the model.
    ModelSummary -> Maybe Text
datasetArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the dataset being used for the ML model.
    ModelSummary -> Maybe Text
datasetName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the ML model.
    ModelSummary -> Maybe Text
modelArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the ML model.
    ModelSummary -> Maybe Text
modelName :: Prelude.Maybe Prelude.Text,
    -- | Indicates the status of the ML model.
    ModelSummary -> Maybe ModelStatus
status :: Prelude.Maybe ModelStatus
  }
  deriving (ModelSummary -> ModelSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModelSummary -> ModelSummary -> Bool
$c/= :: ModelSummary -> ModelSummary -> Bool
== :: ModelSummary -> ModelSummary -> Bool
$c== :: ModelSummary -> ModelSummary -> Bool
Prelude.Eq, ReadPrec [ModelSummary]
ReadPrec ModelSummary
Int -> ReadS ModelSummary
ReadS [ModelSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModelSummary]
$creadListPrec :: ReadPrec [ModelSummary]
readPrec :: ReadPrec ModelSummary
$creadPrec :: ReadPrec ModelSummary
readList :: ReadS [ModelSummary]
$creadList :: ReadS [ModelSummary]
readsPrec :: Int -> ReadS ModelSummary
$creadsPrec :: Int -> ReadS ModelSummary
Prelude.Read, Int -> ModelSummary -> ShowS
[ModelSummary] -> ShowS
ModelSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModelSummary] -> ShowS
$cshowList :: [ModelSummary] -> ShowS
show :: ModelSummary -> String
$cshow :: ModelSummary -> String
showsPrec :: Int -> ModelSummary -> ShowS
$cshowsPrec :: Int -> ModelSummary -> ShowS
Prelude.Show, forall x. Rep ModelSummary x -> ModelSummary
forall x. ModelSummary -> Rep ModelSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModelSummary x -> ModelSummary
$cfrom :: forall x. ModelSummary -> Rep ModelSummary x
Prelude.Generic)

-- |
-- Create a value of 'ModelSummary' 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:
--
-- 'createdAt', 'modelSummary_createdAt' - The time at which the specific model was created.
--
-- 'datasetArn', 'modelSummary_datasetArn' - The Amazon Resource Name (ARN) of the dataset used to create the model.
--
-- 'datasetName', 'modelSummary_datasetName' - The name of the dataset being used for the ML model.
--
-- 'modelArn', 'modelSummary_modelArn' - The Amazon Resource Name (ARN) of the ML model.
--
-- 'modelName', 'modelSummary_modelName' - The name of the ML model.
--
-- 'status', 'modelSummary_status' - Indicates the status of the ML model.
newModelSummary ::
  ModelSummary
newModelSummary :: ModelSummary
newModelSummary =
  ModelSummary'
    { $sel:createdAt:ModelSummary' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
      $sel:datasetArn:ModelSummary' :: Maybe Text
datasetArn = forall a. Maybe a
Prelude.Nothing,
      $sel:datasetName:ModelSummary' :: Maybe Text
datasetName = forall a. Maybe a
Prelude.Nothing,
      $sel:modelArn:ModelSummary' :: Maybe Text
modelArn = forall a. Maybe a
Prelude.Nothing,
      $sel:modelName:ModelSummary' :: Maybe Text
modelName = forall a. Maybe a
Prelude.Nothing,
      $sel:status:ModelSummary' :: Maybe ModelStatus
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The time at which the specific model was created.
modelSummary_createdAt :: Lens.Lens' ModelSummary (Prelude.Maybe Prelude.UTCTime)
modelSummary_createdAt :: Lens' ModelSummary (Maybe UTCTime)
modelSummary_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelSummary' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:ModelSummary' :: ModelSummary -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: ModelSummary
s@ModelSummary' {} Maybe POSIX
a -> ModelSummary
s {$sel:createdAt:ModelSummary' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: ModelSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The Amazon Resource Name (ARN) of the dataset used to create the model.
modelSummary_datasetArn :: Lens.Lens' ModelSummary (Prelude.Maybe Prelude.Text)
modelSummary_datasetArn :: Lens' ModelSummary (Maybe Text)
modelSummary_datasetArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelSummary' {Maybe Text
datasetArn :: Maybe Text
$sel:datasetArn:ModelSummary' :: ModelSummary -> Maybe Text
datasetArn} -> Maybe Text
datasetArn) (\s :: ModelSummary
s@ModelSummary' {} Maybe Text
a -> ModelSummary
s {$sel:datasetArn:ModelSummary' :: Maybe Text
datasetArn = Maybe Text
a} :: ModelSummary)

-- | The name of the dataset being used for the ML model.
modelSummary_datasetName :: Lens.Lens' ModelSummary (Prelude.Maybe Prelude.Text)
modelSummary_datasetName :: Lens' ModelSummary (Maybe Text)
modelSummary_datasetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelSummary' {Maybe Text
datasetName :: Maybe Text
$sel:datasetName:ModelSummary' :: ModelSummary -> Maybe Text
datasetName} -> Maybe Text
datasetName) (\s :: ModelSummary
s@ModelSummary' {} Maybe Text
a -> ModelSummary
s {$sel:datasetName:ModelSummary' :: Maybe Text
datasetName = Maybe Text
a} :: ModelSummary)

-- | The Amazon Resource Name (ARN) of the ML model.
modelSummary_modelArn :: Lens.Lens' ModelSummary (Prelude.Maybe Prelude.Text)
modelSummary_modelArn :: Lens' ModelSummary (Maybe Text)
modelSummary_modelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelSummary' {Maybe Text
modelArn :: Maybe Text
$sel:modelArn:ModelSummary' :: ModelSummary -> Maybe Text
modelArn} -> Maybe Text
modelArn) (\s :: ModelSummary
s@ModelSummary' {} Maybe Text
a -> ModelSummary
s {$sel:modelArn:ModelSummary' :: Maybe Text
modelArn = Maybe Text
a} :: ModelSummary)

-- | The name of the ML model.
modelSummary_modelName :: Lens.Lens' ModelSummary (Prelude.Maybe Prelude.Text)
modelSummary_modelName :: Lens' ModelSummary (Maybe Text)
modelSummary_modelName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelSummary' {Maybe Text
modelName :: Maybe Text
$sel:modelName:ModelSummary' :: ModelSummary -> Maybe Text
modelName} -> Maybe Text
modelName) (\s :: ModelSummary
s@ModelSummary' {} Maybe Text
a -> ModelSummary
s {$sel:modelName:ModelSummary' :: Maybe Text
modelName = Maybe Text
a} :: ModelSummary)

-- | Indicates the status of the ML model.
modelSummary_status :: Lens.Lens' ModelSummary (Prelude.Maybe ModelStatus)
modelSummary_status :: Lens' ModelSummary (Maybe ModelStatus)
modelSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelSummary' {Maybe ModelStatus
status :: Maybe ModelStatus
$sel:status:ModelSummary' :: ModelSummary -> Maybe ModelStatus
status} -> Maybe ModelStatus
status) (\s :: ModelSummary
s@ModelSummary' {} Maybe ModelStatus
a -> ModelSummary
s {$sel:status:ModelSummary' :: Maybe ModelStatus
status = Maybe ModelStatus
a} :: ModelSummary)

instance Data.FromJSON ModelSummary where
  parseJSON :: Value -> Parser ModelSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ModelSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ModelStatus
-> ModelSummary
ModelSummary'
            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
"CreatedAt")
            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
"DatasetArn")
            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
"DatasetName")
            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
"ModelArn")
            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
"ModelName")
            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
"Status")
      )

instance Prelude.Hashable ModelSummary where
  hashWithSalt :: Int -> ModelSummary -> Int
hashWithSalt Int
_salt ModelSummary' {Maybe Text
Maybe POSIX
Maybe ModelStatus
status :: Maybe ModelStatus
modelName :: Maybe Text
modelArn :: Maybe Text
datasetName :: Maybe Text
datasetArn :: Maybe Text
createdAt :: Maybe POSIX
$sel:status:ModelSummary' :: ModelSummary -> Maybe ModelStatus
$sel:modelName:ModelSummary' :: ModelSummary -> Maybe Text
$sel:modelArn:ModelSummary' :: ModelSummary -> Maybe Text
$sel:datasetName:ModelSummary' :: ModelSummary -> Maybe Text
$sel:datasetArn:ModelSummary' :: ModelSummary -> Maybe Text
$sel:createdAt:ModelSummary' :: ModelSummary -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
datasetArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
datasetName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
modelArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
modelName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ModelStatus
status

instance Prelude.NFData ModelSummary where
  rnf :: ModelSummary -> ()
rnf ModelSummary' {Maybe Text
Maybe POSIX
Maybe ModelStatus
status :: Maybe ModelStatus
modelName :: Maybe Text
modelArn :: Maybe Text
datasetName :: Maybe Text
datasetArn :: Maybe Text
createdAt :: Maybe POSIX
$sel:status:ModelSummary' :: ModelSummary -> Maybe ModelStatus
$sel:modelName:ModelSummary' :: ModelSummary -> Maybe Text
$sel:modelArn:ModelSummary' :: ModelSummary -> Maybe Text
$sel:datasetName:ModelSummary' :: ModelSummary -> Maybe Text
$sel:datasetArn:ModelSummary' :: ModelSummary -> Maybe Text
$sel:createdAt:ModelSummary' :: ModelSummary -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
datasetArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
datasetName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
modelArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
modelName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ModelStatus
status