{-# 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.MemoryDb.Types.ServiceUpdate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MemoryDb.Types.ServiceUpdateStatus
import Amazonka.MemoryDb.Types.ServiceUpdateType
import qualified Amazonka.Prelude as Prelude
data ServiceUpdate = ServiceUpdate'
{
ServiceUpdate -> Maybe ServiceUpdateStatus
status :: Prelude.Maybe ServiceUpdateStatus,
ServiceUpdate -> Maybe POSIX
autoUpdateStartDate :: Prelude.Maybe Core.POSIX,
ServiceUpdate -> Maybe Text
serviceUpdateName :: Prelude.Maybe Prelude.Text,
ServiceUpdate -> Maybe Text
nodesUpdated :: Prelude.Maybe Prelude.Text,
ServiceUpdate -> Maybe POSIX
releaseDate :: Prelude.Maybe Core.POSIX,
ServiceUpdate -> Maybe Text
clusterName :: Prelude.Maybe Prelude.Text,
ServiceUpdate -> Maybe ServiceUpdateType
type' :: Prelude.Maybe ServiceUpdateType,
ServiceUpdate -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (ServiceUpdate -> ServiceUpdate -> Bool
(ServiceUpdate -> ServiceUpdate -> Bool)
-> (ServiceUpdate -> ServiceUpdate -> Bool) -> Eq ServiceUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceUpdate -> ServiceUpdate -> Bool
$c/= :: ServiceUpdate -> ServiceUpdate -> Bool
== :: ServiceUpdate -> ServiceUpdate -> Bool
$c== :: ServiceUpdate -> ServiceUpdate -> Bool
Prelude.Eq, ReadPrec [ServiceUpdate]
ReadPrec ServiceUpdate
Int -> ReadS ServiceUpdate
ReadS [ServiceUpdate]
(Int -> ReadS ServiceUpdate)
-> ReadS [ServiceUpdate]
-> ReadPrec ServiceUpdate
-> ReadPrec [ServiceUpdate]
-> Read ServiceUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceUpdate]
$creadListPrec :: ReadPrec [ServiceUpdate]
readPrec :: ReadPrec ServiceUpdate
$creadPrec :: ReadPrec ServiceUpdate
readList :: ReadS [ServiceUpdate]
$creadList :: ReadS [ServiceUpdate]
readsPrec :: Int -> ReadS ServiceUpdate
$creadsPrec :: Int -> ReadS ServiceUpdate
Prelude.Read, Int -> ServiceUpdate -> ShowS
[ServiceUpdate] -> ShowS
ServiceUpdate -> String
(Int -> ServiceUpdate -> ShowS)
-> (ServiceUpdate -> String)
-> ([ServiceUpdate] -> ShowS)
-> Show ServiceUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceUpdate] -> ShowS
$cshowList :: [ServiceUpdate] -> ShowS
show :: ServiceUpdate -> String
$cshow :: ServiceUpdate -> String
showsPrec :: Int -> ServiceUpdate -> ShowS
$cshowsPrec :: Int -> ServiceUpdate -> ShowS
Prelude.Show, (forall x. ServiceUpdate -> Rep ServiceUpdate x)
-> (forall x. Rep ServiceUpdate x -> ServiceUpdate)
-> Generic ServiceUpdate
forall x. Rep ServiceUpdate x -> ServiceUpdate
forall x. ServiceUpdate -> Rep ServiceUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceUpdate x -> ServiceUpdate
$cfrom :: forall x. ServiceUpdate -> Rep ServiceUpdate x
Prelude.Generic)
newServiceUpdate ::
ServiceUpdate
newServiceUpdate :: ServiceUpdate
newServiceUpdate =
ServiceUpdate' :: Maybe ServiceUpdateStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe ServiceUpdateType
-> Maybe Text
-> ServiceUpdate
ServiceUpdate'
{ $sel:status:ServiceUpdate' :: Maybe ServiceUpdateStatus
status = Maybe ServiceUpdateStatus
forall a. Maybe a
Prelude.Nothing,
$sel:autoUpdateStartDate:ServiceUpdate' :: Maybe POSIX
autoUpdateStartDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:serviceUpdateName:ServiceUpdate' :: Maybe Text
serviceUpdateName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nodesUpdated:ServiceUpdate' :: Maybe Text
nodesUpdated = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:releaseDate:ServiceUpdate' :: Maybe POSIX
releaseDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:clusterName:ServiceUpdate' :: Maybe Text
clusterName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':ServiceUpdate' :: Maybe ServiceUpdateType
type' = Maybe ServiceUpdateType
forall a. Maybe a
Prelude.Nothing,
$sel:description:ServiceUpdate' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
serviceUpdate_status :: Lens.Lens' ServiceUpdate (Prelude.Maybe ServiceUpdateStatus)
serviceUpdate_status :: (Maybe ServiceUpdateStatus -> f (Maybe ServiceUpdateStatus))
-> ServiceUpdate -> f ServiceUpdate
serviceUpdate_status = (ServiceUpdate -> Maybe ServiceUpdateStatus)
-> (ServiceUpdate -> Maybe ServiceUpdateStatus -> ServiceUpdate)
-> Lens
ServiceUpdate
ServiceUpdate
(Maybe ServiceUpdateStatus)
(Maybe ServiceUpdateStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceUpdate' {Maybe ServiceUpdateStatus
status :: Maybe ServiceUpdateStatus
$sel:status:ServiceUpdate' :: ServiceUpdate -> Maybe ServiceUpdateStatus
status} -> Maybe ServiceUpdateStatus
status) (\s :: ServiceUpdate
s@ServiceUpdate' {} Maybe ServiceUpdateStatus
a -> ServiceUpdate
s {$sel:status:ServiceUpdate' :: Maybe ServiceUpdateStatus
status = Maybe ServiceUpdateStatus
a} :: ServiceUpdate)
serviceUpdate_autoUpdateStartDate :: Lens.Lens' ServiceUpdate (Prelude.Maybe Prelude.UTCTime)
serviceUpdate_autoUpdateStartDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ServiceUpdate -> f ServiceUpdate
serviceUpdate_autoUpdateStartDate = (ServiceUpdate -> Maybe POSIX)
-> (ServiceUpdate -> Maybe POSIX -> ServiceUpdate)
-> Lens ServiceUpdate ServiceUpdate (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceUpdate' {Maybe POSIX
autoUpdateStartDate :: Maybe POSIX
$sel:autoUpdateStartDate:ServiceUpdate' :: ServiceUpdate -> Maybe POSIX
autoUpdateStartDate} -> Maybe POSIX
autoUpdateStartDate) (\s :: ServiceUpdate
s@ServiceUpdate' {} Maybe POSIX
a -> ServiceUpdate
s {$sel:autoUpdateStartDate:ServiceUpdate' :: Maybe POSIX
autoUpdateStartDate = Maybe POSIX
a} :: ServiceUpdate) ((Maybe POSIX -> f (Maybe POSIX))
-> ServiceUpdate -> f ServiceUpdate)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ServiceUpdate
-> f ServiceUpdate
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
serviceUpdate_serviceUpdateName :: Lens.Lens' ServiceUpdate (Prelude.Maybe Prelude.Text)
serviceUpdate_serviceUpdateName :: (Maybe Text -> f (Maybe Text)) -> ServiceUpdate -> f ServiceUpdate
serviceUpdate_serviceUpdateName = (ServiceUpdate -> Maybe Text)
-> (ServiceUpdate -> Maybe Text -> ServiceUpdate)
-> Lens ServiceUpdate ServiceUpdate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceUpdate' {Maybe Text
serviceUpdateName :: Maybe Text
$sel:serviceUpdateName:ServiceUpdate' :: ServiceUpdate -> Maybe Text
serviceUpdateName} -> Maybe Text
serviceUpdateName) (\s :: ServiceUpdate
s@ServiceUpdate' {} Maybe Text
a -> ServiceUpdate
s {$sel:serviceUpdateName:ServiceUpdate' :: Maybe Text
serviceUpdateName = Maybe Text
a} :: ServiceUpdate)
serviceUpdate_nodesUpdated :: Lens.Lens' ServiceUpdate (Prelude.Maybe Prelude.Text)
serviceUpdate_nodesUpdated :: (Maybe Text -> f (Maybe Text)) -> ServiceUpdate -> f ServiceUpdate
serviceUpdate_nodesUpdated = (ServiceUpdate -> Maybe Text)
-> (ServiceUpdate -> Maybe Text -> ServiceUpdate)
-> Lens ServiceUpdate ServiceUpdate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceUpdate' {Maybe Text
nodesUpdated :: Maybe Text
$sel:nodesUpdated:ServiceUpdate' :: ServiceUpdate -> Maybe Text
nodesUpdated} -> Maybe Text
nodesUpdated) (\s :: ServiceUpdate
s@ServiceUpdate' {} Maybe Text
a -> ServiceUpdate
s {$sel:nodesUpdated:ServiceUpdate' :: Maybe Text
nodesUpdated = Maybe Text
a} :: ServiceUpdate)
serviceUpdate_releaseDate :: Lens.Lens' ServiceUpdate (Prelude.Maybe Prelude.UTCTime)
serviceUpdate_releaseDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ServiceUpdate -> f ServiceUpdate
serviceUpdate_releaseDate = (ServiceUpdate -> Maybe POSIX)
-> (ServiceUpdate -> Maybe POSIX -> ServiceUpdate)
-> Lens ServiceUpdate ServiceUpdate (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceUpdate' {Maybe POSIX
releaseDate :: Maybe POSIX
$sel:releaseDate:ServiceUpdate' :: ServiceUpdate -> Maybe POSIX
releaseDate} -> Maybe POSIX
releaseDate) (\s :: ServiceUpdate
s@ServiceUpdate' {} Maybe POSIX
a -> ServiceUpdate
s {$sel:releaseDate:ServiceUpdate' :: Maybe POSIX
releaseDate = Maybe POSIX
a} :: ServiceUpdate) ((Maybe POSIX -> f (Maybe POSIX))
-> ServiceUpdate -> f ServiceUpdate)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ServiceUpdate
-> f ServiceUpdate
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
serviceUpdate_clusterName :: Lens.Lens' ServiceUpdate (Prelude.Maybe Prelude.Text)
serviceUpdate_clusterName :: (Maybe Text -> f (Maybe Text)) -> ServiceUpdate -> f ServiceUpdate
serviceUpdate_clusterName = (ServiceUpdate -> Maybe Text)
-> (ServiceUpdate -> Maybe Text -> ServiceUpdate)
-> Lens ServiceUpdate ServiceUpdate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceUpdate' {Maybe Text
clusterName :: Maybe Text
$sel:clusterName:ServiceUpdate' :: ServiceUpdate -> Maybe Text
clusterName} -> Maybe Text
clusterName) (\s :: ServiceUpdate
s@ServiceUpdate' {} Maybe Text
a -> ServiceUpdate
s {$sel:clusterName:ServiceUpdate' :: Maybe Text
clusterName = Maybe Text
a} :: ServiceUpdate)
serviceUpdate_type :: Lens.Lens' ServiceUpdate (Prelude.Maybe ServiceUpdateType)
serviceUpdate_type :: (Maybe ServiceUpdateType -> f (Maybe ServiceUpdateType))
-> ServiceUpdate -> f ServiceUpdate
serviceUpdate_type = (ServiceUpdate -> Maybe ServiceUpdateType)
-> (ServiceUpdate -> Maybe ServiceUpdateType -> ServiceUpdate)
-> Lens
ServiceUpdate
ServiceUpdate
(Maybe ServiceUpdateType)
(Maybe ServiceUpdateType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceUpdate' {Maybe ServiceUpdateType
type' :: Maybe ServiceUpdateType
$sel:type':ServiceUpdate' :: ServiceUpdate -> Maybe ServiceUpdateType
type'} -> Maybe ServiceUpdateType
type') (\s :: ServiceUpdate
s@ServiceUpdate' {} Maybe ServiceUpdateType
a -> ServiceUpdate
s {$sel:type':ServiceUpdate' :: Maybe ServiceUpdateType
type' = Maybe ServiceUpdateType
a} :: ServiceUpdate)
serviceUpdate_description :: Lens.Lens' ServiceUpdate (Prelude.Maybe Prelude.Text)
serviceUpdate_description :: (Maybe Text -> f (Maybe Text)) -> ServiceUpdate -> f ServiceUpdate
serviceUpdate_description = (ServiceUpdate -> Maybe Text)
-> (ServiceUpdate -> Maybe Text -> ServiceUpdate)
-> Lens ServiceUpdate ServiceUpdate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceUpdate' {Maybe Text
description :: Maybe Text
$sel:description:ServiceUpdate' :: ServiceUpdate -> Maybe Text
description} -> Maybe Text
description) (\s :: ServiceUpdate
s@ServiceUpdate' {} Maybe Text
a -> ServiceUpdate
s {$sel:description:ServiceUpdate' :: Maybe Text
description = Maybe Text
a} :: ServiceUpdate)
instance Core.FromJSON ServiceUpdate where
parseJSON :: Value -> Parser ServiceUpdate
parseJSON =
String
-> (Object -> Parser ServiceUpdate)
-> Value
-> Parser ServiceUpdate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ServiceUpdate"
( \Object
x ->
Maybe ServiceUpdateStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe ServiceUpdateType
-> Maybe Text
-> ServiceUpdate
ServiceUpdate'
(Maybe ServiceUpdateStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe ServiceUpdateType
-> Maybe Text
-> ServiceUpdate)
-> Parser (Maybe ServiceUpdateStatus)
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe ServiceUpdateType
-> Maybe Text
-> ServiceUpdate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ServiceUpdateStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe ServiceUpdateType
-> Maybe Text
-> ServiceUpdate)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe ServiceUpdateType
-> Maybe Text
-> ServiceUpdate)
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
"AutoUpdateStartDate")
Parser
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe ServiceUpdateType
-> Maybe Text
-> ServiceUpdate)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe ServiceUpdateType
-> Maybe Text
-> ServiceUpdate)
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
"ServiceUpdateName")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe ServiceUpdateType
-> Maybe Text
-> ServiceUpdate)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe ServiceUpdateType
-> Maybe Text
-> ServiceUpdate)
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
"NodesUpdated")
Parser
(Maybe POSIX
-> Maybe Text
-> Maybe ServiceUpdateType
-> Maybe Text
-> ServiceUpdate)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe ServiceUpdateType -> Maybe Text -> ServiceUpdate)
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
"ReleaseDate")
Parser
(Maybe Text
-> Maybe ServiceUpdateType -> Maybe Text -> ServiceUpdate)
-> Parser (Maybe Text)
-> Parser (Maybe ServiceUpdateType -> Maybe Text -> ServiceUpdate)
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
"ClusterName")
Parser (Maybe ServiceUpdateType -> Maybe Text -> ServiceUpdate)
-> Parser (Maybe ServiceUpdateType)
-> Parser (Maybe Text -> ServiceUpdate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ServiceUpdateType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
Parser (Maybe Text -> ServiceUpdate)
-> Parser (Maybe Text) -> Parser ServiceUpdate
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")
)
instance Prelude.Hashable ServiceUpdate
instance Prelude.NFData ServiceUpdate