{-# 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.CloudSearch.Types.OptionStatus where
import Amazonka.CloudSearch.Types.OptionState
import qualified Amazonka.Core as Core
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 -> ISO8601
creationDate :: Core.ISO8601,
OptionStatus -> ISO8601
updateDate :: Core.ISO8601,
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
-> ISO8601
-> ISO8601
-> 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' :: ISO8601
creationDate = Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601))
-> UTCTime -> ISO8601
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationDate_,
$sel:updateDate:OptionStatus' :: ISO8601
updateDate = Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601))
-> UTCTime -> ISO8601
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 -> ISO8601)
-> (OptionStatus -> ISO8601 -> OptionStatus)
-> Lens OptionStatus OptionStatus ISO8601 ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OptionStatus' {ISO8601
creationDate :: ISO8601
$sel:creationDate:OptionStatus' :: OptionStatus -> ISO8601
creationDate} -> ISO8601
creationDate) (\s :: OptionStatus
s@OptionStatus' {} ISO8601
a -> OptionStatus
s {$sel:creationDate:OptionStatus' :: ISO8601
creationDate = ISO8601
a} :: OptionStatus) ((ISO8601 -> f ISO8601) -> OptionStatus -> f OptionStatus)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> OptionStatus
-> f OptionStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601
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 -> ISO8601)
-> (OptionStatus -> ISO8601 -> OptionStatus)
-> Lens OptionStatus OptionStatus ISO8601 ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OptionStatus' {ISO8601
updateDate :: ISO8601
$sel:updateDate:OptionStatus' :: OptionStatus -> ISO8601
updateDate} -> ISO8601
updateDate) (\s :: OptionStatus
s@OptionStatus' {} ISO8601
a -> OptionStatus
s {$sel:updateDate:OptionStatus' :: ISO8601
updateDate = ISO8601
a} :: OptionStatus) ((ISO8601 -> f ISO8601) -> OptionStatus -> f OptionStatus)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> OptionStatus
-> f OptionStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601
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.FromXML OptionStatus where
parseXML :: [Node] -> Either String OptionStatus
parseXML [Node]
x =
Maybe Bool
-> Maybe Natural
-> ISO8601
-> ISO8601
-> OptionState
-> OptionStatus
OptionStatus'
(Maybe Bool
-> Maybe Natural
-> ISO8601
-> ISO8601
-> OptionState
-> OptionStatus)
-> Either String (Maybe Bool)
-> Either
String
(Maybe Natural
-> ISO8601 -> ISO8601 -> OptionState -> OptionStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PendingDeletion")
Either
String
(Maybe Natural
-> ISO8601 -> ISO8601 -> OptionState -> OptionStatus)
-> Either String (Maybe Natural)
-> Either
String (ISO8601 -> ISO8601 -> OptionState -> OptionStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"UpdateVersion")
Either String (ISO8601 -> ISO8601 -> OptionState -> OptionStatus)
-> Either String ISO8601
-> Either String (ISO8601 -> OptionState -> OptionStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ISO8601
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"CreationDate")
Either String (ISO8601 -> OptionState -> OptionStatus)
-> Either String ISO8601
-> Either String (OptionState -> OptionStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ISO8601
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"UpdateDate")
Either String (OptionState -> OptionStatus)
-> Either String OptionState -> Either String OptionStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String OptionState
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"State")
instance Prelude.Hashable OptionStatus
instance Prelude.NFData OptionStatus