{-# 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.GlobalAccelerator.Types.ByoipCidrEvent where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ByoipCidrEvent = ByoipCidrEvent'
{
ByoipCidrEvent -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
ByoipCidrEvent -> Maybe POSIX
timestamp :: Prelude.Maybe Core.POSIX
}
deriving (ByoipCidrEvent -> ByoipCidrEvent -> Bool
(ByoipCidrEvent -> ByoipCidrEvent -> Bool)
-> (ByoipCidrEvent -> ByoipCidrEvent -> Bool) -> Eq ByoipCidrEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ByoipCidrEvent -> ByoipCidrEvent -> Bool
$c/= :: ByoipCidrEvent -> ByoipCidrEvent -> Bool
== :: ByoipCidrEvent -> ByoipCidrEvent -> Bool
$c== :: ByoipCidrEvent -> ByoipCidrEvent -> Bool
Prelude.Eq, ReadPrec [ByoipCidrEvent]
ReadPrec ByoipCidrEvent
Int -> ReadS ByoipCidrEvent
ReadS [ByoipCidrEvent]
(Int -> ReadS ByoipCidrEvent)
-> ReadS [ByoipCidrEvent]
-> ReadPrec ByoipCidrEvent
-> ReadPrec [ByoipCidrEvent]
-> Read ByoipCidrEvent
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ByoipCidrEvent]
$creadListPrec :: ReadPrec [ByoipCidrEvent]
readPrec :: ReadPrec ByoipCidrEvent
$creadPrec :: ReadPrec ByoipCidrEvent
readList :: ReadS [ByoipCidrEvent]
$creadList :: ReadS [ByoipCidrEvent]
readsPrec :: Int -> ReadS ByoipCidrEvent
$creadsPrec :: Int -> ReadS ByoipCidrEvent
Prelude.Read, Int -> ByoipCidrEvent -> ShowS
[ByoipCidrEvent] -> ShowS
ByoipCidrEvent -> String
(Int -> ByoipCidrEvent -> ShowS)
-> (ByoipCidrEvent -> String)
-> ([ByoipCidrEvent] -> ShowS)
-> Show ByoipCidrEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ByoipCidrEvent] -> ShowS
$cshowList :: [ByoipCidrEvent] -> ShowS
show :: ByoipCidrEvent -> String
$cshow :: ByoipCidrEvent -> String
showsPrec :: Int -> ByoipCidrEvent -> ShowS
$cshowsPrec :: Int -> ByoipCidrEvent -> ShowS
Prelude.Show, (forall x. ByoipCidrEvent -> Rep ByoipCidrEvent x)
-> (forall x. Rep ByoipCidrEvent x -> ByoipCidrEvent)
-> Generic ByoipCidrEvent
forall x. Rep ByoipCidrEvent x -> ByoipCidrEvent
forall x. ByoipCidrEvent -> Rep ByoipCidrEvent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ByoipCidrEvent x -> ByoipCidrEvent
$cfrom :: forall x. ByoipCidrEvent -> Rep ByoipCidrEvent x
Prelude.Generic)
newByoipCidrEvent ::
ByoipCidrEvent
newByoipCidrEvent :: ByoipCidrEvent
newByoipCidrEvent =
ByoipCidrEvent' :: Maybe Text -> Maybe POSIX -> ByoipCidrEvent
ByoipCidrEvent'
{ $sel:message:ByoipCidrEvent' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:timestamp:ByoipCidrEvent' :: Maybe POSIX
timestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
byoipCidrEvent_message :: Lens.Lens' ByoipCidrEvent (Prelude.Maybe Prelude.Text)
byoipCidrEvent_message :: (Maybe Text -> f (Maybe Text))
-> ByoipCidrEvent -> f ByoipCidrEvent
byoipCidrEvent_message = (ByoipCidrEvent -> Maybe Text)
-> (ByoipCidrEvent -> Maybe Text -> ByoipCidrEvent)
-> Lens ByoipCidrEvent ByoipCidrEvent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ByoipCidrEvent' {Maybe Text
message :: Maybe Text
$sel:message:ByoipCidrEvent' :: ByoipCidrEvent -> Maybe Text
message} -> Maybe Text
message) (\s :: ByoipCidrEvent
s@ByoipCidrEvent' {} Maybe Text
a -> ByoipCidrEvent
s {$sel:message:ByoipCidrEvent' :: Maybe Text
message = Maybe Text
a} :: ByoipCidrEvent)
byoipCidrEvent_timestamp :: Lens.Lens' ByoipCidrEvent (Prelude.Maybe Prelude.UTCTime)
byoipCidrEvent_timestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ByoipCidrEvent -> f ByoipCidrEvent
byoipCidrEvent_timestamp = (ByoipCidrEvent -> Maybe POSIX)
-> (ByoipCidrEvent -> Maybe POSIX -> ByoipCidrEvent)
-> Lens ByoipCidrEvent ByoipCidrEvent (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ByoipCidrEvent' {Maybe POSIX
timestamp :: Maybe POSIX
$sel:timestamp:ByoipCidrEvent' :: ByoipCidrEvent -> Maybe POSIX
timestamp} -> Maybe POSIX
timestamp) (\s :: ByoipCidrEvent
s@ByoipCidrEvent' {} Maybe POSIX
a -> ByoipCidrEvent
s {$sel:timestamp:ByoipCidrEvent' :: Maybe POSIX
timestamp = Maybe POSIX
a} :: ByoipCidrEvent) ((Maybe POSIX -> f (Maybe POSIX))
-> ByoipCidrEvent -> f ByoipCidrEvent)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ByoipCidrEvent
-> f ByoipCidrEvent
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
instance Core.FromJSON ByoipCidrEvent where
parseJSON :: Value -> Parser ByoipCidrEvent
parseJSON =
String
-> (Object -> Parser ByoipCidrEvent)
-> Value
-> Parser ByoipCidrEvent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ByoipCidrEvent"
( \Object
x ->
Maybe Text -> Maybe POSIX -> ByoipCidrEvent
ByoipCidrEvent'
(Maybe Text -> Maybe POSIX -> ByoipCidrEvent)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> ByoipCidrEvent)
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
"Message")
Parser (Maybe POSIX -> ByoipCidrEvent)
-> Parser (Maybe POSIX) -> Parser ByoipCidrEvent
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
"Timestamp")
)
instance Prelude.Hashable ByoipCidrEvent
instance Prelude.NFData ByoipCidrEvent