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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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'
  { -- | Indicates the status of the ML model.
    ModelSummary -> Maybe ModelStatus
status :: Prelude.Maybe ModelStatus,
    -- | The Amazon Resource Name (ARN) of the dataset used to create the model.
    ModelSummary -> Maybe Text
datasetArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the ML model.
    ModelSummary -> Maybe Text
modelArn :: Prelude.Maybe Prelude.Text,
    -- | The time at which the specific model was created.
    ModelSummary -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The name of the ML model.
    ModelSummary -> Maybe Text
modelName :: Prelude.Maybe Prelude.Text,
    -- | The name of the dataset being used for the ML model.
    ModelSummary -> Maybe Text
datasetName :: Prelude.Maybe Prelude.Text
  }
  deriving (ModelSummary -> ModelSummary -> Bool
(ModelSummary -> ModelSummary -> Bool)
-> (ModelSummary -> ModelSummary -> Bool) -> Eq ModelSummary
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]
(Int -> ReadS ModelSummary)
-> ReadS [ModelSummary]
-> ReadPrec ModelSummary
-> ReadPrec [ModelSummary]
-> Read 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
(Int -> ModelSummary -> ShowS)
-> (ModelSummary -> String)
-> ([ModelSummary] -> ShowS)
-> Show ModelSummary
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. ModelSummary -> Rep ModelSummary x)
-> (forall x. Rep ModelSummary x -> ModelSummary)
-> Generic ModelSummary
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:
--
-- 'status', 'modelSummary_status' - Indicates the status of the ML model.
--
-- 'datasetArn', 'modelSummary_datasetArn' - The Amazon Resource Name (ARN) of the dataset used to create the model.
--
-- 'modelArn', 'modelSummary_modelArn' - The Amazon Resource Name (ARN) of the ML model.
--
-- 'createdAt', 'modelSummary_createdAt' - The time at which the specific model was created.
--
-- 'modelName', 'modelSummary_modelName' - The name of the ML model.
--
-- 'datasetName', 'modelSummary_datasetName' - The name of the dataset being used for the ML model.
newModelSummary ::
  ModelSummary
newModelSummary :: ModelSummary
newModelSummary =
  ModelSummary' :: Maybe ModelStatus
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> ModelSummary
ModelSummary'
    { $sel:status:ModelSummary' :: Maybe ModelStatus
status = Maybe ModelStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetArn:ModelSummary' :: Maybe Text
datasetArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:modelArn:ModelSummary' :: Maybe Text
modelArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:ModelSummary' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:modelName:ModelSummary' :: Maybe Text
modelName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetName:ModelSummary' :: Maybe Text
datasetName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates the status of the ML model.
modelSummary_status :: Lens.Lens' ModelSummary (Prelude.Maybe ModelStatus)
modelSummary_status :: (Maybe ModelStatus -> f (Maybe ModelStatus))
-> ModelSummary -> f ModelSummary
modelSummary_status = (ModelSummary -> Maybe ModelStatus)
-> (ModelSummary -> Maybe ModelStatus -> ModelSummary)
-> Lens
     ModelSummary ModelSummary (Maybe ModelStatus) (Maybe ModelStatus)
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)

-- | The Amazon Resource Name (ARN) of the dataset used to create the model.
modelSummary_datasetArn :: Lens.Lens' ModelSummary (Prelude.Maybe Prelude.Text)
modelSummary_datasetArn :: (Maybe Text -> f (Maybe Text)) -> ModelSummary -> f ModelSummary
modelSummary_datasetArn = (ModelSummary -> Maybe Text)
-> (ModelSummary -> Maybe Text -> ModelSummary)
-> Lens ModelSummary ModelSummary (Maybe Text) (Maybe Text)
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 Amazon Resource Name (ARN) of the ML model.
modelSummary_modelArn :: Lens.Lens' ModelSummary (Prelude.Maybe Prelude.Text)
modelSummary_modelArn :: (Maybe Text -> f (Maybe Text)) -> ModelSummary -> f ModelSummary
modelSummary_modelArn = (ModelSummary -> Maybe Text)
-> (ModelSummary -> Maybe Text -> ModelSummary)
-> Lens ModelSummary ModelSummary (Maybe Text) (Maybe Text)
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 time at which the specific model was created.
modelSummary_createdAt :: Lens.Lens' ModelSummary (Prelude.Maybe Prelude.UTCTime)
modelSummary_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ModelSummary -> f ModelSummary
modelSummary_createdAt = (ModelSummary -> Maybe POSIX)
-> (ModelSummary -> Maybe POSIX -> ModelSummary)
-> Lens ModelSummary ModelSummary (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> ModelSummary -> f ModelSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ModelSummary
-> f ModelSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the ML model.
modelSummary_modelName :: Lens.Lens' ModelSummary (Prelude.Maybe Prelude.Text)
modelSummary_modelName :: (Maybe Text -> f (Maybe Text)) -> ModelSummary -> f ModelSummary
modelSummary_modelName = (ModelSummary -> Maybe Text)
-> (ModelSummary -> Maybe Text -> ModelSummary)
-> Lens ModelSummary ModelSummary (Maybe Text) (Maybe Text)
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)

-- | The name of the dataset being used for the ML model.
modelSummary_datasetName :: Lens.Lens' ModelSummary (Prelude.Maybe Prelude.Text)
modelSummary_datasetName :: (Maybe Text -> f (Maybe Text)) -> ModelSummary -> f ModelSummary
modelSummary_datasetName = (ModelSummary -> Maybe Text)
-> (ModelSummary -> Maybe Text -> ModelSummary)
-> Lens ModelSummary ModelSummary (Maybe Text) (Maybe Text)
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)

instance Core.FromJSON ModelSummary where
  parseJSON :: Value -> Parser ModelSummary
parseJSON =
    String
-> (Object -> Parser ModelSummary) -> Value -> Parser ModelSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ModelSummary"
      ( \Object
x ->
          Maybe ModelStatus
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> ModelSummary
ModelSummary'
            (Maybe ModelStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> ModelSummary)
-> Parser (Maybe ModelStatus)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> ModelSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ModelStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> ModelSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX -> Maybe Text -> Maybe Text -> ModelSummary)
forall (f :: * -> *) a b. Applicative f => 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
"DatasetArn")
            Parser
  (Maybe Text
   -> Maybe POSIX -> Maybe Text -> Maybe Text -> ModelSummary)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> ModelSummary)
forall (f :: * -> *) a b. Applicative f => 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
"ModelArn")
            Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> ModelSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> ModelSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedAt")
            Parser (Maybe Text -> Maybe Text -> ModelSummary)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ModelSummary)
forall (f :: * -> *) a b. Applicative f => 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
"ModelName")
            Parser (Maybe Text -> ModelSummary)
-> Parser (Maybe Text) -> Parser ModelSummary
forall (f :: * -> *) a b. Applicative f => 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
"DatasetName")
      )

instance Prelude.Hashable ModelSummary

instance Prelude.NFData ModelSummary