{-# 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.IoT1ClickProjects.Types.ProjectDescription where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT1ClickProjects.Types.PlacementTemplate
import qualified Amazonka.Prelude as Prelude
data ProjectDescription = ProjectDescription'
{
ProjectDescription -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
ProjectDescription -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
ProjectDescription -> Maybe PlacementTemplate
placementTemplate :: Prelude.Maybe PlacementTemplate,
ProjectDescription -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
ProjectDescription -> Text
projectName :: Prelude.Text,
ProjectDescription -> POSIX
createdDate :: Data.POSIX,
ProjectDescription -> POSIX
updatedDate :: Data.POSIX
}
deriving (ProjectDescription -> ProjectDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProjectDescription -> ProjectDescription -> Bool
$c/= :: ProjectDescription -> ProjectDescription -> Bool
== :: ProjectDescription -> ProjectDescription -> Bool
$c== :: ProjectDescription -> ProjectDescription -> Bool
Prelude.Eq, ReadPrec [ProjectDescription]
ReadPrec ProjectDescription
Int -> ReadS ProjectDescription
ReadS [ProjectDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProjectDescription]
$creadListPrec :: ReadPrec [ProjectDescription]
readPrec :: ReadPrec ProjectDescription
$creadPrec :: ReadPrec ProjectDescription
readList :: ReadS [ProjectDescription]
$creadList :: ReadS [ProjectDescription]
readsPrec :: Int -> ReadS ProjectDescription
$creadsPrec :: Int -> ReadS ProjectDescription
Prelude.Read, Int -> ProjectDescription -> ShowS
[ProjectDescription] -> ShowS
ProjectDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProjectDescription] -> ShowS
$cshowList :: [ProjectDescription] -> ShowS
show :: ProjectDescription -> String
$cshow :: ProjectDescription -> String
showsPrec :: Int -> ProjectDescription -> ShowS
$cshowsPrec :: Int -> ProjectDescription -> ShowS
Prelude.Show, forall x. Rep ProjectDescription x -> ProjectDescription
forall x. ProjectDescription -> Rep ProjectDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProjectDescription x -> ProjectDescription
$cfrom :: forall x. ProjectDescription -> Rep ProjectDescription x
Prelude.Generic)
newProjectDescription ::
Prelude.Text ->
Prelude.UTCTime ->
Prelude.UTCTime ->
ProjectDescription
newProjectDescription :: Text -> UTCTime -> UTCTime -> ProjectDescription
newProjectDescription
Text
pProjectName_
UTCTime
pCreatedDate_
UTCTime
pUpdatedDate_ =
ProjectDescription'
{ $sel:arn:ProjectDescription' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:description:ProjectDescription' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:placementTemplate:ProjectDescription' :: Maybe PlacementTemplate
placementTemplate = forall a. Maybe a
Prelude.Nothing,
$sel:tags:ProjectDescription' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
$sel:projectName:ProjectDescription' :: Text
projectName = Text
pProjectName_,
$sel:createdDate:ProjectDescription' :: POSIX
createdDate = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedDate_,
$sel:updatedDate:ProjectDescription' :: POSIX
updatedDate = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdatedDate_
}
projectDescription_arn :: Lens.Lens' ProjectDescription (Prelude.Maybe Prelude.Text)
projectDescription_arn :: Lens' ProjectDescription (Maybe Text)
projectDescription_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDescription' {Maybe Text
arn :: Maybe Text
$sel:arn:ProjectDescription' :: ProjectDescription -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ProjectDescription
s@ProjectDescription' {} Maybe Text
a -> ProjectDescription
s {$sel:arn:ProjectDescription' :: Maybe Text
arn = Maybe Text
a} :: ProjectDescription)
projectDescription_description :: Lens.Lens' ProjectDescription (Prelude.Maybe Prelude.Text)
projectDescription_description :: Lens' ProjectDescription (Maybe Text)
projectDescription_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDescription' {Maybe Text
description :: Maybe Text
$sel:description:ProjectDescription' :: ProjectDescription -> Maybe Text
description} -> Maybe Text
description) (\s :: ProjectDescription
s@ProjectDescription' {} Maybe Text
a -> ProjectDescription
s {$sel:description:ProjectDescription' :: Maybe Text
description = Maybe Text
a} :: ProjectDescription)
projectDescription_placementTemplate :: Lens.Lens' ProjectDescription (Prelude.Maybe PlacementTemplate)
projectDescription_placementTemplate :: Lens' ProjectDescription (Maybe PlacementTemplate)
projectDescription_placementTemplate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDescription' {Maybe PlacementTemplate
placementTemplate :: Maybe PlacementTemplate
$sel:placementTemplate:ProjectDescription' :: ProjectDescription -> Maybe PlacementTemplate
placementTemplate} -> Maybe PlacementTemplate
placementTemplate) (\s :: ProjectDescription
s@ProjectDescription' {} Maybe PlacementTemplate
a -> ProjectDescription
s {$sel:placementTemplate:ProjectDescription' :: Maybe PlacementTemplate
placementTemplate = Maybe PlacementTemplate
a} :: ProjectDescription)
projectDescription_tags :: Lens.Lens' ProjectDescription (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
projectDescription_tags :: Lens' ProjectDescription (Maybe (HashMap Text Text))
projectDescription_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDescription' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ProjectDescription' :: ProjectDescription -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ProjectDescription
s@ProjectDescription' {} Maybe (HashMap Text Text)
a -> ProjectDescription
s {$sel:tags:ProjectDescription' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ProjectDescription) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
projectDescription_projectName :: Lens.Lens' ProjectDescription Prelude.Text
projectDescription_projectName :: Lens' ProjectDescription Text
projectDescription_projectName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDescription' {Text
projectName :: Text
$sel:projectName:ProjectDescription' :: ProjectDescription -> Text
projectName} -> Text
projectName) (\s :: ProjectDescription
s@ProjectDescription' {} Text
a -> ProjectDescription
s {$sel:projectName:ProjectDescription' :: Text
projectName = Text
a} :: ProjectDescription)
projectDescription_createdDate :: Lens.Lens' ProjectDescription Prelude.UTCTime
projectDescription_createdDate :: Lens' ProjectDescription UTCTime
projectDescription_createdDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDescription' {POSIX
createdDate :: POSIX
$sel:createdDate:ProjectDescription' :: ProjectDescription -> POSIX
createdDate} -> POSIX
createdDate) (\s :: ProjectDescription
s@ProjectDescription' {} POSIX
a -> ProjectDescription
s {$sel:createdDate:ProjectDescription' :: POSIX
createdDate = POSIX
a} :: ProjectDescription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
projectDescription_updatedDate :: Lens.Lens' ProjectDescription Prelude.UTCTime
projectDescription_updatedDate :: Lens' ProjectDescription UTCTime
projectDescription_updatedDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDescription' {POSIX
updatedDate :: POSIX
$sel:updatedDate:ProjectDescription' :: ProjectDescription -> POSIX
updatedDate} -> POSIX
updatedDate) (\s :: ProjectDescription
s@ProjectDescription' {} POSIX
a -> ProjectDescription
s {$sel:updatedDate:ProjectDescription' :: POSIX
updatedDate = POSIX
a} :: ProjectDescription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromJSON ProjectDescription where
parseJSON :: Value -> Parser ProjectDescription
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ProjectDescription"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe PlacementTemplate
-> Maybe (HashMap Text Text)
-> Text
-> POSIX
-> POSIX
-> ProjectDescription
ProjectDescription'
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
"arn")
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
"placementTemplate")
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
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"createdDate")
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
"updatedDate")
)
instance Prelude.Hashable ProjectDescription where
hashWithSalt :: Int -> ProjectDescription -> Int
hashWithSalt Int
_salt ProjectDescription' {Maybe Text
Maybe (HashMap Text Text)
Maybe PlacementTemplate
Text
POSIX
updatedDate :: POSIX
createdDate :: POSIX
projectName :: Text
tags :: Maybe (HashMap Text Text)
placementTemplate :: Maybe PlacementTemplate
description :: Maybe Text
arn :: Maybe Text
$sel:updatedDate:ProjectDescription' :: ProjectDescription -> POSIX
$sel:createdDate:ProjectDescription' :: ProjectDescription -> POSIX
$sel:projectName:ProjectDescription' :: ProjectDescription -> Text
$sel:tags:ProjectDescription' :: ProjectDescription -> Maybe (HashMap Text Text)
$sel:placementTemplate:ProjectDescription' :: ProjectDescription -> Maybe PlacementTemplate
$sel:description:ProjectDescription' :: ProjectDescription -> Maybe Text
$sel:arn:ProjectDescription' :: ProjectDescription -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PlacementTemplate
placementTemplate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
projectName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
createdDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
updatedDate
instance Prelude.NFData ProjectDescription where
rnf :: ProjectDescription -> ()
rnf ProjectDescription' {Maybe Text
Maybe (HashMap Text Text)
Maybe PlacementTemplate
Text
POSIX
updatedDate :: POSIX
createdDate :: POSIX
projectName :: Text
tags :: Maybe (HashMap Text Text)
placementTemplate :: Maybe PlacementTemplate
description :: Maybe Text
arn :: Maybe Text
$sel:updatedDate:ProjectDescription' :: ProjectDescription -> POSIX
$sel:createdDate:ProjectDescription' :: ProjectDescription -> POSIX
$sel:projectName:ProjectDescription' :: ProjectDescription -> Text
$sel:tags:ProjectDescription' :: ProjectDescription -> Maybe (HashMap Text Text)
$sel:placementTemplate:ProjectDescription' :: ProjectDescription -> Maybe PlacementTemplate
$sel:description:ProjectDescription' :: ProjectDescription -> Maybe Text
$sel:arn:ProjectDescription' :: ProjectDescription -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
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 PlacementTemplate
placementTemplate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
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 POSIX
createdDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
updatedDate