{-# 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.Rekognition.Types.ProjectDescription
-- 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.Rekognition.Types.ProjectDescription where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.DatasetMetadata
import Amazonka.Rekognition.Types.ProjectStatus

-- | A description of an Amazon Rekognition Custom Labels project. For more
-- information, see DescribeProjects.
--
-- /See:/ 'newProjectDescription' smart constructor.
data ProjectDescription = ProjectDescription'
  { -- | The Unix timestamp for the date and time that the project was created.
    ProjectDescription -> Maybe POSIX
creationTimestamp :: Prelude.Maybe Data.POSIX,
    -- | Information about the training and test datasets in the project.
    ProjectDescription -> Maybe [DatasetMetadata]
datasets :: Prelude.Maybe [DatasetMetadata],
    -- | The Amazon Resource Name (ARN) of the project.
    ProjectDescription -> Maybe Text
projectArn :: Prelude.Maybe Prelude.Text,
    -- | The current status of the project.
    ProjectDescription -> Maybe ProjectStatus
status :: Prelude.Maybe ProjectStatus
  }
  deriving (ProjectDescription -> ProjectDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProjectDescription -> ProjectDescription -> Bool
$c/= :: ProjectDescription -> ProjectDescription -> Bool
== :: ProjectDescription -> ProjectDescription -> Bool
$c== :: ProjectDescription -> ProjectDescription -> Bool
Prelude.Eq, ReadPrec [ProjectDescription]
ReadPrec ProjectDescription
Int -> ReadS ProjectDescription
ReadS [ProjectDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProjectDescription]
$creadListPrec :: ReadPrec [ProjectDescription]
readPrec :: ReadPrec ProjectDescription
$creadPrec :: ReadPrec ProjectDescription
readList :: ReadS [ProjectDescription]
$creadList :: ReadS [ProjectDescription]
readsPrec :: Int -> ReadS ProjectDescription
$creadsPrec :: Int -> ReadS ProjectDescription
Prelude.Read, Int -> ProjectDescription -> ShowS
[ProjectDescription] -> ShowS
ProjectDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProjectDescription] -> ShowS
$cshowList :: [ProjectDescription] -> ShowS
show :: ProjectDescription -> String
$cshow :: ProjectDescription -> String
showsPrec :: Int -> ProjectDescription -> ShowS
$cshowsPrec :: Int -> ProjectDescription -> ShowS
Prelude.Show, forall x. Rep ProjectDescription x -> ProjectDescription
forall x. ProjectDescription -> Rep ProjectDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProjectDescription x -> ProjectDescription
$cfrom :: forall x. ProjectDescription -> Rep ProjectDescription x
Prelude.Generic)

-- |
-- Create a value of 'ProjectDescription' 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:
--
-- 'creationTimestamp', 'projectDescription_creationTimestamp' - The Unix timestamp for the date and time that the project was created.
--
-- 'datasets', 'projectDescription_datasets' - Information about the training and test datasets in the project.
--
-- 'projectArn', 'projectDescription_projectArn' - The Amazon Resource Name (ARN) of the project.
--
-- 'status', 'projectDescription_status' - The current status of the project.
newProjectDescription ::
  ProjectDescription
newProjectDescription :: ProjectDescription
newProjectDescription =
  ProjectDescription'
    { $sel:creationTimestamp:ProjectDescription' :: Maybe POSIX
creationTimestamp =
        forall a. Maybe a
Prelude.Nothing,
      $sel:datasets:ProjectDescription' :: Maybe [DatasetMetadata]
datasets = forall a. Maybe a
Prelude.Nothing,
      $sel:projectArn:ProjectDescription' :: Maybe Text
projectArn = forall a. Maybe a
Prelude.Nothing,
      $sel:status:ProjectDescription' :: Maybe ProjectStatus
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The Unix timestamp for the date and time that the project was created.
projectDescription_creationTimestamp :: Lens.Lens' ProjectDescription (Prelude.Maybe Prelude.UTCTime)
projectDescription_creationTimestamp :: Lens' ProjectDescription (Maybe UTCTime)
projectDescription_creationTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDescription' {Maybe POSIX
creationTimestamp :: Maybe POSIX
$sel:creationTimestamp:ProjectDescription' :: ProjectDescription -> Maybe POSIX
creationTimestamp} -> Maybe POSIX
creationTimestamp) (\s :: ProjectDescription
s@ProjectDescription' {} Maybe POSIX
a -> ProjectDescription
s {$sel:creationTimestamp:ProjectDescription' :: Maybe POSIX
creationTimestamp = Maybe POSIX
a} :: ProjectDescription) 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

-- | Information about the training and test datasets in the project.
projectDescription_datasets :: Lens.Lens' ProjectDescription (Prelude.Maybe [DatasetMetadata])
projectDescription_datasets :: Lens' ProjectDescription (Maybe [DatasetMetadata])
projectDescription_datasets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDescription' {Maybe [DatasetMetadata]
datasets :: Maybe [DatasetMetadata]
$sel:datasets:ProjectDescription' :: ProjectDescription -> Maybe [DatasetMetadata]
datasets} -> Maybe [DatasetMetadata]
datasets) (\s :: ProjectDescription
s@ProjectDescription' {} Maybe [DatasetMetadata]
a -> ProjectDescription
s {$sel:datasets:ProjectDescription' :: Maybe [DatasetMetadata]
datasets = Maybe [DatasetMetadata]
a} :: ProjectDescription) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the project.
projectDescription_projectArn :: Lens.Lens' ProjectDescription (Prelude.Maybe Prelude.Text)
projectDescription_projectArn :: Lens' ProjectDescription (Maybe Text)
projectDescription_projectArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDescription' {Maybe Text
projectArn :: Maybe Text
$sel:projectArn:ProjectDescription' :: ProjectDescription -> Maybe Text
projectArn} -> Maybe Text
projectArn) (\s :: ProjectDescription
s@ProjectDescription' {} Maybe Text
a -> ProjectDescription
s {$sel:projectArn:ProjectDescription' :: Maybe Text
projectArn = Maybe Text
a} :: ProjectDescription)

-- | The current status of the project.
projectDescription_status :: Lens.Lens' ProjectDescription (Prelude.Maybe ProjectStatus)
projectDescription_status :: Lens' ProjectDescription (Maybe ProjectStatus)
projectDescription_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDescription' {Maybe ProjectStatus
status :: Maybe ProjectStatus
$sel:status:ProjectDescription' :: ProjectDescription -> Maybe ProjectStatus
status} -> Maybe ProjectStatus
status) (\s :: ProjectDescription
s@ProjectDescription' {} Maybe ProjectStatus
a -> ProjectDescription
s {$sel:status:ProjectDescription' :: Maybe ProjectStatus
status = Maybe ProjectStatus
a} :: ProjectDescription)

instance Data.FromJSON ProjectDescription where
  parseJSON :: Value -> Parser ProjectDescription
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ProjectDescription"
      ( \Object
x ->
          Maybe POSIX
-> Maybe [DatasetMetadata]
-> Maybe Text
-> Maybe ProjectStatus
-> ProjectDescription
ProjectDescription'
            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
"CreationTimestamp")
            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
"Datasets" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"ProjectArn")
            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 ProjectDescription where
  hashWithSalt :: Int -> ProjectDescription -> Int
hashWithSalt Int
_salt ProjectDescription' {Maybe [DatasetMetadata]
Maybe Text
Maybe POSIX
Maybe ProjectStatus
status :: Maybe ProjectStatus
projectArn :: Maybe Text
datasets :: Maybe [DatasetMetadata]
creationTimestamp :: Maybe POSIX
$sel:status:ProjectDescription' :: ProjectDescription -> Maybe ProjectStatus
$sel:projectArn:ProjectDescription' :: ProjectDescription -> Maybe Text
$sel:datasets:ProjectDescription' :: ProjectDescription -> Maybe [DatasetMetadata]
$sel:creationTimestamp:ProjectDescription' :: ProjectDescription -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTimestamp
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [DatasetMetadata]
datasets
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
projectArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProjectStatus
status

instance Prelude.NFData ProjectDescription where
  rnf :: ProjectDescription -> ()
rnf ProjectDescription' {Maybe [DatasetMetadata]
Maybe Text
Maybe POSIX
Maybe ProjectStatus
status :: Maybe ProjectStatus
projectArn :: Maybe Text
datasets :: Maybe [DatasetMetadata]
creationTimestamp :: Maybe POSIX
$sel:status:ProjectDescription' :: ProjectDescription -> Maybe ProjectStatus
$sel:projectArn:ProjectDescription' :: ProjectDescription -> Maybe Text
$sel:datasets:ProjectDescription' :: ProjectDescription -> Maybe [DatasetMetadata]
$sel:creationTimestamp:ProjectDescription' :: ProjectDescription -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [DatasetMetadata]
datasets
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
projectArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProjectStatus
status