{-# 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.PlacementDescription 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
data PlacementDescription = PlacementDescription'
{
PlacementDescription -> Text
projectName :: Prelude.Text,
PlacementDescription -> Text
placementName :: Prelude.Text,
PlacementDescription -> HashMap Text Text
attributes :: Prelude.HashMap Prelude.Text Prelude.Text,
PlacementDescription -> POSIX
createdDate :: Data.POSIX,
PlacementDescription -> POSIX
updatedDate :: Data.POSIX
}
deriving (PlacementDescription -> PlacementDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PlacementDescription -> PlacementDescription -> Bool
$c/= :: PlacementDescription -> PlacementDescription -> Bool
== :: PlacementDescription -> PlacementDescription -> Bool
$c== :: PlacementDescription -> PlacementDescription -> Bool
Prelude.Eq, ReadPrec [PlacementDescription]
ReadPrec PlacementDescription
Int -> ReadS PlacementDescription
ReadS [PlacementDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PlacementDescription]
$creadListPrec :: ReadPrec [PlacementDescription]
readPrec :: ReadPrec PlacementDescription
$creadPrec :: ReadPrec PlacementDescription
readList :: ReadS [PlacementDescription]
$creadList :: ReadS [PlacementDescription]
readsPrec :: Int -> ReadS PlacementDescription
$creadsPrec :: Int -> ReadS PlacementDescription
Prelude.Read, Int -> PlacementDescription -> ShowS
[PlacementDescription] -> ShowS
PlacementDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PlacementDescription] -> ShowS
$cshowList :: [PlacementDescription] -> ShowS
show :: PlacementDescription -> String
$cshow :: PlacementDescription -> String
showsPrec :: Int -> PlacementDescription -> ShowS
$cshowsPrec :: Int -> PlacementDescription -> ShowS
Prelude.Show, forall x. Rep PlacementDescription x -> PlacementDescription
forall x. PlacementDescription -> Rep PlacementDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PlacementDescription x -> PlacementDescription
$cfrom :: forall x. PlacementDescription -> Rep PlacementDescription x
Prelude.Generic)
newPlacementDescription ::
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
Prelude.UTCTime ->
PlacementDescription
newPlacementDescription :: Text -> Text -> UTCTime -> UTCTime -> PlacementDescription
newPlacementDescription
Text
pProjectName_
Text
pPlacementName_
UTCTime
pCreatedDate_
UTCTime
pUpdatedDate_ =
PlacementDescription'
{ $sel:projectName:PlacementDescription' :: Text
projectName = Text
pProjectName_,
$sel:placementName:PlacementDescription' :: Text
placementName = Text
pPlacementName_,
$sel:attributes:PlacementDescription' :: HashMap Text Text
attributes = forall a. Monoid a => a
Prelude.mempty,
$sel:createdDate:PlacementDescription' :: POSIX
createdDate = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedDate_,
$sel:updatedDate:PlacementDescription' :: POSIX
updatedDate = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdatedDate_
}
placementDescription_projectName :: Lens.Lens' PlacementDescription Prelude.Text
placementDescription_projectName :: Lens' PlacementDescription Text
placementDescription_projectName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlacementDescription' {Text
projectName :: Text
$sel:projectName:PlacementDescription' :: PlacementDescription -> Text
projectName} -> Text
projectName) (\s :: PlacementDescription
s@PlacementDescription' {} Text
a -> PlacementDescription
s {$sel:projectName:PlacementDescription' :: Text
projectName = Text
a} :: PlacementDescription)
placementDescription_placementName :: Lens.Lens' PlacementDescription Prelude.Text
placementDescription_placementName :: Lens' PlacementDescription Text
placementDescription_placementName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlacementDescription' {Text
placementName :: Text
$sel:placementName:PlacementDescription' :: PlacementDescription -> Text
placementName} -> Text
placementName) (\s :: PlacementDescription
s@PlacementDescription' {} Text
a -> PlacementDescription
s {$sel:placementName:PlacementDescription' :: Text
placementName = Text
a} :: PlacementDescription)
placementDescription_attributes :: Lens.Lens' PlacementDescription (Prelude.HashMap Prelude.Text Prelude.Text)
placementDescription_attributes :: Lens' PlacementDescription (HashMap Text Text)
placementDescription_attributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlacementDescription' {HashMap Text Text
attributes :: HashMap Text Text
$sel:attributes:PlacementDescription' :: PlacementDescription -> HashMap Text Text
attributes} -> HashMap Text Text
attributes) (\s :: PlacementDescription
s@PlacementDescription' {} HashMap Text Text
a -> PlacementDescription
s {$sel:attributes:PlacementDescription' :: HashMap Text Text
attributes = HashMap Text Text
a} :: PlacementDescription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
placementDescription_createdDate :: Lens.Lens' PlacementDescription Prelude.UTCTime
placementDescription_createdDate :: Lens' PlacementDescription UTCTime
placementDescription_createdDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlacementDescription' {POSIX
createdDate :: POSIX
$sel:createdDate:PlacementDescription' :: PlacementDescription -> POSIX
createdDate} -> POSIX
createdDate) (\s :: PlacementDescription
s@PlacementDescription' {} POSIX
a -> PlacementDescription
s {$sel:createdDate:PlacementDescription' :: POSIX
createdDate = POSIX
a} :: PlacementDescription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
placementDescription_updatedDate :: Lens.Lens' PlacementDescription Prelude.UTCTime
placementDescription_updatedDate :: Lens' PlacementDescription UTCTime
placementDescription_updatedDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlacementDescription' {POSIX
updatedDate :: POSIX
$sel:updatedDate:PlacementDescription' :: PlacementDescription -> POSIX
updatedDate} -> POSIX
updatedDate) (\s :: PlacementDescription
s@PlacementDescription' {} POSIX
a -> PlacementDescription
s {$sel:updatedDate:PlacementDescription' :: POSIX
updatedDate = POSIX
a} :: PlacementDescription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromJSON PlacementDescription where
parseJSON :: Value -> Parser PlacementDescription
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PlacementDescription"
( \Object
x ->
Text
-> Text
-> HashMap Text Text
-> POSIX
-> POSIX
-> PlacementDescription
PlacementDescription'
forall (f :: * -> *) a b. Functor 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
"placementName")
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
"attributes" 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
"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 PlacementDescription where
hashWithSalt :: Int -> PlacementDescription -> Int
hashWithSalt Int
_salt PlacementDescription' {Text
HashMap Text Text
POSIX
updatedDate :: POSIX
createdDate :: POSIX
attributes :: HashMap Text Text
placementName :: Text
projectName :: Text
$sel:updatedDate:PlacementDescription' :: PlacementDescription -> POSIX
$sel:createdDate:PlacementDescription' :: PlacementDescription -> POSIX
$sel:attributes:PlacementDescription' :: PlacementDescription -> HashMap Text Text
$sel:placementName:PlacementDescription' :: PlacementDescription -> Text
$sel:projectName:PlacementDescription' :: PlacementDescription -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
projectName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
placementName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HashMap Text Text
attributes
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 PlacementDescription where
rnf :: PlacementDescription -> ()
rnf PlacementDescription' {Text
HashMap Text Text
POSIX
updatedDate :: POSIX
createdDate :: POSIX
attributes :: HashMap Text Text
placementName :: Text
projectName :: Text
$sel:updatedDate:PlacementDescription' :: PlacementDescription -> POSIX
$sel:createdDate:PlacementDescription' :: PlacementDescription -> POSIX
$sel:attributes:PlacementDescription' :: PlacementDescription -> HashMap Text Text
$sel:placementName:PlacementDescription' :: PlacementDescription -> Text
$sel:projectName:PlacementDescription' :: PlacementDescription -> Text
..} =
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
placementName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HashMap Text Text
attributes
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