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