{-# 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.CloudTrail.Types.EventDataStore where
import Amazonka.CloudTrail.Types.AdvancedEventSelector
import Amazonka.CloudTrail.Types.EventDataStoreStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data EventDataStore = EventDataStore'
{
EventDataStore -> Maybe [AdvancedEventSelector]
advancedEventSelectors :: Prelude.Maybe [AdvancedEventSelector],
EventDataStore -> Maybe POSIX
createdTimestamp :: Prelude.Maybe Data.POSIX,
EventDataStore -> Maybe Text
eventDataStoreArn :: Prelude.Maybe Prelude.Text,
EventDataStore -> Maybe Bool
multiRegionEnabled :: Prelude.Maybe Prelude.Bool,
EventDataStore -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
EventDataStore -> Maybe Bool
organizationEnabled :: Prelude.Maybe Prelude.Bool,
EventDataStore -> Maybe Natural
retentionPeriod :: Prelude.Maybe Prelude.Natural,
EventDataStore -> Maybe EventDataStoreStatus
status :: Prelude.Maybe EventDataStoreStatus,
EventDataStore -> Maybe Bool
terminationProtectionEnabled :: Prelude.Maybe Prelude.Bool,
EventDataStore -> Maybe POSIX
updatedTimestamp :: Prelude.Maybe Data.POSIX
}
deriving (EventDataStore -> EventDataStore -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventDataStore -> EventDataStore -> Bool
$c/= :: EventDataStore -> EventDataStore -> Bool
== :: EventDataStore -> EventDataStore -> Bool
$c== :: EventDataStore -> EventDataStore -> Bool
Prelude.Eq, ReadPrec [EventDataStore]
ReadPrec EventDataStore
Int -> ReadS EventDataStore
ReadS [EventDataStore]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EventDataStore]
$creadListPrec :: ReadPrec [EventDataStore]
readPrec :: ReadPrec EventDataStore
$creadPrec :: ReadPrec EventDataStore
readList :: ReadS [EventDataStore]
$creadList :: ReadS [EventDataStore]
readsPrec :: Int -> ReadS EventDataStore
$creadsPrec :: Int -> ReadS EventDataStore
Prelude.Read, Int -> EventDataStore -> ShowS
[EventDataStore] -> ShowS
EventDataStore -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EventDataStore] -> ShowS
$cshowList :: [EventDataStore] -> ShowS
show :: EventDataStore -> String
$cshow :: EventDataStore -> String
showsPrec :: Int -> EventDataStore -> ShowS
$cshowsPrec :: Int -> EventDataStore -> ShowS
Prelude.Show, forall x. Rep EventDataStore x -> EventDataStore
forall x. EventDataStore -> Rep EventDataStore x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EventDataStore x -> EventDataStore
$cfrom :: forall x. EventDataStore -> Rep EventDataStore x
Prelude.Generic)
newEventDataStore ::
EventDataStore
newEventDataStore :: EventDataStore
newEventDataStore =
EventDataStore'
{ $sel:advancedEventSelectors:EventDataStore' :: Maybe [AdvancedEventSelector]
advancedEventSelectors =
forall a. Maybe a
Prelude.Nothing,
$sel:createdTimestamp:EventDataStore' :: Maybe POSIX
createdTimestamp = forall a. Maybe a
Prelude.Nothing,
$sel:eventDataStoreArn:EventDataStore' :: Maybe Text
eventDataStoreArn = forall a. Maybe a
Prelude.Nothing,
$sel:multiRegionEnabled:EventDataStore' :: Maybe Bool
multiRegionEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:name:EventDataStore' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:organizationEnabled:EventDataStore' :: Maybe Bool
organizationEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:retentionPeriod:EventDataStore' :: Maybe Natural
retentionPeriod = forall a. Maybe a
Prelude.Nothing,
$sel:status:EventDataStore' :: Maybe EventDataStoreStatus
status = forall a. Maybe a
Prelude.Nothing,
$sel:terminationProtectionEnabled:EventDataStore' :: Maybe Bool
terminationProtectionEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:updatedTimestamp:EventDataStore' :: Maybe POSIX
updatedTimestamp = forall a. Maybe a
Prelude.Nothing
}
eventDataStore_advancedEventSelectors :: Lens.Lens' EventDataStore (Prelude.Maybe [AdvancedEventSelector])
eventDataStore_advancedEventSelectors :: Lens' EventDataStore (Maybe [AdvancedEventSelector])
eventDataStore_advancedEventSelectors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDataStore' {Maybe [AdvancedEventSelector]
advancedEventSelectors :: Maybe [AdvancedEventSelector]
$sel:advancedEventSelectors:EventDataStore' :: EventDataStore -> Maybe [AdvancedEventSelector]
advancedEventSelectors} -> Maybe [AdvancedEventSelector]
advancedEventSelectors) (\s :: EventDataStore
s@EventDataStore' {} Maybe [AdvancedEventSelector]
a -> EventDataStore
s {$sel:advancedEventSelectors:EventDataStore' :: Maybe [AdvancedEventSelector]
advancedEventSelectors = Maybe [AdvancedEventSelector]
a} :: EventDataStore) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
eventDataStore_createdTimestamp :: Lens.Lens' EventDataStore (Prelude.Maybe Prelude.UTCTime)
eventDataStore_createdTimestamp :: Lens' EventDataStore (Maybe UTCTime)
eventDataStore_createdTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDataStore' {Maybe POSIX
createdTimestamp :: Maybe POSIX
$sel:createdTimestamp:EventDataStore' :: EventDataStore -> Maybe POSIX
createdTimestamp} -> Maybe POSIX
createdTimestamp) (\s :: EventDataStore
s@EventDataStore' {} Maybe POSIX
a -> EventDataStore
s {$sel:createdTimestamp:EventDataStore' :: Maybe POSIX
createdTimestamp = Maybe POSIX
a} :: EventDataStore) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
eventDataStore_eventDataStoreArn :: Lens.Lens' EventDataStore (Prelude.Maybe Prelude.Text)
eventDataStore_eventDataStoreArn :: Lens' EventDataStore (Maybe Text)
eventDataStore_eventDataStoreArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDataStore' {Maybe Text
eventDataStoreArn :: Maybe Text
$sel:eventDataStoreArn:EventDataStore' :: EventDataStore -> Maybe Text
eventDataStoreArn} -> Maybe Text
eventDataStoreArn) (\s :: EventDataStore
s@EventDataStore' {} Maybe Text
a -> EventDataStore
s {$sel:eventDataStoreArn:EventDataStore' :: Maybe Text
eventDataStoreArn = Maybe Text
a} :: EventDataStore)
eventDataStore_multiRegionEnabled :: Lens.Lens' EventDataStore (Prelude.Maybe Prelude.Bool)
eventDataStore_multiRegionEnabled :: Lens' EventDataStore (Maybe Bool)
eventDataStore_multiRegionEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDataStore' {Maybe Bool
multiRegionEnabled :: Maybe Bool
$sel:multiRegionEnabled:EventDataStore' :: EventDataStore -> Maybe Bool
multiRegionEnabled} -> Maybe Bool
multiRegionEnabled) (\s :: EventDataStore
s@EventDataStore' {} Maybe Bool
a -> EventDataStore
s {$sel:multiRegionEnabled:EventDataStore' :: Maybe Bool
multiRegionEnabled = Maybe Bool
a} :: EventDataStore)
eventDataStore_name :: Lens.Lens' EventDataStore (Prelude.Maybe Prelude.Text)
eventDataStore_name :: Lens' EventDataStore (Maybe Text)
eventDataStore_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDataStore' {Maybe Text
name :: Maybe Text
$sel:name:EventDataStore' :: EventDataStore -> Maybe Text
name} -> Maybe Text
name) (\s :: EventDataStore
s@EventDataStore' {} Maybe Text
a -> EventDataStore
s {$sel:name:EventDataStore' :: Maybe Text
name = Maybe Text
a} :: EventDataStore)
eventDataStore_organizationEnabled :: Lens.Lens' EventDataStore (Prelude.Maybe Prelude.Bool)
eventDataStore_organizationEnabled :: Lens' EventDataStore (Maybe Bool)
eventDataStore_organizationEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDataStore' {Maybe Bool
organizationEnabled :: Maybe Bool
$sel:organizationEnabled:EventDataStore' :: EventDataStore -> Maybe Bool
organizationEnabled} -> Maybe Bool
organizationEnabled) (\s :: EventDataStore
s@EventDataStore' {} Maybe Bool
a -> EventDataStore
s {$sel:organizationEnabled:EventDataStore' :: Maybe Bool
organizationEnabled = Maybe Bool
a} :: EventDataStore)
eventDataStore_retentionPeriod :: Lens.Lens' EventDataStore (Prelude.Maybe Prelude.Natural)
eventDataStore_retentionPeriod :: Lens' EventDataStore (Maybe Natural)
eventDataStore_retentionPeriod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDataStore' {Maybe Natural
retentionPeriod :: Maybe Natural
$sel:retentionPeriod:EventDataStore' :: EventDataStore -> Maybe Natural
retentionPeriod} -> Maybe Natural
retentionPeriod) (\s :: EventDataStore
s@EventDataStore' {} Maybe Natural
a -> EventDataStore
s {$sel:retentionPeriod:EventDataStore' :: Maybe Natural
retentionPeriod = Maybe Natural
a} :: EventDataStore)
eventDataStore_status :: Lens.Lens' EventDataStore (Prelude.Maybe EventDataStoreStatus)
eventDataStore_status :: Lens' EventDataStore (Maybe EventDataStoreStatus)
eventDataStore_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDataStore' {Maybe EventDataStoreStatus
status :: Maybe EventDataStoreStatus
$sel:status:EventDataStore' :: EventDataStore -> Maybe EventDataStoreStatus
status} -> Maybe EventDataStoreStatus
status) (\s :: EventDataStore
s@EventDataStore' {} Maybe EventDataStoreStatus
a -> EventDataStore
s {$sel:status:EventDataStore' :: Maybe EventDataStoreStatus
status = Maybe EventDataStoreStatus
a} :: EventDataStore)
eventDataStore_terminationProtectionEnabled :: Lens.Lens' EventDataStore (Prelude.Maybe Prelude.Bool)
eventDataStore_terminationProtectionEnabled :: Lens' EventDataStore (Maybe Bool)
eventDataStore_terminationProtectionEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDataStore' {Maybe Bool
terminationProtectionEnabled :: Maybe Bool
$sel:terminationProtectionEnabled:EventDataStore' :: EventDataStore -> Maybe Bool
terminationProtectionEnabled} -> Maybe Bool
terminationProtectionEnabled) (\s :: EventDataStore
s@EventDataStore' {} Maybe Bool
a -> EventDataStore
s {$sel:terminationProtectionEnabled:EventDataStore' :: Maybe Bool
terminationProtectionEnabled = Maybe Bool
a} :: EventDataStore)
eventDataStore_updatedTimestamp :: Lens.Lens' EventDataStore (Prelude.Maybe Prelude.UTCTime)
eventDataStore_updatedTimestamp :: Lens' EventDataStore (Maybe UTCTime)
eventDataStore_updatedTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventDataStore' {Maybe POSIX
updatedTimestamp :: Maybe POSIX
$sel:updatedTimestamp:EventDataStore' :: EventDataStore -> Maybe POSIX
updatedTimestamp} -> Maybe POSIX
updatedTimestamp) (\s :: EventDataStore
s@EventDataStore' {} Maybe POSIX
a -> EventDataStore
s {$sel:updatedTimestamp:EventDataStore' :: Maybe POSIX
updatedTimestamp = Maybe POSIX
a} :: EventDataStore) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromJSON EventDataStore where
parseJSON :: Value -> Parser EventDataStore
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EventDataStore"
( \Object
x ->
Maybe [AdvancedEventSelector]
-> Maybe POSIX
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Natural
-> Maybe EventDataStoreStatus
-> Maybe Bool
-> Maybe POSIX
-> EventDataStore
EventDataStore'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AdvancedEventSelectors"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreatedTimestamp")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EventDataStoreArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MultiRegionEnabled")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OrganizationEnabled")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RetentionPeriod")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"TerminationProtectionEnabled")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"UpdatedTimestamp")
)
instance Prelude.Hashable EventDataStore where
hashWithSalt :: Int -> EventDataStore -> Int
hashWithSalt Int
_salt EventDataStore' {Maybe Bool
Maybe Natural
Maybe [AdvancedEventSelector]
Maybe Text
Maybe POSIX
Maybe EventDataStoreStatus
updatedTimestamp :: Maybe POSIX
terminationProtectionEnabled :: Maybe Bool
status :: Maybe EventDataStoreStatus
retentionPeriod :: Maybe Natural
organizationEnabled :: Maybe Bool
name :: Maybe Text
multiRegionEnabled :: Maybe Bool
eventDataStoreArn :: Maybe Text
createdTimestamp :: Maybe POSIX
advancedEventSelectors :: Maybe [AdvancedEventSelector]
$sel:updatedTimestamp:EventDataStore' :: EventDataStore -> Maybe POSIX
$sel:terminationProtectionEnabled:EventDataStore' :: EventDataStore -> Maybe Bool
$sel:status:EventDataStore' :: EventDataStore -> Maybe EventDataStoreStatus
$sel:retentionPeriod:EventDataStore' :: EventDataStore -> Maybe Natural
$sel:organizationEnabled:EventDataStore' :: EventDataStore -> Maybe Bool
$sel:name:EventDataStore' :: EventDataStore -> Maybe Text
$sel:multiRegionEnabled:EventDataStore' :: EventDataStore -> Maybe Bool
$sel:eventDataStoreArn:EventDataStore' :: EventDataStore -> Maybe Text
$sel:createdTimestamp:EventDataStore' :: EventDataStore -> Maybe POSIX
$sel:advancedEventSelectors:EventDataStore' :: EventDataStore -> Maybe [AdvancedEventSelector]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AdvancedEventSelector]
advancedEventSelectors
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdTimestamp
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
eventDataStoreArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
multiRegionEnabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
organizationEnabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
retentionPeriod
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EventDataStoreStatus
status
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
terminationProtectionEnabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
updatedTimestamp
instance Prelude.NFData EventDataStore where
rnf :: EventDataStore -> ()
rnf EventDataStore' {Maybe Bool
Maybe Natural
Maybe [AdvancedEventSelector]
Maybe Text
Maybe POSIX
Maybe EventDataStoreStatus
updatedTimestamp :: Maybe POSIX
terminationProtectionEnabled :: Maybe Bool
status :: Maybe EventDataStoreStatus
retentionPeriod :: Maybe Natural
organizationEnabled :: Maybe Bool
name :: Maybe Text
multiRegionEnabled :: Maybe Bool
eventDataStoreArn :: Maybe Text
createdTimestamp :: Maybe POSIX
advancedEventSelectors :: Maybe [AdvancedEventSelector]
$sel:updatedTimestamp:EventDataStore' :: EventDataStore -> Maybe POSIX
$sel:terminationProtectionEnabled:EventDataStore' :: EventDataStore -> Maybe Bool
$sel:status:EventDataStore' :: EventDataStore -> Maybe EventDataStoreStatus
$sel:retentionPeriod:EventDataStore' :: EventDataStore -> Maybe Natural
$sel:organizationEnabled:EventDataStore' :: EventDataStore -> Maybe Bool
$sel:name:EventDataStore' :: EventDataStore -> Maybe Text
$sel:multiRegionEnabled:EventDataStore' :: EventDataStore -> Maybe Bool
$sel:eventDataStoreArn:EventDataStore' :: EventDataStore -> Maybe Text
$sel:createdTimestamp:EventDataStore' :: EventDataStore -> Maybe POSIX
$sel:advancedEventSelectors:EventDataStore' :: EventDataStore -> Maybe [AdvancedEventSelector]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [AdvancedEventSelector]
advancedEventSelectors
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdTimestamp
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
eventDataStoreArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
multiRegionEnabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
organizationEnabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
retentionPeriod
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EventDataStoreStatus
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
terminationProtectionEnabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
updatedTimestamp