{-# 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.NetworkFirewall.Types.PerObjectStatus where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.NetworkFirewall.Types.PerObjectSyncStatus
import qualified Amazonka.Prelude as Prelude
data PerObjectStatus = PerObjectStatus'
{
PerObjectStatus -> Maybe Text
updateToken :: Prelude.Maybe Prelude.Text,
PerObjectStatus -> Maybe PerObjectSyncStatus
syncStatus :: Prelude.Maybe PerObjectSyncStatus
}
deriving (PerObjectStatus -> PerObjectStatus -> Bool
(PerObjectStatus -> PerObjectStatus -> Bool)
-> (PerObjectStatus -> PerObjectStatus -> Bool)
-> Eq PerObjectStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PerObjectStatus -> PerObjectStatus -> Bool
$c/= :: PerObjectStatus -> PerObjectStatus -> Bool
== :: PerObjectStatus -> PerObjectStatus -> Bool
$c== :: PerObjectStatus -> PerObjectStatus -> Bool
Prelude.Eq, ReadPrec [PerObjectStatus]
ReadPrec PerObjectStatus
Int -> ReadS PerObjectStatus
ReadS [PerObjectStatus]
(Int -> ReadS PerObjectStatus)
-> ReadS [PerObjectStatus]
-> ReadPrec PerObjectStatus
-> ReadPrec [PerObjectStatus]
-> Read PerObjectStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PerObjectStatus]
$creadListPrec :: ReadPrec [PerObjectStatus]
readPrec :: ReadPrec PerObjectStatus
$creadPrec :: ReadPrec PerObjectStatus
readList :: ReadS [PerObjectStatus]
$creadList :: ReadS [PerObjectStatus]
readsPrec :: Int -> ReadS PerObjectStatus
$creadsPrec :: Int -> ReadS PerObjectStatus
Prelude.Read, Int -> PerObjectStatus -> ShowS
[PerObjectStatus] -> ShowS
PerObjectStatus -> String
(Int -> PerObjectStatus -> ShowS)
-> (PerObjectStatus -> String)
-> ([PerObjectStatus] -> ShowS)
-> Show PerObjectStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PerObjectStatus] -> ShowS
$cshowList :: [PerObjectStatus] -> ShowS
show :: PerObjectStatus -> String
$cshow :: PerObjectStatus -> String
showsPrec :: Int -> PerObjectStatus -> ShowS
$cshowsPrec :: Int -> PerObjectStatus -> ShowS
Prelude.Show, (forall x. PerObjectStatus -> Rep PerObjectStatus x)
-> (forall x. Rep PerObjectStatus x -> PerObjectStatus)
-> Generic PerObjectStatus
forall x. Rep PerObjectStatus x -> PerObjectStatus
forall x. PerObjectStatus -> Rep PerObjectStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PerObjectStatus x -> PerObjectStatus
$cfrom :: forall x. PerObjectStatus -> Rep PerObjectStatus x
Prelude.Generic)
newPerObjectStatus ::
PerObjectStatus
newPerObjectStatus :: PerObjectStatus
newPerObjectStatus =
PerObjectStatus' :: Maybe Text -> Maybe PerObjectSyncStatus -> PerObjectStatus
PerObjectStatus'
{ $sel:updateToken:PerObjectStatus' :: Maybe Text
updateToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:syncStatus:PerObjectStatus' :: Maybe PerObjectSyncStatus
syncStatus = Maybe PerObjectSyncStatus
forall a. Maybe a
Prelude.Nothing
}
perObjectStatus_updateToken :: Lens.Lens' PerObjectStatus (Prelude.Maybe Prelude.Text)
perObjectStatus_updateToken :: (Maybe Text -> f (Maybe Text))
-> PerObjectStatus -> f PerObjectStatus
perObjectStatus_updateToken = (PerObjectStatus -> Maybe Text)
-> (PerObjectStatus -> Maybe Text -> PerObjectStatus)
-> Lens PerObjectStatus PerObjectStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PerObjectStatus' {Maybe Text
updateToken :: Maybe Text
$sel:updateToken:PerObjectStatus' :: PerObjectStatus -> Maybe Text
updateToken} -> Maybe Text
updateToken) (\s :: PerObjectStatus
s@PerObjectStatus' {} Maybe Text
a -> PerObjectStatus
s {$sel:updateToken:PerObjectStatus' :: Maybe Text
updateToken = Maybe Text
a} :: PerObjectStatus)
perObjectStatus_syncStatus :: Lens.Lens' PerObjectStatus (Prelude.Maybe PerObjectSyncStatus)
perObjectStatus_syncStatus :: (Maybe PerObjectSyncStatus -> f (Maybe PerObjectSyncStatus))
-> PerObjectStatus -> f PerObjectStatus
perObjectStatus_syncStatus = (PerObjectStatus -> Maybe PerObjectSyncStatus)
-> (PerObjectStatus
-> Maybe PerObjectSyncStatus -> PerObjectStatus)
-> Lens
PerObjectStatus
PerObjectStatus
(Maybe PerObjectSyncStatus)
(Maybe PerObjectSyncStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PerObjectStatus' {Maybe PerObjectSyncStatus
syncStatus :: Maybe PerObjectSyncStatus
$sel:syncStatus:PerObjectStatus' :: PerObjectStatus -> Maybe PerObjectSyncStatus
syncStatus} -> Maybe PerObjectSyncStatus
syncStatus) (\s :: PerObjectStatus
s@PerObjectStatus' {} Maybe PerObjectSyncStatus
a -> PerObjectStatus
s {$sel:syncStatus:PerObjectStatus' :: Maybe PerObjectSyncStatus
syncStatus = Maybe PerObjectSyncStatus
a} :: PerObjectStatus)
instance Core.FromJSON PerObjectStatus where
parseJSON :: Value -> Parser PerObjectStatus
parseJSON =
String
-> (Object -> Parser PerObjectStatus)
-> Value
-> Parser PerObjectStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PerObjectStatus"
( \Object
x ->
Maybe Text -> Maybe PerObjectSyncStatus -> PerObjectStatus
PerObjectStatus'
(Maybe Text -> Maybe PerObjectSyncStatus -> PerObjectStatus)
-> Parser (Maybe Text)
-> Parser (Maybe PerObjectSyncStatus -> PerObjectStatus)
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
"UpdateToken")
Parser (Maybe PerObjectSyncStatus -> PerObjectStatus)
-> Parser (Maybe PerObjectSyncStatus) -> Parser PerObjectStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PerObjectSyncStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SyncStatus")
)
instance Prelude.Hashable PerObjectStatus
instance Prelude.NFData PerObjectStatus