{-# 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 #-}
module Amazonka.IoTSiteWise.Types.ProjectSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ProjectSummary = ProjectSummary'
{
ProjectSummary -> Maybe POSIX
lastUpdateDate :: Prelude.Maybe Core.POSIX,
ProjectSummary -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
ProjectSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
ProjectSummary -> Text
id :: Prelude.Text,
ProjectSummary -> Text
name :: Prelude.Text
}
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)
newProjectSummary ::
Prelude.Text ->
Prelude.Text ->
ProjectSummary
newProjectSummary :: Text -> Text -> ProjectSummary
newProjectSummary Text
pId_ Text
pName_ =
ProjectSummary' :: Maybe POSIX
-> Maybe POSIX -> Maybe Text -> Text -> Text -> ProjectSummary
ProjectSummary'
{ $sel:lastUpdateDate:ProjectSummary' :: Maybe POSIX
lastUpdateDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:creationDate:ProjectSummary' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:description:ProjectSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:ProjectSummary' :: Text
id = Text
pId_,
$sel:name:ProjectSummary' :: Text
name = Text
pName_
}
projectSummary_lastUpdateDate :: Lens.Lens' ProjectSummary (Prelude.Maybe Prelude.UTCTime)
projectSummary_lastUpdateDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ProjectSummary -> f ProjectSummary
projectSummary_lastUpdateDate = (ProjectSummary -> Maybe POSIX)
-> (ProjectSummary -> Maybe POSIX -> ProjectSummary)
-> Lens ProjectSummary ProjectSummary (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
-> ProjectSummary -> f ProjectSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ProjectSummary
-> f ProjectSummary
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
projectSummary_creationDate :: Lens.Lens' ProjectSummary (Prelude.Maybe Prelude.UTCTime)
projectSummary_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ProjectSummary -> f ProjectSummary
projectSummary_creationDate = (ProjectSummary -> Maybe POSIX)
-> (ProjectSummary -> Maybe POSIX -> ProjectSummary)
-> Lens ProjectSummary ProjectSummary (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
-> ProjectSummary -> f ProjectSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ProjectSummary
-> f ProjectSummary
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
projectSummary_description :: Lens.Lens' ProjectSummary (Prelude.Maybe Prelude.Text)
projectSummary_description :: (Maybe Text -> f (Maybe Text))
-> ProjectSummary -> f ProjectSummary
projectSummary_description = (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
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)
projectSummary_id :: Lens.Lens' ProjectSummary Prelude.Text
projectSummary_id :: (Text -> f Text) -> ProjectSummary -> f ProjectSummary
projectSummary_id = (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
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)
projectSummary_name :: Lens.Lens' ProjectSummary Prelude.Text
projectSummary_name :: (Text -> f Text) -> ProjectSummary -> f ProjectSummary
projectSummary_name = (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
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 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 POSIX
-> Maybe POSIX -> Maybe Text -> Text -> Text -> ProjectSummary
ProjectSummary'
(Maybe POSIX
-> Maybe POSIX -> Maybe Text -> Text -> Text -> ProjectSummary)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX -> Maybe Text -> Text -> Text -> ProjectSummary)
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
"lastUpdateDate")
Parser
(Maybe POSIX -> Maybe Text -> Text -> Text -> ProjectSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Text -> Text -> ProjectSummary)
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
"creationDate")
Parser (Maybe Text -> Text -> Text -> ProjectSummary)
-> Parser (Maybe Text) -> Parser (Text -> Text -> ProjectSummary)
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
"description")
Parser (Text -> Text -> ProjectSummary)
-> Parser Text -> Parser (Text -> 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
"id")
Parser (Text -> ProjectSummary)
-> Parser Text -> Parser 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
"name")
)
instance Prelude.Hashable ProjectSummary
instance Prelude.NFData ProjectSummary