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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.ProjectStatus

-- | A description of a Amazon Rekognition Custom Labels project.
--
-- /See:/ 'newProjectDescription' smart constructor.
data ProjectDescription = ProjectDescription'
  { -- | The current status of the project.
    ProjectDescription -> Maybe ProjectStatus
status :: Prelude.Maybe ProjectStatus,
    -- | The Unix timestamp for the date and time that the project was created.
    ProjectDescription -> Maybe POSIX
creationTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the project.
    ProjectDescription -> Maybe Text
projectArn :: Prelude.Maybe Prelude.Text
  }
  deriving (ProjectDescription -> ProjectDescription -> Bool
(ProjectDescription -> ProjectDescription -> Bool)
-> (ProjectDescription -> ProjectDescription -> Bool)
-> Eq ProjectDescription
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]
(Int -> ReadS ProjectDescription)
-> ReadS [ProjectDescription]
-> ReadPrec ProjectDescription
-> ReadPrec [ProjectDescription]
-> Read 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
(Int -> ProjectDescription -> ShowS)
-> (ProjectDescription -> String)
-> ([ProjectDescription] -> ShowS)
-> Show ProjectDescription
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. ProjectDescription -> Rep ProjectDescription x)
-> (forall x. Rep ProjectDescription x -> ProjectDescription)
-> Generic ProjectDescription
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:
--
-- 'status', 'projectDescription_status' - The current status of the project.
--
-- 'creationTimestamp', 'projectDescription_creationTimestamp' - The Unix timestamp for the date and time that the project was created.
--
-- 'projectArn', 'projectDescription_projectArn' - The Amazon Resource Name (ARN) of the project.
newProjectDescription ::
  ProjectDescription
newProjectDescription :: ProjectDescription
newProjectDescription =
  ProjectDescription' :: Maybe ProjectStatus
-> Maybe POSIX -> Maybe Text -> ProjectDescription
ProjectDescription'
    { $sel:status:ProjectDescription' :: Maybe ProjectStatus
status = Maybe ProjectStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimestamp:ProjectDescription' :: Maybe POSIX
creationTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:projectArn:ProjectDescription' :: Maybe Text
projectArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The current status of the project.
projectDescription_status :: Lens.Lens' ProjectDescription (Prelude.Maybe ProjectStatus)
projectDescription_status :: (Maybe ProjectStatus -> f (Maybe ProjectStatus))
-> ProjectDescription -> f ProjectDescription
projectDescription_status = (ProjectDescription -> Maybe ProjectStatus)
-> (ProjectDescription
    -> Maybe ProjectStatus -> ProjectDescription)
-> Lens
     ProjectDescription
     ProjectDescription
     (Maybe ProjectStatus)
     (Maybe ProjectStatus)
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)

-- | The Unix timestamp for the date and time that the project was created.
projectDescription_creationTimestamp :: Lens.Lens' ProjectDescription (Prelude.Maybe Prelude.UTCTime)
projectDescription_creationTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ProjectDescription -> f ProjectDescription
projectDescription_creationTimestamp = (ProjectDescription -> Maybe POSIX)
-> (ProjectDescription -> Maybe POSIX -> ProjectDescription)
-> Lens
     ProjectDescription ProjectDescription (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> ProjectDescription -> f ProjectDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ProjectDescription
-> f ProjectDescription
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 Amazon Resource Name (ARN) of the project.
projectDescription_projectArn :: Lens.Lens' ProjectDescription (Prelude.Maybe Prelude.Text)
projectDescription_projectArn :: (Maybe Text -> f (Maybe Text))
-> ProjectDescription -> f ProjectDescription
projectDescription_projectArn = (ProjectDescription -> Maybe Text)
-> (ProjectDescription -> Maybe Text -> ProjectDescription)
-> Lens
     ProjectDescription ProjectDescription (Maybe Text) (Maybe Text)
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)

instance Core.FromJSON ProjectDescription where
  parseJSON :: Value -> Parser ProjectDescription
parseJSON =
    String
-> (Object -> Parser ProjectDescription)
-> Value
-> Parser ProjectDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ProjectDescription"
      ( \Object
x ->
          Maybe ProjectStatus
-> Maybe POSIX -> Maybe Text -> ProjectDescription
ProjectDescription'
            (Maybe ProjectStatus
 -> Maybe POSIX -> Maybe Text -> ProjectDescription)
-> Parser (Maybe ProjectStatus)
-> Parser (Maybe POSIX -> Maybe Text -> ProjectDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ProjectStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser (Maybe POSIX -> Maybe Text -> ProjectDescription)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> ProjectDescription)
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
"CreationTimestamp")
            Parser (Maybe Text -> ProjectDescription)
-> Parser (Maybe Text) -> Parser ProjectDescription
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
"ProjectArn")
      )

instance Prelude.Hashable ProjectDescription

instance Prelude.NFData ProjectDescription