{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.ProjectSummary 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.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 :: Data.POSIX,
    -- | The status of the project.
    ProjectSummary -> ProjectStatus
projectStatus :: ProjectStatus
  }
  deriving (ProjectSummary -> ProjectSummary -> Bool
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]
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
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. 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'
      { $sel:projectDescription:ProjectSummary' :: Maybe Text
projectDescription =
          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 = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time 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 :: Lens' ProjectSummary (Maybe Text)
projectSummary_projectDescription = 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 :: Lens' ProjectSummary Text
projectSummary_projectName = 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 :: Lens' ProjectSummary Text
projectSummary_projectArn = 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 :: Lens' ProjectSummary Text
projectSummary_projectId = 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 :: Lens' ProjectSummary UTCTime
projectSummary_creationTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The status of the project.
projectSummary_projectStatus :: Lens.Lens' ProjectSummary ProjectStatus
projectSummary_projectStatus :: Lens' ProjectSummary ProjectStatus
projectSummary_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 Data.FromJSON ProjectSummary where
  parseJSON :: Value -> Parser ProjectSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ProjectSummary"
      ( \Object
x ->
          Maybe Text
-> Text -> Text -> Text -> POSIX -> ProjectStatus -> ProjectSummary
ProjectSummary'
            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
"ProjectDescription")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ProjectName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser 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 a
Data..: Key
"ProjectId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"CreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ProjectStatus")
      )

instance Prelude.Hashable ProjectSummary where
  hashWithSalt :: Int -> ProjectSummary -> Int
hashWithSalt Int
_salt ProjectSummary' {Maybe Text
Text
POSIX
ProjectStatus
projectStatus :: ProjectStatus
creationTime :: POSIX
projectId :: Text
projectArn :: Text
projectName :: Text
projectDescription :: Maybe Text
$sel:projectStatus:ProjectSummary' :: ProjectSummary -> ProjectStatus
$sel:creationTime:ProjectSummary' :: ProjectSummary -> POSIX
$sel:projectId:ProjectSummary' :: ProjectSummary -> Text
$sel:projectArn:ProjectSummary' :: ProjectSummary -> Text
$sel:projectName:ProjectSummary' :: ProjectSummary -> Text
$sel:projectDescription:ProjectSummary' :: ProjectSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
projectDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
projectName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
projectArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
projectId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ProjectStatus
projectStatus

instance Prelude.NFData ProjectSummary where
  rnf :: ProjectSummary -> ()
rnf ProjectSummary' {Maybe Text
Text
POSIX
ProjectStatus
projectStatus :: ProjectStatus
creationTime :: POSIX
projectId :: Text
projectArn :: Text
projectName :: Text
projectDescription :: Maybe Text
$sel:projectStatus:ProjectSummary' :: ProjectSummary -> ProjectStatus
$sel:creationTime:ProjectSummary' :: ProjectSummary -> POSIX
$sel:projectId:ProjectSummary' :: ProjectSummary -> Text
$sel:projectArn:ProjectSummary' :: ProjectSummary -> Text
$sel:projectName:ProjectSummary' :: ProjectSummary -> Text
$sel:projectDescription:ProjectSummary' :: ProjectSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
projectDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
projectName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
projectArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
projectId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ProjectStatus
projectStatus