{-# 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.Comprehend.Types.DocumentClassifierSummary
-- 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.Comprehend.Types.DocumentClassifierSummary where

import Amazonka.Comprehend.Types.ModelStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes information about a document classifier and its versions.
--
-- /See:/ 'newDocumentClassifierSummary' smart constructor.
data DocumentClassifierSummary = DocumentClassifierSummary'
  { -- | The time that the latest document classifier version was submitted for
    -- processing.
    DocumentClassifierSummary -> Maybe POSIX
latestVersionCreatedAt :: Prelude.Maybe Core.POSIX,
    -- | The name that you assigned the document classifier.
    DocumentClassifierSummary -> Maybe Text
documentClassifierName :: Prelude.Maybe Prelude.Text,
    -- | Provides the status of the latest document classifier version.
    DocumentClassifierSummary -> Maybe ModelStatus
latestVersionStatus :: Prelude.Maybe ModelStatus,
    -- | The number of versions you created.
    DocumentClassifierSummary -> Maybe Int
numberOfVersions :: Prelude.Maybe Prelude.Int,
    -- | The version name you assigned to the latest document classifier version.
    DocumentClassifierSummary -> Maybe Text
latestVersionName :: Prelude.Maybe Prelude.Text
  }
  deriving (DocumentClassifierSummary -> DocumentClassifierSummary -> Bool
(DocumentClassifierSummary -> DocumentClassifierSummary -> Bool)
-> (DocumentClassifierSummary -> DocumentClassifierSummary -> Bool)
-> Eq DocumentClassifierSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentClassifierSummary -> DocumentClassifierSummary -> Bool
$c/= :: DocumentClassifierSummary -> DocumentClassifierSummary -> Bool
== :: DocumentClassifierSummary -> DocumentClassifierSummary -> Bool
$c== :: DocumentClassifierSummary -> DocumentClassifierSummary -> Bool
Prelude.Eq, ReadPrec [DocumentClassifierSummary]
ReadPrec DocumentClassifierSummary
Int -> ReadS DocumentClassifierSummary
ReadS [DocumentClassifierSummary]
(Int -> ReadS DocumentClassifierSummary)
-> ReadS [DocumentClassifierSummary]
-> ReadPrec DocumentClassifierSummary
-> ReadPrec [DocumentClassifierSummary]
-> Read DocumentClassifierSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DocumentClassifierSummary]
$creadListPrec :: ReadPrec [DocumentClassifierSummary]
readPrec :: ReadPrec DocumentClassifierSummary
$creadPrec :: ReadPrec DocumentClassifierSummary
readList :: ReadS [DocumentClassifierSummary]
$creadList :: ReadS [DocumentClassifierSummary]
readsPrec :: Int -> ReadS DocumentClassifierSummary
$creadsPrec :: Int -> ReadS DocumentClassifierSummary
Prelude.Read, Int -> DocumentClassifierSummary -> ShowS
[DocumentClassifierSummary] -> ShowS
DocumentClassifierSummary -> String
(Int -> DocumentClassifierSummary -> ShowS)
-> (DocumentClassifierSummary -> String)
-> ([DocumentClassifierSummary] -> ShowS)
-> Show DocumentClassifierSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentClassifierSummary] -> ShowS
$cshowList :: [DocumentClassifierSummary] -> ShowS
show :: DocumentClassifierSummary -> String
$cshow :: DocumentClassifierSummary -> String
showsPrec :: Int -> DocumentClassifierSummary -> ShowS
$cshowsPrec :: Int -> DocumentClassifierSummary -> ShowS
Prelude.Show, (forall x.
 DocumentClassifierSummary -> Rep DocumentClassifierSummary x)
-> (forall x.
    Rep DocumentClassifierSummary x -> DocumentClassifierSummary)
-> Generic DocumentClassifierSummary
forall x.
Rep DocumentClassifierSummary x -> DocumentClassifierSummary
forall x.
DocumentClassifierSummary -> Rep DocumentClassifierSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DocumentClassifierSummary x -> DocumentClassifierSummary
$cfrom :: forall x.
DocumentClassifierSummary -> Rep DocumentClassifierSummary x
Prelude.Generic)

-- |
-- Create a value of 'DocumentClassifierSummary' 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:
--
-- 'latestVersionCreatedAt', 'documentClassifierSummary_latestVersionCreatedAt' - The time that the latest document classifier version was submitted for
-- processing.
--
-- 'documentClassifierName', 'documentClassifierSummary_documentClassifierName' - The name that you assigned the document classifier.
--
-- 'latestVersionStatus', 'documentClassifierSummary_latestVersionStatus' - Provides the status of the latest document classifier version.
--
-- 'numberOfVersions', 'documentClassifierSummary_numberOfVersions' - The number of versions you created.
--
-- 'latestVersionName', 'documentClassifierSummary_latestVersionName' - The version name you assigned to the latest document classifier version.
newDocumentClassifierSummary ::
  DocumentClassifierSummary
newDocumentClassifierSummary :: DocumentClassifierSummary
newDocumentClassifierSummary =
  DocumentClassifierSummary' :: Maybe POSIX
-> Maybe Text
-> Maybe ModelStatus
-> Maybe Int
-> Maybe Text
-> DocumentClassifierSummary
DocumentClassifierSummary'
    { $sel:latestVersionCreatedAt:DocumentClassifierSummary' :: Maybe POSIX
latestVersionCreatedAt =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:documentClassifierName:DocumentClassifierSummary' :: Maybe Text
documentClassifierName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:latestVersionStatus:DocumentClassifierSummary' :: Maybe ModelStatus
latestVersionStatus = Maybe ModelStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:numberOfVersions:DocumentClassifierSummary' :: Maybe Int
numberOfVersions = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:latestVersionName:DocumentClassifierSummary' :: Maybe Text
latestVersionName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The time that the latest document classifier version was submitted for
-- processing.
documentClassifierSummary_latestVersionCreatedAt :: Lens.Lens' DocumentClassifierSummary (Prelude.Maybe Prelude.UTCTime)
documentClassifierSummary_latestVersionCreatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DocumentClassifierSummary -> f DocumentClassifierSummary
documentClassifierSummary_latestVersionCreatedAt = (DocumentClassifierSummary -> Maybe POSIX)
-> (DocumentClassifierSummary
    -> Maybe POSIX -> DocumentClassifierSummary)
-> Lens
     DocumentClassifierSummary
     DocumentClassifierSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentClassifierSummary' {Maybe POSIX
latestVersionCreatedAt :: Maybe POSIX
$sel:latestVersionCreatedAt:DocumentClassifierSummary' :: DocumentClassifierSummary -> Maybe POSIX
latestVersionCreatedAt} -> Maybe POSIX
latestVersionCreatedAt) (\s :: DocumentClassifierSummary
s@DocumentClassifierSummary' {} Maybe POSIX
a -> DocumentClassifierSummary
s {$sel:latestVersionCreatedAt:DocumentClassifierSummary' :: Maybe POSIX
latestVersionCreatedAt = Maybe POSIX
a} :: DocumentClassifierSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> DocumentClassifierSummary -> f DocumentClassifierSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DocumentClassifierSummary
-> f DocumentClassifierSummary
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 that you assigned the document classifier.
documentClassifierSummary_documentClassifierName :: Lens.Lens' DocumentClassifierSummary (Prelude.Maybe Prelude.Text)
documentClassifierSummary_documentClassifierName :: (Maybe Text -> f (Maybe Text))
-> DocumentClassifierSummary -> f DocumentClassifierSummary
documentClassifierSummary_documentClassifierName = (DocumentClassifierSummary -> Maybe Text)
-> (DocumentClassifierSummary
    -> Maybe Text -> DocumentClassifierSummary)
-> Lens
     DocumentClassifierSummary
     DocumentClassifierSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentClassifierSummary' {Maybe Text
documentClassifierName :: Maybe Text
$sel:documentClassifierName:DocumentClassifierSummary' :: DocumentClassifierSummary -> Maybe Text
documentClassifierName} -> Maybe Text
documentClassifierName) (\s :: DocumentClassifierSummary
s@DocumentClassifierSummary' {} Maybe Text
a -> DocumentClassifierSummary
s {$sel:documentClassifierName:DocumentClassifierSummary' :: Maybe Text
documentClassifierName = Maybe Text
a} :: DocumentClassifierSummary)

-- | Provides the status of the latest document classifier version.
documentClassifierSummary_latestVersionStatus :: Lens.Lens' DocumentClassifierSummary (Prelude.Maybe ModelStatus)
documentClassifierSummary_latestVersionStatus :: (Maybe ModelStatus -> f (Maybe ModelStatus))
-> DocumentClassifierSummary -> f DocumentClassifierSummary
documentClassifierSummary_latestVersionStatus = (DocumentClassifierSummary -> Maybe ModelStatus)
-> (DocumentClassifierSummary
    -> Maybe ModelStatus -> DocumentClassifierSummary)
-> Lens
     DocumentClassifierSummary
     DocumentClassifierSummary
     (Maybe ModelStatus)
     (Maybe ModelStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentClassifierSummary' {Maybe ModelStatus
latestVersionStatus :: Maybe ModelStatus
$sel:latestVersionStatus:DocumentClassifierSummary' :: DocumentClassifierSummary -> Maybe ModelStatus
latestVersionStatus} -> Maybe ModelStatus
latestVersionStatus) (\s :: DocumentClassifierSummary
s@DocumentClassifierSummary' {} Maybe ModelStatus
a -> DocumentClassifierSummary
s {$sel:latestVersionStatus:DocumentClassifierSummary' :: Maybe ModelStatus
latestVersionStatus = Maybe ModelStatus
a} :: DocumentClassifierSummary)

-- | The number of versions you created.
documentClassifierSummary_numberOfVersions :: Lens.Lens' DocumentClassifierSummary (Prelude.Maybe Prelude.Int)
documentClassifierSummary_numberOfVersions :: (Maybe Int -> f (Maybe Int))
-> DocumentClassifierSummary -> f DocumentClassifierSummary
documentClassifierSummary_numberOfVersions = (DocumentClassifierSummary -> Maybe Int)
-> (DocumentClassifierSummary
    -> Maybe Int -> DocumentClassifierSummary)
-> Lens
     DocumentClassifierSummary
     DocumentClassifierSummary
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentClassifierSummary' {Maybe Int
numberOfVersions :: Maybe Int
$sel:numberOfVersions:DocumentClassifierSummary' :: DocumentClassifierSummary -> Maybe Int
numberOfVersions} -> Maybe Int
numberOfVersions) (\s :: DocumentClassifierSummary
s@DocumentClassifierSummary' {} Maybe Int
a -> DocumentClassifierSummary
s {$sel:numberOfVersions:DocumentClassifierSummary' :: Maybe Int
numberOfVersions = Maybe Int
a} :: DocumentClassifierSummary)

-- | The version name you assigned to the latest document classifier version.
documentClassifierSummary_latestVersionName :: Lens.Lens' DocumentClassifierSummary (Prelude.Maybe Prelude.Text)
documentClassifierSummary_latestVersionName :: (Maybe Text -> f (Maybe Text))
-> DocumentClassifierSummary -> f DocumentClassifierSummary
documentClassifierSummary_latestVersionName = (DocumentClassifierSummary -> Maybe Text)
-> (DocumentClassifierSummary
    -> Maybe Text -> DocumentClassifierSummary)
-> Lens
     DocumentClassifierSummary
     DocumentClassifierSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentClassifierSummary' {Maybe Text
latestVersionName :: Maybe Text
$sel:latestVersionName:DocumentClassifierSummary' :: DocumentClassifierSummary -> Maybe Text
latestVersionName} -> Maybe Text
latestVersionName) (\s :: DocumentClassifierSummary
s@DocumentClassifierSummary' {} Maybe Text
a -> DocumentClassifierSummary
s {$sel:latestVersionName:DocumentClassifierSummary' :: Maybe Text
latestVersionName = Maybe Text
a} :: DocumentClassifierSummary)

instance Core.FromJSON DocumentClassifierSummary where
  parseJSON :: Value -> Parser DocumentClassifierSummary
parseJSON =
    String
-> (Object -> Parser DocumentClassifierSummary)
-> Value
-> Parser DocumentClassifierSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DocumentClassifierSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe ModelStatus
-> Maybe Int
-> Maybe Text
-> DocumentClassifierSummary
DocumentClassifierSummary'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe ModelStatus
 -> Maybe Int
 -> Maybe Text
 -> DocumentClassifierSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe ModelStatus
      -> Maybe Int
      -> Maybe Text
      -> DocumentClassifierSummary)
forall (f :: * -> *) a b. Functor 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
"LatestVersionCreatedAt")
            Parser
  (Maybe Text
   -> Maybe ModelStatus
   -> Maybe Int
   -> Maybe Text
   -> DocumentClassifierSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe ModelStatus
      -> Maybe Int -> Maybe Text -> DocumentClassifierSummary)
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
"DocumentClassifierName")
            Parser
  (Maybe ModelStatus
   -> Maybe Int -> Maybe Text -> DocumentClassifierSummary)
-> Parser (Maybe ModelStatus)
-> Parser (Maybe Int -> Maybe Text -> DocumentClassifierSummary)
forall (f :: * -> *) a b. Applicative f => 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
"LatestVersionStatus")
            Parser (Maybe Int -> Maybe Text -> DocumentClassifierSummary)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> DocumentClassifierSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NumberOfVersions")
            Parser (Maybe Text -> DocumentClassifierSummary)
-> Parser (Maybe Text) -> Parser DocumentClassifierSummary
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
"LatestVersionName")
      )

instance Prelude.Hashable DocumentClassifierSummary

instance Prelude.NFData DocumentClassifierSummary