{-# 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.ElasticSearch.Types.AutoTuneStatus where
import qualified Amazonka.Core as Core
import Amazonka.ElasticSearch.Types.AutoTuneState
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AutoTuneStatus = AutoTuneStatus'
{
AutoTuneStatus -> Maybe Bool
pendingDeletion :: Prelude.Maybe Prelude.Bool,
AutoTuneStatus -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
AutoTuneStatus -> Maybe Natural
updateVersion :: Prelude.Maybe Prelude.Natural,
AutoTuneStatus -> POSIX
creationDate :: Core.POSIX,
AutoTuneStatus -> POSIX
updateDate :: Core.POSIX,
AutoTuneStatus -> AutoTuneState
state :: AutoTuneState
}
deriving (AutoTuneStatus -> AutoTuneStatus -> Bool
(AutoTuneStatus -> AutoTuneStatus -> Bool)
-> (AutoTuneStatus -> AutoTuneStatus -> Bool) -> Eq AutoTuneStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoTuneStatus -> AutoTuneStatus -> Bool
$c/= :: AutoTuneStatus -> AutoTuneStatus -> Bool
== :: AutoTuneStatus -> AutoTuneStatus -> Bool
$c== :: AutoTuneStatus -> AutoTuneStatus -> Bool
Prelude.Eq, ReadPrec [AutoTuneStatus]
ReadPrec AutoTuneStatus
Int -> ReadS AutoTuneStatus
ReadS [AutoTuneStatus]
(Int -> ReadS AutoTuneStatus)
-> ReadS [AutoTuneStatus]
-> ReadPrec AutoTuneStatus
-> ReadPrec [AutoTuneStatus]
-> Read AutoTuneStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoTuneStatus]
$creadListPrec :: ReadPrec [AutoTuneStatus]
readPrec :: ReadPrec AutoTuneStatus
$creadPrec :: ReadPrec AutoTuneStatus
readList :: ReadS [AutoTuneStatus]
$creadList :: ReadS [AutoTuneStatus]
readsPrec :: Int -> ReadS AutoTuneStatus
$creadsPrec :: Int -> ReadS AutoTuneStatus
Prelude.Read, Int -> AutoTuneStatus -> ShowS
[AutoTuneStatus] -> ShowS
AutoTuneStatus -> String
(Int -> AutoTuneStatus -> ShowS)
-> (AutoTuneStatus -> String)
-> ([AutoTuneStatus] -> ShowS)
-> Show AutoTuneStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoTuneStatus] -> ShowS
$cshowList :: [AutoTuneStatus] -> ShowS
show :: AutoTuneStatus -> String
$cshow :: AutoTuneStatus -> String
showsPrec :: Int -> AutoTuneStatus -> ShowS
$cshowsPrec :: Int -> AutoTuneStatus -> ShowS
Prelude.Show, (forall x. AutoTuneStatus -> Rep AutoTuneStatus x)
-> (forall x. Rep AutoTuneStatus x -> AutoTuneStatus)
-> Generic AutoTuneStatus
forall x. Rep AutoTuneStatus x -> AutoTuneStatus
forall x. AutoTuneStatus -> Rep AutoTuneStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AutoTuneStatus x -> AutoTuneStatus
$cfrom :: forall x. AutoTuneStatus -> Rep AutoTuneStatus x
Prelude.Generic)
newAutoTuneStatus ::
Prelude.UTCTime ->
Prelude.UTCTime ->
AutoTuneState ->
AutoTuneStatus
newAutoTuneStatus :: UTCTime -> UTCTime -> AutoTuneState -> AutoTuneStatus
newAutoTuneStatus UTCTime
pCreationDate_ UTCTime
pUpdateDate_ AutoTuneState
pState_ =
AutoTuneStatus' :: Maybe Bool
-> Maybe Text
-> Maybe Natural
-> POSIX
-> POSIX
-> AutoTuneState
-> AutoTuneStatus
AutoTuneStatus'
{ $sel:pendingDeletion:AutoTuneStatus' :: Maybe Bool
pendingDeletion = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:errorMessage:AutoTuneStatus' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:updateVersion:AutoTuneStatus' :: Maybe Natural
updateVersion = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:creationDate:AutoTuneStatus' :: POSIX
creationDate = 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
pCreationDate_,
$sel:updateDate:AutoTuneStatus' :: POSIX
updateDate = 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
pUpdateDate_,
$sel:state:AutoTuneStatus' :: AutoTuneState
state = AutoTuneState
pState_
}
autoTuneStatus_pendingDeletion :: Lens.Lens' AutoTuneStatus (Prelude.Maybe Prelude.Bool)
autoTuneStatus_pendingDeletion :: (Maybe Bool -> f (Maybe Bool))
-> AutoTuneStatus -> f AutoTuneStatus
autoTuneStatus_pendingDeletion = (AutoTuneStatus -> Maybe Bool)
-> (AutoTuneStatus -> Maybe Bool -> AutoTuneStatus)
-> Lens AutoTuneStatus AutoTuneStatus (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoTuneStatus' {Maybe Bool
pendingDeletion :: Maybe Bool
$sel:pendingDeletion:AutoTuneStatus' :: AutoTuneStatus -> Maybe Bool
pendingDeletion} -> Maybe Bool
pendingDeletion) (\s :: AutoTuneStatus
s@AutoTuneStatus' {} Maybe Bool
a -> AutoTuneStatus
s {$sel:pendingDeletion:AutoTuneStatus' :: Maybe Bool
pendingDeletion = Maybe Bool
a} :: AutoTuneStatus)
autoTuneStatus_errorMessage :: Lens.Lens' AutoTuneStatus (Prelude.Maybe Prelude.Text)
autoTuneStatus_errorMessage :: (Maybe Text -> f (Maybe Text))
-> AutoTuneStatus -> f AutoTuneStatus
autoTuneStatus_errorMessage = (AutoTuneStatus -> Maybe Text)
-> (AutoTuneStatus -> Maybe Text -> AutoTuneStatus)
-> Lens AutoTuneStatus AutoTuneStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoTuneStatus' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:AutoTuneStatus' :: AutoTuneStatus -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: AutoTuneStatus
s@AutoTuneStatus' {} Maybe Text
a -> AutoTuneStatus
s {$sel:errorMessage:AutoTuneStatus' :: Maybe Text
errorMessage = Maybe Text
a} :: AutoTuneStatus)
autoTuneStatus_updateVersion :: Lens.Lens' AutoTuneStatus (Prelude.Maybe Prelude.Natural)
autoTuneStatus_updateVersion :: (Maybe Natural -> f (Maybe Natural))
-> AutoTuneStatus -> f AutoTuneStatus
autoTuneStatus_updateVersion = (AutoTuneStatus -> Maybe Natural)
-> (AutoTuneStatus -> Maybe Natural -> AutoTuneStatus)
-> Lens
AutoTuneStatus AutoTuneStatus (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoTuneStatus' {Maybe Natural
updateVersion :: Maybe Natural
$sel:updateVersion:AutoTuneStatus' :: AutoTuneStatus -> Maybe Natural
updateVersion} -> Maybe Natural
updateVersion) (\s :: AutoTuneStatus
s@AutoTuneStatus' {} Maybe Natural
a -> AutoTuneStatus
s {$sel:updateVersion:AutoTuneStatus' :: Maybe Natural
updateVersion = Maybe Natural
a} :: AutoTuneStatus)
autoTuneStatus_creationDate :: Lens.Lens' AutoTuneStatus Prelude.UTCTime
autoTuneStatus_creationDate :: (UTCTime -> f UTCTime) -> AutoTuneStatus -> f AutoTuneStatus
autoTuneStatus_creationDate = (AutoTuneStatus -> POSIX)
-> (AutoTuneStatus -> POSIX -> AutoTuneStatus)
-> Lens AutoTuneStatus AutoTuneStatus POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoTuneStatus' {POSIX
creationDate :: POSIX
$sel:creationDate:AutoTuneStatus' :: AutoTuneStatus -> POSIX
creationDate} -> POSIX
creationDate) (\s :: AutoTuneStatus
s@AutoTuneStatus' {} POSIX
a -> AutoTuneStatus
s {$sel:creationDate:AutoTuneStatus' :: POSIX
creationDate = POSIX
a} :: AutoTuneStatus) ((POSIX -> f POSIX) -> AutoTuneStatus -> f AutoTuneStatus)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AutoTuneStatus
-> f AutoTuneStatus
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
autoTuneStatus_updateDate :: Lens.Lens' AutoTuneStatus Prelude.UTCTime
autoTuneStatus_updateDate :: (UTCTime -> f UTCTime) -> AutoTuneStatus -> f AutoTuneStatus
autoTuneStatus_updateDate = (AutoTuneStatus -> POSIX)
-> (AutoTuneStatus -> POSIX -> AutoTuneStatus)
-> Lens AutoTuneStatus AutoTuneStatus POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoTuneStatus' {POSIX
updateDate :: POSIX
$sel:updateDate:AutoTuneStatus' :: AutoTuneStatus -> POSIX
updateDate} -> POSIX
updateDate) (\s :: AutoTuneStatus
s@AutoTuneStatus' {} POSIX
a -> AutoTuneStatus
s {$sel:updateDate:AutoTuneStatus' :: POSIX
updateDate = POSIX
a} :: AutoTuneStatus) ((POSIX -> f POSIX) -> AutoTuneStatus -> f AutoTuneStatus)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AutoTuneStatus
-> f AutoTuneStatus
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
autoTuneStatus_state :: Lens.Lens' AutoTuneStatus AutoTuneState
autoTuneStatus_state :: (AutoTuneState -> f AutoTuneState)
-> AutoTuneStatus -> f AutoTuneStatus
autoTuneStatus_state = (AutoTuneStatus -> AutoTuneState)
-> (AutoTuneStatus -> AutoTuneState -> AutoTuneStatus)
-> Lens AutoTuneStatus AutoTuneStatus AutoTuneState AutoTuneState
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoTuneStatus' {AutoTuneState
state :: AutoTuneState
$sel:state:AutoTuneStatus' :: AutoTuneStatus -> AutoTuneState
state} -> AutoTuneState
state) (\s :: AutoTuneStatus
s@AutoTuneStatus' {} AutoTuneState
a -> AutoTuneStatus
s {$sel:state:AutoTuneStatus' :: AutoTuneState
state = AutoTuneState
a} :: AutoTuneStatus)
instance Core.FromJSON AutoTuneStatus where
parseJSON :: Value -> Parser AutoTuneStatus
parseJSON =
String
-> (Object -> Parser AutoTuneStatus)
-> Value
-> Parser AutoTuneStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AutoTuneStatus"
( \Object
x ->
Maybe Bool
-> Maybe Text
-> Maybe Natural
-> POSIX
-> POSIX
-> AutoTuneState
-> AutoTuneStatus
AutoTuneStatus'
(Maybe Bool
-> Maybe Text
-> Maybe Natural
-> POSIX
-> POSIX
-> AutoTuneState
-> AutoTuneStatus)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe Natural
-> POSIX
-> POSIX
-> AutoTuneState
-> AutoTuneStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PendingDeletion")
Parser
(Maybe Text
-> Maybe Natural
-> POSIX
-> POSIX
-> AutoTuneState
-> AutoTuneStatus)
-> Parser (Maybe Text)
-> Parser
(Maybe Natural
-> POSIX -> POSIX -> AutoTuneState -> AutoTuneStatus)
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
"ErrorMessage")
Parser
(Maybe Natural
-> POSIX -> POSIX -> AutoTuneState -> AutoTuneStatus)
-> Parser (Maybe Natural)
-> Parser (POSIX -> POSIX -> AutoTuneState -> AutoTuneStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UpdateVersion")
Parser (POSIX -> POSIX -> AutoTuneState -> AutoTuneStatus)
-> Parser POSIX
-> Parser (POSIX -> AutoTuneState -> AutoTuneStatus)
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
"CreationDate")
Parser (POSIX -> AutoTuneState -> AutoTuneStatus)
-> Parser POSIX -> Parser (AutoTuneState -> AutoTuneStatus)
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
"UpdateDate")
Parser (AutoTuneState -> AutoTuneStatus)
-> Parser AutoTuneState -> Parser AutoTuneStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AutoTuneState
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"State")
)
instance Prelude.Hashable AutoTuneStatus
instance Prelude.NFData AutoTuneStatus