{-# 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.LookoutVision.Types.ProjectMetadata
-- 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.LookoutVision.Types.ProjectMetadata where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Metadata about an Amazon Lookout for Vision project.
--
-- /See:/ 'newProjectMetadata' smart constructor.
data ProjectMetadata = ProjectMetadata'
  { -- | The unix timestamp for the date and time that the project was created.
    ProjectMetadata -> Maybe POSIX
creationTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The name of the project.
    ProjectMetadata -> Maybe Text
projectName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the project.
    ProjectMetadata -> Maybe Text
projectArn :: Prelude.Maybe Prelude.Text
  }
  deriving (ProjectMetadata -> ProjectMetadata -> Bool
(ProjectMetadata -> ProjectMetadata -> Bool)
-> (ProjectMetadata -> ProjectMetadata -> Bool)
-> Eq ProjectMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProjectMetadata -> ProjectMetadata -> Bool
$c/= :: ProjectMetadata -> ProjectMetadata -> Bool
== :: ProjectMetadata -> ProjectMetadata -> Bool
$c== :: ProjectMetadata -> ProjectMetadata -> Bool
Prelude.Eq, ReadPrec [ProjectMetadata]
ReadPrec ProjectMetadata
Int -> ReadS ProjectMetadata
ReadS [ProjectMetadata]
(Int -> ReadS ProjectMetadata)
-> ReadS [ProjectMetadata]
-> ReadPrec ProjectMetadata
-> ReadPrec [ProjectMetadata]
-> Read ProjectMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProjectMetadata]
$creadListPrec :: ReadPrec [ProjectMetadata]
readPrec :: ReadPrec ProjectMetadata
$creadPrec :: ReadPrec ProjectMetadata
readList :: ReadS [ProjectMetadata]
$creadList :: ReadS [ProjectMetadata]
readsPrec :: Int -> ReadS ProjectMetadata
$creadsPrec :: Int -> ReadS ProjectMetadata
Prelude.Read, Int -> ProjectMetadata -> ShowS
[ProjectMetadata] -> ShowS
ProjectMetadata -> String
(Int -> ProjectMetadata -> ShowS)
-> (ProjectMetadata -> String)
-> ([ProjectMetadata] -> ShowS)
-> Show ProjectMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProjectMetadata] -> ShowS
$cshowList :: [ProjectMetadata] -> ShowS
show :: ProjectMetadata -> String
$cshow :: ProjectMetadata -> String
showsPrec :: Int -> ProjectMetadata -> ShowS
$cshowsPrec :: Int -> ProjectMetadata -> ShowS
Prelude.Show, (forall x. ProjectMetadata -> Rep ProjectMetadata x)
-> (forall x. Rep ProjectMetadata x -> ProjectMetadata)
-> Generic ProjectMetadata
forall x. Rep ProjectMetadata x -> ProjectMetadata
forall x. ProjectMetadata -> Rep ProjectMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProjectMetadata x -> ProjectMetadata
$cfrom :: forall x. ProjectMetadata -> Rep ProjectMetadata x
Prelude.Generic)

-- |
-- Create a value of 'ProjectMetadata' 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', 'projectMetadata_creationTimestamp' - The unix timestamp for the date and time that the project was created.
--
-- 'projectName', 'projectMetadata_projectName' - The name of the project.
--
-- 'projectArn', 'projectMetadata_projectArn' - The Amazon Resource Name (ARN) of the project.
newProjectMetadata ::
  ProjectMetadata
newProjectMetadata :: ProjectMetadata
newProjectMetadata =
  ProjectMetadata' :: Maybe POSIX -> Maybe Text -> Maybe Text -> ProjectMetadata
ProjectMetadata'
    { $sel:creationTimestamp:ProjectMetadata' :: Maybe POSIX
creationTimestamp =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:projectName:ProjectMetadata' :: Maybe Text
projectName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:projectArn:ProjectMetadata' :: Maybe Text
projectArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

instance Core.FromJSON ProjectMetadata where
  parseJSON :: Value -> Parser ProjectMetadata
parseJSON =
    String
-> (Object -> Parser ProjectMetadata)
-> Value
-> Parser ProjectMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ProjectMetadata"
      ( \Object
x ->
          Maybe POSIX -> Maybe Text -> Maybe Text -> ProjectMetadata
ProjectMetadata'
            (Maybe POSIX -> Maybe Text -> Maybe Text -> ProjectMetadata)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> ProjectMetadata)
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
"CreationTimestamp")
            Parser (Maybe Text -> Maybe Text -> ProjectMetadata)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ProjectMetadata)
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
"ProjectName")
            Parser (Maybe Text -> ProjectMetadata)
-> Parser (Maybe Text) -> Parser ProjectMetadata
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 ProjectMetadata

instance Prelude.NFData ProjectMetadata