{-# 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.MQ.Types.ConfigurationRevision where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ConfigurationRevision = ConfigurationRevision'
{
ConfigurationRevision -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
ConfigurationRevision -> Int
revision :: Prelude.Int,
ConfigurationRevision -> POSIX
created :: Core.POSIX
}
deriving (ConfigurationRevision -> ConfigurationRevision -> Bool
(ConfigurationRevision -> ConfigurationRevision -> Bool)
-> (ConfigurationRevision -> ConfigurationRevision -> Bool)
-> Eq ConfigurationRevision
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfigurationRevision -> ConfigurationRevision -> Bool
$c/= :: ConfigurationRevision -> ConfigurationRevision -> Bool
== :: ConfigurationRevision -> ConfigurationRevision -> Bool
$c== :: ConfigurationRevision -> ConfigurationRevision -> Bool
Prelude.Eq, ReadPrec [ConfigurationRevision]
ReadPrec ConfigurationRevision
Int -> ReadS ConfigurationRevision
ReadS [ConfigurationRevision]
(Int -> ReadS ConfigurationRevision)
-> ReadS [ConfigurationRevision]
-> ReadPrec ConfigurationRevision
-> ReadPrec [ConfigurationRevision]
-> Read ConfigurationRevision
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConfigurationRevision]
$creadListPrec :: ReadPrec [ConfigurationRevision]
readPrec :: ReadPrec ConfigurationRevision
$creadPrec :: ReadPrec ConfigurationRevision
readList :: ReadS [ConfigurationRevision]
$creadList :: ReadS [ConfigurationRevision]
readsPrec :: Int -> ReadS ConfigurationRevision
$creadsPrec :: Int -> ReadS ConfigurationRevision
Prelude.Read, Int -> ConfigurationRevision -> ShowS
[ConfigurationRevision] -> ShowS
ConfigurationRevision -> String
(Int -> ConfigurationRevision -> ShowS)
-> (ConfigurationRevision -> String)
-> ([ConfigurationRevision] -> ShowS)
-> Show ConfigurationRevision
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfigurationRevision] -> ShowS
$cshowList :: [ConfigurationRevision] -> ShowS
show :: ConfigurationRevision -> String
$cshow :: ConfigurationRevision -> String
showsPrec :: Int -> ConfigurationRevision -> ShowS
$cshowsPrec :: Int -> ConfigurationRevision -> ShowS
Prelude.Show, (forall x. ConfigurationRevision -> Rep ConfigurationRevision x)
-> (forall x. Rep ConfigurationRevision x -> ConfigurationRevision)
-> Generic ConfigurationRevision
forall x. Rep ConfigurationRevision x -> ConfigurationRevision
forall x. ConfigurationRevision -> Rep ConfigurationRevision x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConfigurationRevision x -> ConfigurationRevision
$cfrom :: forall x. ConfigurationRevision -> Rep ConfigurationRevision x
Prelude.Generic)
newConfigurationRevision ::
Prelude.Int ->
Prelude.UTCTime ->
ConfigurationRevision
newConfigurationRevision :: Int -> UTCTime -> ConfigurationRevision
newConfigurationRevision Int
pRevision_ UTCTime
pCreated_ =
ConfigurationRevision' :: Maybe Text -> Int -> POSIX -> ConfigurationRevision
ConfigurationRevision'
{ $sel:description:ConfigurationRevision' :: Maybe Text
description =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:revision:ConfigurationRevision' :: Int
revision = Int
pRevision_,
$sel:created:ConfigurationRevision' :: POSIX
created = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreated_
}
configurationRevision_description :: Lens.Lens' ConfigurationRevision (Prelude.Maybe Prelude.Text)
configurationRevision_description :: (Maybe Text -> f (Maybe Text))
-> ConfigurationRevision -> f ConfigurationRevision
configurationRevision_description = (ConfigurationRevision -> Maybe Text)
-> (ConfigurationRevision -> Maybe Text -> ConfigurationRevision)
-> Lens
ConfigurationRevision
ConfigurationRevision
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigurationRevision' {Maybe Text
description :: Maybe Text
$sel:description:ConfigurationRevision' :: ConfigurationRevision -> Maybe Text
description} -> Maybe Text
description) (\s :: ConfigurationRevision
s@ConfigurationRevision' {} Maybe Text
a -> ConfigurationRevision
s {$sel:description:ConfigurationRevision' :: Maybe Text
description = Maybe Text
a} :: ConfigurationRevision)
configurationRevision_revision :: Lens.Lens' ConfigurationRevision Prelude.Int
configurationRevision_revision :: (Int -> f Int) -> ConfigurationRevision -> f ConfigurationRevision
configurationRevision_revision = (ConfigurationRevision -> Int)
-> (ConfigurationRevision -> Int -> ConfigurationRevision)
-> Lens ConfigurationRevision ConfigurationRevision Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigurationRevision' {Int
revision :: Int
$sel:revision:ConfigurationRevision' :: ConfigurationRevision -> Int
revision} -> Int
revision) (\s :: ConfigurationRevision
s@ConfigurationRevision' {} Int
a -> ConfigurationRevision
s {$sel:revision:ConfigurationRevision' :: Int
revision = Int
a} :: ConfigurationRevision)
configurationRevision_created :: Lens.Lens' ConfigurationRevision Prelude.UTCTime
configurationRevision_created :: (UTCTime -> f UTCTime)
-> ConfigurationRevision -> f ConfigurationRevision
configurationRevision_created = (ConfigurationRevision -> POSIX)
-> (ConfigurationRevision -> POSIX -> ConfigurationRevision)
-> Lens ConfigurationRevision ConfigurationRevision POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigurationRevision' {POSIX
created :: POSIX
$sel:created:ConfigurationRevision' :: ConfigurationRevision -> POSIX
created} -> POSIX
created) (\s :: ConfigurationRevision
s@ConfigurationRevision' {} POSIX
a -> ConfigurationRevision
s {$sel:created:ConfigurationRevision' :: POSIX
created = POSIX
a} :: ConfigurationRevision) ((POSIX -> f POSIX)
-> ConfigurationRevision -> f ConfigurationRevision)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ConfigurationRevision
-> f ConfigurationRevision
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON ConfigurationRevision where
parseJSON :: Value -> Parser ConfigurationRevision
parseJSON =
String
-> (Object -> Parser ConfigurationRevision)
-> Value
-> Parser ConfigurationRevision
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ConfigurationRevision"
( \Object
x ->
Maybe Text -> Int -> POSIX -> ConfigurationRevision
ConfigurationRevision'
(Maybe Text -> Int -> POSIX -> ConfigurationRevision)
-> Parser (Maybe Text)
-> Parser (Int -> POSIX -> ConfigurationRevision)
forall (f :: * -> *) a b. Functor 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 (Int -> POSIX -> ConfigurationRevision)
-> Parser Int -> Parser (POSIX -> ConfigurationRevision)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"revision")
Parser (POSIX -> ConfigurationRevision)
-> Parser POSIX -> Parser ConfigurationRevision
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"created")
)
instance Prelude.Hashable ConfigurationRevision
instance Prelude.NFData ConfigurationRevision