{-# 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.SageMaker.Types.ProjectSummary
-- 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.SageMaker.Types.ProjectSummary where

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

-- | Information about a project.
--
-- /See:/ 'newProjectSummary' smart constructor.
data ProjectSummary = ProjectSummary'
  { -- | The description of the project.
    ProjectSummary -> Maybe Text
projectDescription :: Prelude.Maybe Prelude.Text,
    -- | The name of the project.
    ProjectSummary -> Text
projectName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the project.
    ProjectSummary -> Text
projectArn :: Prelude.Text,
    -- | The ID of the project.
    ProjectSummary -> Text
projectId :: Prelude.Text,
    -- | The time that the project was created.
    ProjectSummary -> POSIX
creationTime :: Core.POSIX,
    -- | The status of the project.
    ProjectSummary -> ProjectStatus
projectStatus :: ProjectStatus
  }
  deriving (ProjectSummary -> ProjectSummary -> Bool
(ProjectSummary -> ProjectSummary -> Bool)
-> (ProjectSummary -> ProjectSummary -> Bool) -> Eq ProjectSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProjectSummary -> ProjectSummary -> Bool
$c/= :: ProjectSummary -> ProjectSummary -> Bool
== :: ProjectSummary -> ProjectSummary -> Bool
$c== :: ProjectSummary -> ProjectSummary -> Bool
Prelude.Eq, ReadPrec [ProjectSummary]
ReadPrec ProjectSummary
Int -> ReadS ProjectSummary
ReadS [ProjectSummary]
(Int -> ReadS ProjectSummary)
-> ReadS [ProjectSummary]
-> ReadPrec ProjectSummary
-> ReadPrec [ProjectSummary]
-> Read ProjectSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProjectSummary]
$creadListPrec :: ReadPrec [ProjectSummary]
readPrec :: ReadPrec ProjectSummary
$creadPrec :: ReadPrec ProjectSummary
readList :: ReadS [ProjectSummary]
$creadList :: ReadS [ProjectSummary]
readsPrec :: Int -> ReadS ProjectSummary
$creadsPrec :: Int -> ReadS ProjectSummary
Prelude.Read, Int -> ProjectSummary -> ShowS
[ProjectSummary] -> ShowS
ProjectSummary -> String
(Int -> ProjectSummary -> ShowS)
-> (ProjectSummary -> String)
-> ([ProjectSummary] -> ShowS)
-> Show ProjectSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProjectSummary] -> ShowS
$cshowList :: [ProjectSummary] -> ShowS
show :: ProjectSummary -> String
$cshow :: ProjectSummary -> String
showsPrec :: Int -> ProjectSummary -> ShowS
$cshowsPrec :: Int -> ProjectSummary -> ShowS
Prelude.Show, (forall x. ProjectSummary -> Rep ProjectSummary x)
-> (forall x. Rep ProjectSummary x -> ProjectSummary)
-> Generic ProjectSummary
forall x. Rep ProjectSummary x -> ProjectSummary
forall x. ProjectSummary -> Rep ProjectSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProjectSummary x -> ProjectSummary
$cfrom :: forall x. ProjectSummary -> Rep ProjectSummary x
Prelude.Generic)

-- |
-- Create a value of 'ProjectSummary' 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:
--
-- 'projectDescription', 'projectSummary_projectDescription' - The description of the project.
--
-- 'projectName', 'projectSummary_projectName' - The name of the project.
--
-- 'projectArn', 'projectSummary_projectArn' - The Amazon Resource Name (ARN) of the project.
--
-- 'projectId', 'projectSummary_projectId' - The ID of the project.
--
-- 'creationTime', 'projectSummary_creationTime' - The time that the project was created.
--
-- 'projectStatus', 'projectSummary_projectStatus' - The status of the project.
newProjectSummary ::
  -- | 'projectName'
  Prelude.Text ->
  -- | 'projectArn'
  Prelude.Text ->
  -- | 'projectId'
  Prelude.Text ->
  -- | 'creationTime'
  Prelude.UTCTime ->
  -- | 'projectStatus'
  ProjectStatus ->
  ProjectSummary
newProjectSummary :: Text -> Text -> Text -> UTCTime -> ProjectStatus -> ProjectSummary
newProjectSummary
  Text
pProjectName_
  Text
pProjectArn_
  Text
pProjectId_
  UTCTime
pCreationTime_
  ProjectStatus
pProjectStatus_ =
    ProjectSummary' :: Maybe Text
-> Text -> Text -> Text -> POSIX -> ProjectStatus -> ProjectSummary
ProjectSummary'
      { $sel:projectDescription:ProjectSummary' :: Maybe Text
projectDescription =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:projectName:ProjectSummary' :: Text
projectName = Text
pProjectName_,
        $sel:projectArn:ProjectSummary' :: Text
projectArn = Text
pProjectArn_,
        $sel:projectId:ProjectSummary' :: Text
projectId = Text
pProjectId_,
        $sel:creationTime:ProjectSummary' :: POSIX
creationTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTime_,
        $sel:projectStatus:ProjectSummary' :: ProjectStatus
projectStatus = ProjectStatus
pProjectStatus_
      }

-- | The description of the project.
projectSummary_projectDescription :: Lens.Lens' ProjectSummary (Prelude.Maybe Prelude.Text)
projectSummary_projectDescription :: (Maybe Text -> f (Maybe Text))
-> ProjectSummary -> f ProjectSummary
projectSummary_projectDescription = (ProjectSummary -> Maybe Text)
-> (ProjectSummary -> Maybe Text -> ProjectSummary)
-> Lens ProjectSummary ProjectSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectSummary' {Maybe Text
projectDescription :: Maybe Text
$sel:projectDescription:ProjectSummary' :: ProjectSummary -> Maybe Text
projectDescription} -> Maybe Text
projectDescription) (\s :: ProjectSummary
s@ProjectSummary' {} Maybe Text
a -> ProjectSummary
s {$sel:projectDescription:ProjectSummary' :: Maybe Text
projectDescription = Maybe Text
a} :: ProjectSummary)

-- | The name of the project.
projectSummary_projectName :: Lens.Lens' ProjectSummary Prelude.Text
projectSummary_projectName :: (Text -> f Text) -> ProjectSummary -> f ProjectSummary
projectSummary_projectName = (ProjectSummary -> Text)
-> (ProjectSummary -> Text -> ProjectSummary)
-> Lens ProjectSummary ProjectSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectSummary' {Text
projectName :: Text
$sel:projectName:ProjectSummary' :: ProjectSummary -> Text
projectName} -> Text
projectName) (\s :: ProjectSummary
s@ProjectSummary' {} Text
a -> ProjectSummary
s {$sel:projectName:ProjectSummary' :: Text
projectName = Text
a} :: ProjectSummary)

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

-- | The ID of the project.
projectSummary_projectId :: Lens.Lens' ProjectSummary Prelude.Text
projectSummary_projectId :: (Text -> f Text) -> ProjectSummary -> f ProjectSummary
projectSummary_projectId = (ProjectSummary -> Text)
-> (ProjectSummary -> Text -> ProjectSummary)
-> Lens ProjectSummary ProjectSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectSummary' {Text
projectId :: Text
$sel:projectId:ProjectSummary' :: ProjectSummary -> Text
projectId} -> Text
projectId) (\s :: ProjectSummary
s@ProjectSummary' {} Text
a -> ProjectSummary
s {$sel:projectId:ProjectSummary' :: Text
projectId = Text
a} :: ProjectSummary)

-- | The time that the project was created.
projectSummary_creationTime :: Lens.Lens' ProjectSummary Prelude.UTCTime
projectSummary_creationTime :: (UTCTime -> f UTCTime) -> ProjectSummary -> f ProjectSummary
projectSummary_creationTime = (ProjectSummary -> POSIX)
-> (ProjectSummary -> POSIX -> ProjectSummary)
-> Lens ProjectSummary ProjectSummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectSummary' {POSIX
creationTime :: POSIX
$sel:creationTime:ProjectSummary' :: ProjectSummary -> POSIX
creationTime} -> POSIX
creationTime) (\s :: ProjectSummary
s@ProjectSummary' {} POSIX
a -> ProjectSummary
s {$sel:creationTime:ProjectSummary' :: POSIX
creationTime = POSIX
a} :: ProjectSummary) ((POSIX -> f POSIX) -> ProjectSummary -> f ProjectSummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ProjectSummary
-> f ProjectSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The status of the project.
projectSummary_projectStatus :: Lens.Lens' ProjectSummary ProjectStatus
projectSummary_projectStatus :: (ProjectStatus -> f ProjectStatus)
-> ProjectSummary -> f ProjectSummary
projectSummary_projectStatus = (ProjectSummary -> ProjectStatus)
-> (ProjectSummary -> ProjectStatus -> ProjectSummary)
-> Lens ProjectSummary ProjectSummary ProjectStatus ProjectStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectSummary' {ProjectStatus
projectStatus :: ProjectStatus
$sel:projectStatus:ProjectSummary' :: ProjectSummary -> ProjectStatus
projectStatus} -> ProjectStatus
projectStatus) (\s :: ProjectSummary
s@ProjectSummary' {} ProjectStatus
a -> ProjectSummary
s {$sel:projectStatus:ProjectSummary' :: ProjectStatus
projectStatus = ProjectStatus
a} :: ProjectSummary)

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

instance Prelude.Hashable ProjectSummary

instance Prelude.NFData ProjectSummary