{-# 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.CloudWatchEvents.Types.PartnerEventSourceAccount where
import Amazonka.CloudWatchEvents.Types.EventSourceState
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PartnerEventSourceAccount = PartnerEventSourceAccount'
{
PartnerEventSourceAccount -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
PartnerEventSourceAccount -> Maybe EventSourceState
state :: Prelude.Maybe EventSourceState,
PartnerEventSourceAccount -> Maybe Text
account :: Prelude.Maybe Prelude.Text,
PartnerEventSourceAccount -> Maybe POSIX
expirationTime :: Prelude.Maybe Core.POSIX
}
deriving (PartnerEventSourceAccount -> PartnerEventSourceAccount -> Bool
(PartnerEventSourceAccount -> PartnerEventSourceAccount -> Bool)
-> (PartnerEventSourceAccount -> PartnerEventSourceAccount -> Bool)
-> Eq PartnerEventSourceAccount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PartnerEventSourceAccount -> PartnerEventSourceAccount -> Bool
$c/= :: PartnerEventSourceAccount -> PartnerEventSourceAccount -> Bool
== :: PartnerEventSourceAccount -> PartnerEventSourceAccount -> Bool
$c== :: PartnerEventSourceAccount -> PartnerEventSourceAccount -> Bool
Prelude.Eq, ReadPrec [PartnerEventSourceAccount]
ReadPrec PartnerEventSourceAccount
Int -> ReadS PartnerEventSourceAccount
ReadS [PartnerEventSourceAccount]
(Int -> ReadS PartnerEventSourceAccount)
-> ReadS [PartnerEventSourceAccount]
-> ReadPrec PartnerEventSourceAccount
-> ReadPrec [PartnerEventSourceAccount]
-> Read PartnerEventSourceAccount
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PartnerEventSourceAccount]
$creadListPrec :: ReadPrec [PartnerEventSourceAccount]
readPrec :: ReadPrec PartnerEventSourceAccount
$creadPrec :: ReadPrec PartnerEventSourceAccount
readList :: ReadS [PartnerEventSourceAccount]
$creadList :: ReadS [PartnerEventSourceAccount]
readsPrec :: Int -> ReadS PartnerEventSourceAccount
$creadsPrec :: Int -> ReadS PartnerEventSourceAccount
Prelude.Read, Int -> PartnerEventSourceAccount -> ShowS
[PartnerEventSourceAccount] -> ShowS
PartnerEventSourceAccount -> String
(Int -> PartnerEventSourceAccount -> ShowS)
-> (PartnerEventSourceAccount -> String)
-> ([PartnerEventSourceAccount] -> ShowS)
-> Show PartnerEventSourceAccount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PartnerEventSourceAccount] -> ShowS
$cshowList :: [PartnerEventSourceAccount] -> ShowS
show :: PartnerEventSourceAccount -> String
$cshow :: PartnerEventSourceAccount -> String
showsPrec :: Int -> PartnerEventSourceAccount -> ShowS
$cshowsPrec :: Int -> PartnerEventSourceAccount -> ShowS
Prelude.Show, (forall x.
PartnerEventSourceAccount -> Rep PartnerEventSourceAccount x)
-> (forall x.
Rep PartnerEventSourceAccount x -> PartnerEventSourceAccount)
-> Generic PartnerEventSourceAccount
forall x.
Rep PartnerEventSourceAccount x -> PartnerEventSourceAccount
forall x.
PartnerEventSourceAccount -> Rep PartnerEventSourceAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PartnerEventSourceAccount x -> PartnerEventSourceAccount
$cfrom :: forall x.
PartnerEventSourceAccount -> Rep PartnerEventSourceAccount x
Prelude.Generic)
newPartnerEventSourceAccount ::
PartnerEventSourceAccount
newPartnerEventSourceAccount :: PartnerEventSourceAccount
newPartnerEventSourceAccount =
PartnerEventSourceAccount' :: Maybe POSIX
-> Maybe EventSourceState
-> Maybe Text
-> Maybe POSIX
-> PartnerEventSourceAccount
PartnerEventSourceAccount'
{ $sel:creationTime:PartnerEventSourceAccount' :: Maybe POSIX
creationTime =
Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:state:PartnerEventSourceAccount' :: Maybe EventSourceState
state = Maybe EventSourceState
forall a. Maybe a
Prelude.Nothing,
$sel:account:PartnerEventSourceAccount' :: Maybe Text
account = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:expirationTime:PartnerEventSourceAccount' :: Maybe POSIX
expirationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
partnerEventSourceAccount_creationTime :: Lens.Lens' PartnerEventSourceAccount (Prelude.Maybe Prelude.UTCTime)
partnerEventSourceAccount_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PartnerEventSourceAccount -> f PartnerEventSourceAccount
partnerEventSourceAccount_creationTime = (PartnerEventSourceAccount -> Maybe POSIX)
-> (PartnerEventSourceAccount
-> Maybe POSIX -> PartnerEventSourceAccount)
-> Lens
PartnerEventSourceAccount
PartnerEventSourceAccount
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartnerEventSourceAccount' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:PartnerEventSourceAccount' :: PartnerEventSourceAccount -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: PartnerEventSourceAccount
s@PartnerEventSourceAccount' {} Maybe POSIX
a -> PartnerEventSourceAccount
s {$sel:creationTime:PartnerEventSourceAccount' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: PartnerEventSourceAccount) ((Maybe POSIX -> f (Maybe POSIX))
-> PartnerEventSourceAccount -> f PartnerEventSourceAccount)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PartnerEventSourceAccount
-> f PartnerEventSourceAccount
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
partnerEventSourceAccount_state :: Lens.Lens' PartnerEventSourceAccount (Prelude.Maybe EventSourceState)
partnerEventSourceAccount_state :: (Maybe EventSourceState -> f (Maybe EventSourceState))
-> PartnerEventSourceAccount -> f PartnerEventSourceAccount
partnerEventSourceAccount_state = (PartnerEventSourceAccount -> Maybe EventSourceState)
-> (PartnerEventSourceAccount
-> Maybe EventSourceState -> PartnerEventSourceAccount)
-> Lens
PartnerEventSourceAccount
PartnerEventSourceAccount
(Maybe EventSourceState)
(Maybe EventSourceState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartnerEventSourceAccount' {Maybe EventSourceState
state :: Maybe EventSourceState
$sel:state:PartnerEventSourceAccount' :: PartnerEventSourceAccount -> Maybe EventSourceState
state} -> Maybe EventSourceState
state) (\s :: PartnerEventSourceAccount
s@PartnerEventSourceAccount' {} Maybe EventSourceState
a -> PartnerEventSourceAccount
s {$sel:state:PartnerEventSourceAccount' :: Maybe EventSourceState
state = Maybe EventSourceState
a} :: PartnerEventSourceAccount)
partnerEventSourceAccount_account :: Lens.Lens' PartnerEventSourceAccount (Prelude.Maybe Prelude.Text)
partnerEventSourceAccount_account :: (Maybe Text -> f (Maybe Text))
-> PartnerEventSourceAccount -> f PartnerEventSourceAccount
partnerEventSourceAccount_account = (PartnerEventSourceAccount -> Maybe Text)
-> (PartnerEventSourceAccount
-> Maybe Text -> PartnerEventSourceAccount)
-> Lens
PartnerEventSourceAccount
PartnerEventSourceAccount
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartnerEventSourceAccount' {Maybe Text
account :: Maybe Text
$sel:account:PartnerEventSourceAccount' :: PartnerEventSourceAccount -> Maybe Text
account} -> Maybe Text
account) (\s :: PartnerEventSourceAccount
s@PartnerEventSourceAccount' {} Maybe Text
a -> PartnerEventSourceAccount
s {$sel:account:PartnerEventSourceAccount' :: Maybe Text
account = Maybe Text
a} :: PartnerEventSourceAccount)
partnerEventSourceAccount_expirationTime :: Lens.Lens' PartnerEventSourceAccount (Prelude.Maybe Prelude.UTCTime)
partnerEventSourceAccount_expirationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PartnerEventSourceAccount -> f PartnerEventSourceAccount
partnerEventSourceAccount_expirationTime = (PartnerEventSourceAccount -> Maybe POSIX)
-> (PartnerEventSourceAccount
-> Maybe POSIX -> PartnerEventSourceAccount)
-> Lens
PartnerEventSourceAccount
PartnerEventSourceAccount
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartnerEventSourceAccount' {Maybe POSIX
expirationTime :: Maybe POSIX
$sel:expirationTime:PartnerEventSourceAccount' :: PartnerEventSourceAccount -> Maybe POSIX
expirationTime} -> Maybe POSIX
expirationTime) (\s :: PartnerEventSourceAccount
s@PartnerEventSourceAccount' {} Maybe POSIX
a -> PartnerEventSourceAccount
s {$sel:expirationTime:PartnerEventSourceAccount' :: Maybe POSIX
expirationTime = Maybe POSIX
a} :: PartnerEventSourceAccount) ((Maybe POSIX -> f (Maybe POSIX))
-> PartnerEventSourceAccount -> f PartnerEventSourceAccount)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PartnerEventSourceAccount
-> f PartnerEventSourceAccount
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 PartnerEventSourceAccount where
parseJSON :: Value -> Parser PartnerEventSourceAccount
parseJSON =
String
-> (Object -> Parser PartnerEventSourceAccount)
-> Value
-> Parser PartnerEventSourceAccount
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PartnerEventSourceAccount"
( \Object
x ->
Maybe POSIX
-> Maybe EventSourceState
-> Maybe Text
-> Maybe POSIX
-> PartnerEventSourceAccount
PartnerEventSourceAccount'
(Maybe POSIX
-> Maybe EventSourceState
-> Maybe Text
-> Maybe POSIX
-> PartnerEventSourceAccount)
-> Parser (Maybe POSIX)
-> Parser
(Maybe EventSourceState
-> Maybe Text -> Maybe POSIX -> PartnerEventSourceAccount)
forall (f :: * -> *) a b. Functor 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
"CreationTime")
Parser
(Maybe EventSourceState
-> Maybe Text -> Maybe POSIX -> PartnerEventSourceAccount)
-> Parser (Maybe EventSourceState)
-> Parser (Maybe Text -> Maybe POSIX -> PartnerEventSourceAccount)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EventSourceState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
Parser (Maybe Text -> Maybe POSIX -> PartnerEventSourceAccount)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> PartnerEventSourceAccount)
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
"Account")
Parser (Maybe POSIX -> PartnerEventSourceAccount)
-> Parser (Maybe POSIX) -> Parser PartnerEventSourceAccount
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
"ExpirationTime")
)
instance Prelude.Hashable PartnerEventSourceAccount
instance Prelude.NFData PartnerEventSourceAccount