{-# 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.IoTSiteWise.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.IoTSiteWise.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

-- | Contains project summary information.
--
-- /See:/ 'newProjectSummary' smart constructor.
data ProjectSummary = ProjectSummary'
  { -- | The date the project was created, in Unix epoch time.
    ProjectSummary -> Maybe POSIX
creationDate :: Prelude.Maybe Data.POSIX,
    -- | The project\'s description.
    ProjectSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The date the project was last updated, in Unix epoch time.
    ProjectSummary -> Maybe POSIX
lastUpdateDate :: Prelude.Maybe Data.POSIX,
    -- | The ID of the project.
    ProjectSummary -> Text
id :: Prelude.Text,
    -- | The name of the project.
    ProjectSummary -> Text
name :: Prelude.Text
  }
  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:
--
-- 'creationDate', 'projectSummary_creationDate' - The date the project was created, in Unix epoch time.
--
-- 'description', 'projectSummary_description' - The project\'s description.
--
-- 'lastUpdateDate', 'projectSummary_lastUpdateDate' - The date the project was last updated, in Unix epoch time.
--
-- 'id', 'projectSummary_id' - The ID of the project.
--
-- 'name', 'projectSummary_name' - The name of the project.
newProjectSummary ::
  -- | 'id'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  ProjectSummary
newProjectSummary :: Text -> Text -> ProjectSummary
newProjectSummary Text
pId_ Text
pName_ =
  ProjectSummary'
    { $sel:creationDate:ProjectSummary' :: Maybe POSIX
creationDate = forall a. Maybe a
Prelude.Nothing,
      $sel:description:ProjectSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdateDate:ProjectSummary' :: Maybe POSIX
lastUpdateDate = forall a. Maybe a
Prelude.Nothing,
      $sel:id:ProjectSummary' :: Text
id = Text
pId_,
      $sel:name:ProjectSummary' :: Text
name = Text
pName_
    }

-- | The date the project was created, in Unix epoch time.
projectSummary_creationDate :: Lens.Lens' ProjectSummary (Prelude.Maybe Prelude.UTCTime)
projectSummary_creationDate :: Lens' ProjectSummary (Maybe UTCTime)
projectSummary_creationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectSummary' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:ProjectSummary' :: ProjectSummary -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: ProjectSummary
s@ProjectSummary' {} Maybe POSIX
a -> ProjectSummary
s {$sel:creationDate:ProjectSummary' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: ProjectSummary) 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

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

-- | The date the project was last updated, in Unix epoch time.
projectSummary_lastUpdateDate :: Lens.Lens' ProjectSummary (Prelude.Maybe Prelude.UTCTime)
projectSummary_lastUpdateDate :: Lens' ProjectSummary (Maybe UTCTime)
projectSummary_lastUpdateDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectSummary' {Maybe POSIX
lastUpdateDate :: Maybe POSIX
$sel:lastUpdateDate:ProjectSummary' :: ProjectSummary -> Maybe POSIX
lastUpdateDate} -> Maybe POSIX
lastUpdateDate) (\s :: ProjectSummary
s@ProjectSummary' {} Maybe POSIX
a -> ProjectSummary
s {$sel:lastUpdateDate:ProjectSummary' :: Maybe POSIX
lastUpdateDate = Maybe POSIX
a} :: ProjectSummary) 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

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

-- | The name of the project.
projectSummary_name :: Lens.Lens' ProjectSummary Prelude.Text
projectSummary_name :: Lens' ProjectSummary Text
projectSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectSummary' {Text
name :: Text
$sel:name:ProjectSummary' :: ProjectSummary -> Text
name} -> Text
name) (\s :: ProjectSummary
s@ProjectSummary' {} Text
a -> ProjectSummary
s {$sel:name:ProjectSummary' :: Text
name = Text
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 POSIX
-> Maybe Text -> Maybe POSIX -> Text -> Text -> 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
"creationDate")
            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
"description")
            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
"lastUpdateDate")
            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
"id")
            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
"name")
      )

instance Prelude.Hashable ProjectSummary where
  hashWithSalt :: Int -> ProjectSummary -> Int
hashWithSalt Int
_salt ProjectSummary' {Maybe Text
Maybe POSIX
Text
name :: Text
id :: Text
lastUpdateDate :: Maybe POSIX
description :: Maybe Text
creationDate :: Maybe POSIX
$sel:name:ProjectSummary' :: ProjectSummary -> Text
$sel:id:ProjectSummary' :: ProjectSummary -> Text
$sel:lastUpdateDate:ProjectSummary' :: ProjectSummary -> Maybe POSIX
$sel:description:ProjectSummary' :: ProjectSummary -> Maybe Text
$sel:creationDate:ProjectSummary' :: ProjectSummary -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdateDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData ProjectSummary where
  rnf :: ProjectSummary -> ()
rnf ProjectSummary' {Maybe Text
Maybe POSIX
Text
name :: Text
id :: Text
lastUpdateDate :: Maybe POSIX
description :: Maybe Text
creationDate :: Maybe POSIX
$sel:name:ProjectSummary' :: ProjectSummary -> Text
$sel:id:ProjectSummary' :: ProjectSummary -> Text
$sel:lastUpdateDate:ProjectSummary' :: ProjectSummary -> Maybe POSIX
$sel:description:ProjectSummary' :: ProjectSummary -> Maybe Text
$sel:creationDate:ProjectSummary' :: ProjectSummary -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdateDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name